diff --git a/img/index.php b/img/index.php index 5bec4a5..74ec718 100755 --- a/img/index.php +++ b/img/index.php @@ -1,5 +1,6 @@ alert('New thumbnails generated. Reload the page.');"); - // } + // Refresh the thumbnails on the fly - secretpassword123 will of course be changed when put online + if(!empty($_GET['generatenewthumbnailsformeprettyplease']) && $_GET['generatenewthumbnailsformeprettyplease'] == 'secretpassword123'){ + createThumbs(); + } // Declare variables so it doesn't complain to me later x.x $thelist = ''; @@ -63,7 +64,7 @@ * Recently Uploaded Pictures on sidebar - Frontend DONE - Backend Needed (upload) * DONE - Automatic detection of missing or nonexistant thumbnails (either replace with nothumb.png or generate new one on spot) * Force spaces on tags - * Fix headstuff() and title() + * Fix headstuff() and title() without raping the html by putting the tags in the wrong places * Multiple tags without search? * Classes? - Might just go as far as to seperate the functions * Temporarly dropped support for bitmap files until I learn how to generate those @@ -196,11 +197,25 @@ } $row = $result->fetch_assoc(); if ($row){ + $thethumbs = ''; + if($thumbs = opendir('thumbs')){ + while(false != ($fiel = readdir($thumbs))){ + // Test if thumbnail exists if not show nothumb.png + if($fiel != "." && $fiel != ".." && $fiel != ".htaccess"){ + $thethumbs .= "-".$fiel; + } + } + closedir($thumbs); + } + $thethumbs = explode("-", $thethumbs); $name = $row['name']; $name = explode("-", $name); foreach($name as $names){ - //echo ''; - echo ''.$names.''."\n "; + if(in_array($names, $thethumbs)){ + echo ''.$names.''."\n "; + }else{ + echo ''.$names.''."\n "; + } //echo ''.$names.''."\n "; } }else{ @@ -243,9 +258,14 @@