setImageFormat($x); $image->thumbnailImage($thumb_size, $thumb_size, TRUE); $image->writeImage($thumb_path); echo "creating thumb"; } return ""; } echo "return"; echo("

" . $_GET ["t"] . "

"); /* Get image paths */ /* Queries */ // Handle * and void to show everything if(!$_GET["t"] || $_GET["t"] == "*"){ exec($tmsu . "files " . $alone_exclude_query, $output); } // regular query else exec($tmsu . "files " . escape_cmd($_GET["t"] . $exclude_query), $output); /* Purge things that aren't images */ $total = sizeof($output); for($i = 0; $i < $total; $i++){ $x = pathinfo($output[$i],PATHINFO_EXTENSION); if($x != "jpg" && $x != "jpeg" && $x != "png") unset($output[$i]); } $output = array_values($output); $total = sizeof($output); // Set base directory $basedir = "/tag.php?"; if($_GET["t"]) $basedir = $basedir . "t=".$_GET["t"] . "&"; $basedir = $basedir . "p="; $max = 25; /* PAGE SELECTION BAR */ $num_pages = ceil($total/$max); $num_page_selector = 3; //number of pages selectable before and after if($_GET["p"] - $num_page_selector < 1) $lower_page_num = 1; else if($_GET["p"] + $num_page_selector > $num_pages) $lower_page_num = $num_pages - $num_page_selector*2; else $lower_page_num = $_GET["p"] - $num_page_selector; if(!$_GET["p"]) $_GET["p"] = 1; $step = ($_GET["p"] - 1) * $max; $psb = ""; $psb = $psb . "
\n"; if($_GET["p"] > 2){ $psb = $psb . "
|<
\n"; } if($_GET["p"] != 1){ $psb = $psb . "
<
\n"; } for($i = $lower_page_num; $i < $lower_page_num + $num_page_selector*2 + 1 && $i < $num_pages + 1; $i++){ $psb = $psb . "
\n"; if($i != $_GET["p"]) $psb = $psb . "".$i." \n"; else $psb = $psb . $i . " \n"; $psb = $psb . "
\n"; } if($_GET["p"] != $num_pages){ $psb = $psb . "
>
\n"; } if($_GET["p"] < $num_pages - 1){ $psb = $psb . "
>|
\n"; } $psb = $psb . "
\n"; /* END OF PAGE SELECTION BAR */ // Title if($total != 0) echo "

There are a total of " . $total . " images under the tag(s) " . $_GET["t"] . ".

\n"; else echo "There aren't any images with that tag query"; echo $psb; /* ACTUAL IMAGES */ echo "
"; for($i = 0 + $step; $i < $max + $step && $i < $total; $i++){ echo ""; echo "\n\t
\n"; //echo "\t\t" . basename($output[$i]) . "
\n"; echo "
" . thumbmake($output[$i]) . "
"; echo "\t
\n"; echo "
\n\n"; } echo "
"; echo $psb; ?>