diff --git a/img/img.extra.php b/img/img.extra.php
index 81289fb..ed79481 100644
--- a/img/img.extra.php
+++ b/img/img.extra.php
@@ -7,15 +7,6 @@
* for use with the image host (http://img.unps-gama.info)
*------------------------------------------
*/
-
- function headstuff(){ // Sets the meta tags - WIP/iffy
- if(isset($_SESSION['img'])){
- echo "\n";
- echo " \n";
- echo " \n";
- echo " \n";
- }
- }
function textstuff(){ // Sets up right side box of info under the other sidebars
if($_SESSION['noimg'] == false){
@@ -41,17 +32,7 @@
}
function noimg(){ // Shown in place of the image if one isn't available
- $thelist = '';
$thethumbs = '';
- $_SESSION['thethumbs'] = '';
- if($handle = opendir('Pictures')){
- while(false != ($file = readdir($handle))){
- if($file != "." && $file != ".." && $file != ".htaccess"){
- $thelist .= "-".$file;
- }
- }
- closedir($handle);
- }
if($thumbs = opendir('thumbs')){
while(false != ($fiel = readdir($thumbs))){
// Test if thumbnail exists if not show nothumb.png
@@ -69,32 +50,38 @@
- Uploaded Pictures:
+ Uploaded Pictures:
";
- $thelist = explode("-", $thelist);
$thethumbs = explode("-", $thethumbs);
- foreach($thelist as $pics){
- if($pics == '' || $pics == null){
- echo '';
- }else{ // Checks if there is a thumbnail for the image, if not show nothumb.png
- if(in_array($pics, $thethumbs)){ // Totally figured out how to use in_array by looking at default php scripts (Thank you wingrep :3)
- echo ''."\n ";
+ // The following code has a bunch of whitespaces in it to make the html look nice when its source is looked at
+ $output = " \n";
+ $output .= " \n";
+ $dir = opendir("Pictures");
+ $counter = 0;
+ while (false !== ($fname = readdir($dir))){
+ if ($fname != '.' && $fname != '..'){
+ $output .= " ";
+ if(in_array($fname, $thethumbs)){ // Totally figured out how to use in_array by looking at default php scripts (Thank you wingrep :3)
+ $output .= '';
}else{
- echo ''."\n ";
+ $output .= '';
+ }
+ //$output .= "";
+ $output .= " | \n";
+ $counter += 1;
+ if ($counter % 5 == 0){
+ $output .= "
\n";
}
}
}
+ closedir( $dir );
+ $output .= "
\n";
+ $output .= "
";
+ // End of weird whitespaces
+ echo $output;
echo"
";
}
- function title(){ // Suffers same problem as headstuff()
- if(!isset($_SESSION['img'])){
- echo "";
- }else{
- echo " - Now Showing: ".$_SESSION['img'];
- }
- }
-
?>
\ No newline at end of file