\"Media
\"Instances\"
\"\"

\n"; // Open a known directory, and proceed to read its contents $dh = opendir($dir); while (($file = readdir($dh)) !== false) { if (is_dir($file) and $file!==".." and $file!==".") { if ($sd = opendir($file)) { $contentcount=0; // set image counter to zero while (($sdfile = readdir($sd)) !== false) { if ($sdfile!==".." and $sdfile!==".") { $workbitch=$file."/".$sdfile; if (is_dir($file."/".$sdfile)) { $ssd=opendir($workbitch); while (($ssdfile = readdir($ssd)) !== false) { if ($ssdfile!==".." and $ssdfile!==".") { if (preg_match('/\.(jpg|gif|png)$/i',$ssdfile)) { //match image file extensions ++$contentcount; //incriment image counter $modified=date("YmdHis",filemtime("$file/$sdfile/$ssdfile")); if ($latest<$modified) { $latest=$modified; $latestfile="$file/$sdfile/$ssdfile"; } } } } } } } closedir($sd); } if ($contentcount>0){ $inout="node_button.png"; }else{ $inout="node_button_in.png"; } //print out list of subdirectories if ($latest!=0) {$date="  Updated:  ".DateConvert($latest, "l, F j, Y, g:i a");} else { $date=""; } print " \n"; @$list=$file."uuu".$contentcount."uuu".$date."vvv".$list; $list=explode("vvv",$list); sort($list); $list=implode("vvv",$list); $modified="";$latest=""; print "\n"; } } closedir($dh); print "
\"inout\"
($contentcount) found
$date

\"header\"
"; if (isset($_GET["sd"])) { $tmp=$_GET["sd"]."/"; $dir_handle = @opendir("$tmp") or die("Unable to open $tmp"); while (false !== ($file = readdir($dir_handle))) { // read image file list into $content $tmp2=$tmp.$file."/"; if (is_dir($tmp2) and $file!==".." and $file!==".") { $content = $content . "," . $file; } } $test2=explode(",", $content); //convert $content to an array sort($test2); //sort the array $content=implode(",", $test2); //put it back as a string $test = preg_split('/[,]/',$content, -1, PREG_SPLIT_NO_EMPTY); $ss=""; $sscount=1; //used to make the links to the images $catcount=1; //used to number the subdirectories $textcontent=""; print "\n

"; echo trim($tmp, "\/"); print "

\n
  • "; print " \n"; foreach ($test as $content) { $tmp3=$tmp.$file.$content."/"; $dir_handle = @opendir("$tmp3") or die("Unable to open $tmp3"); while (false !== ($file = readdir($dir_handle))) { if (preg_match('/\.(txt|nfo)$/i',$file)) { $textcontent = $textcontent . "," . $file; } } $texttest = preg_split('/[,]/',$textcontent, -1, PREG_SPLIT_NO_EMPTY); $dir_handle = @opendir("$tmp3") or die("Unable to open $tmp3"); //makes the table rows displaying the subdirectory names print " \n \n"; $sscount=1; ++$catcount; } print "
    $catcount $content
      "; //this loop is used to make the links to the screenshots. while (false !== ($file = readdir($dir_handle))) { if (preg_match('/\.(jpg|gif|png)$/i',$file)) { $contentlen = strlen($file); $breakpoint = strrpos($file, '.'); $shortver = substr($file, 0, $breakpoint); // Find a matching caption file if it exists foreach ($texttest as $textcontent) { $textbreakpoint = strrpos($textcontent, '.'); $textshortver = substr($textcontent, 0, $textbreakpoint); if (strcasecmp($textshortver,$shortver)==0) { //read in the comment file, remove the whitespace from the start and end as well as remove any html tags $display = str_replace($dropthese, " ",(strip_tags(trim(file_get_contents("$tmp3$textcontent"))))); } } if (!isset($display)){ $display = "No Caption"; } // if no caption file is found it will say no caption. print "
    • [$sscount
      • ";if (extension_loaded('gd')){print "";}print "
      ]
    • "; unset($display); //reset caption // This is set to make the screen shot listings wrap at the given number of entries. if (floatval($sscount/$wrapamount)==intval($sscount/$wrapamount)){print "
      \n";} ++$sscount; } } print "
"; } print "\n
"; } else { /* Code below is for the popup image window */ $ss=$_GET["ss"]; $display=$_GET["cap"]; print ""; print " Loading...
\"$display\"
"; } ?>