query($sql); $firstRow = true; while ($row = mysql_fetch_array($rs)) { $isCurrPage = false; if (!isset($_GET["ID"]) && $firstRow) // i.e. we're showing the first available gallery $isCurrPage = true; else if ($row["ID"] == $_GET["ID"]) // i.e. specified gallery selected $isCurrPage = true; // little trick so current page is not a link $title = $row["Title"]; if ($isCurrPage) $title = "". $title; else $title = $title .""; printf('', $row["ID"], $title); $firstRow = false; } ?>
query($sql); $row = mysql_fetch_array($rs); if ($row) { printf('
%s

', $row["Title"]); if (strlen($row["Content"]) > 0) printf('
%s

', str_replace("\n", "
\n", $row["Content"])); outputImages($row['ID']); } ?>
'; echo ''; if ($dir = opendir($imgsDir)) { $img_count = 0; while ($file = readdir($dir)) { if (!is_dir($imgsDir . $file)) { $img_count++; $src = $imgsDir . $file; $href = str_replace("/th/", "/", $src); printf('
', $href, $src); if ($img_count % 5 == 0) echo ''; } } closedir($dir); //if ($img_count == 0) // echo "No images to display."; } echo ''; } ?>