2023-12-16 09:37:58 -05:00
< ? php
include '../config/db_config.php' ;
include '../config/configuration.php' ;
//Setting up the webpage
echo '<html>' ;
echo '<head>' ;
echo '<link rel="stylesheet" href="../config/' . $stylesheet . '">' ;
echo '<meta charset="UTF-8">' ;
echo '<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">' ;
echo '<title>Browse - ' . $serverName . '</title>' ;
echo '</head>' ;
echo '<body class="background">' ;
echo '<div class="layout" align="center">' ;
echo '<h1>' . $serverName . '</h1>' ;
$count = 0 ;
//Connect to MySQL
$conn = mysqli_connect ( $sqlServer , $sqlUsername , $sqlPassword , $dbname );
if ( ! $conn ) {
die ( " CONNECTION FAIL " . mysqli_connect_error ());
} else {
}
echo '<h3>All public photos</h3>' ;
$browse = " SELECT * FROM $tablename WHERE isPrivate = 0 " ;
$result = mysqli_query ( $conn , $browse );
//browse all code goes here
if ( mysqli_num_rows ( $result ) > 0 ) {
while ( $row = mysqli_fetch_assoc ( $result )) {
$file = $row [ " imgID " ] . " . " . $row [ " fileType " ];
$count ++ ;
echo '<a href="../' . $targetDir . $file . '"><img src="../' . $targetDir . $file . '" alt="' . $row [ " imgID " ] . '" /></a>' ;
if ( $count == 3 ) { // Change this number based on how many pictures across you want on the page
echo '<br />' ;
}
}
} else {
2023-12-17 05:31:12 -05:00
echo " Shit, something broke. Try again! Maybe there's nothing here? Or if the problem persists after uploading, contact the system administrator or make a new issue on GitHub " ;
2023-12-16 09:37:58 -05:00
?>
< p >& nbsp ; </ p >
2023-12-17 05:31:12 -05:00
< a href = " ../ " > Home </ a >
2023-12-16 09:37:58 -05:00
< ? php
}
2023-12-17 05:31:12 -05:00
echo '<br>' ;
echo '<br>' ;
echo '<br>' ;
echo '<h6>' . $serverName . " - " . $serverVers . " </h6> " ;
2023-12-16 09:37:58 -05:00
echo '</body>' ;
echo '</html>' ;
?>