diff --git a/img/img.extra.php b/img/img.extra.php index 3b38d86..8b8e457 100644 --- a/img/img.extra.php +++ b/img/img.extra.php @@ -3,7 +3,7 @@ /*------------------------------------------ * Img.Extra.php - Extra main functions * - * Copyright (c) 2013 David Todd(c0de) of http://www.unps-gama.info and http://unps.us + * Copyright (c) 2013 David Todd (c0de) of http://www.unps-gama.info and http://unps.us * for use with the image host (http://img.unps-gama.info) *------------------------------------------ */ @@ -42,16 +42,25 @@ function noimg(){ // Shown in place of the image if one isn't available $thelist = ''; - // Last Modified not working, so removed for the time being + $thethumbs = ''; + $_SESSION['thethumbs'] = ''; if($handle = opendir('Pictures')){ while(false != ($file = readdir($handle))){ if($file != "." && $file != ".." && $file != ".htaccess"){ - //$thelist .= 'Thumbnail for '.$file.'
└ '.$file.'

'."\n"; $thelist .= "-".$file; } } closedir($handle); } + 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); + } echo "

Please specify an image with the url: @@ -63,11 +72,16 @@

Uploaded Pictures:

"; $thelist = explode("-", $thelist); + $thethumbs = explode("-", $thethumbs); foreach($thelist as $pics){ if($pics == '' || $pics == null){ echo ''; - }else{ - echo ''.$pics.''."\n "; + }else{ // Checks if there is a thumbnail for the image, if not show nothumb.png + if(in_array($pics, $thethumbs)){ + echo ''.$pics.''."\n "; + }else{ + echo ''.$pics.''."\n "; + } } } echo"