<?
/*
Title: Picture of the Timeframe
Last Edited: July 29, 2006
Author: JKaizer
Do I need some sort of license?? Oo;;;
CHANGE LOG
Jul29: Added the slideshow feature
Apr10: Oooh, a random picture now :D
Apr8: Start of change log. Added comments throughout the code to make it a tad easier to navigate.
*/
// We need variables before we do anything
$id = $_GET['id']; // The picture ID, if we're doing the archive
$action = $_GET['action']; // If we're not just viewing a "chosen" picture, we can use this.
$prevpott = $id - 1;
$nextpott = $id + 1;
//
// The Archive
//
if ($action == old) {
print "<h2><div align=\"left\" style=\"float: center; padding: 2px;\"><b>Picture of the Timeframe Archive</b></div></h2>";
print "<div style=\"float: center; padding: 2px;\">";
print "<div align=\"center\">";
$times = $pott;
$x = 001;
while ($x <= $times) {
if ($x < 10) { echo "<a href=\"?page=pott&id=00$x\"><img src=\"images/pott/00$x.sm\" style=\"border: 0px solid #000000; padding: 2px;\" alt=\"Mini PotT\" /></a>"; }
else if ($x > 9 && $x < 100) { echo "<a href=\"?page=pott&id=0$x\"><img src=\"images/pott/0$x.sm\" style=\"border: 0px solid #000000; padding: 2px;\" alt=\"Mini PotT\" /></a>"; }
else { echo "<a href=\"?page=pott&id=$x\"><img src=\"images/pott/$x.sm\" style=\"border: 0px solid #000000; padding: 2px;\" alt=\"Mini PotT\" /></a>"; }
++$x;
}
print "</div>";
}
//
// End The Archive
//
//
// Start Slideshow
//
if ($action == slideshow) {
print "<h2><div align=\"left\" style=\"float: center; padding: 2px;\"><b>Picture of the Timeframe Slideshow</b></div></h2>";
print "<div style=\"float: center; padding: 2px;\">";
if (!$id) { print "You need to chose a picture silly! Go to the <a href=\"?page=pott&action=old\">archive</a> and choose one!"; }
else {
print "<div align=\"center\">";
print "<img src=\"images/pott/$id.jpg\" alt=\"Current\" /><br /><br />"; // The current picture
// Previous
if ($prevpott == 0) { print ""; }
else if ($prevpott < 10) { print "<div style=\"float: left; padding-left: 50px;\"><a href=\"?page=pott&action=slideshow&id=00$prevpott\"><img src=\"images/pott/00$prevpott.sm\" style=\"border: 0px solid #000000; alt=\"Previous\" /><br />Previous</a></div>"; }
else if ($prevpott > 9 && $prevpott < 100) { print "<div style=\"float: left; padding-left: 50px;\"><a href=\"?page=pott&action=slideshow&id=0$prevpott\"><img src=\"images/pott/0$prevpott.sm\" style=\"border: 0px solid #000000; alt=\"Previous\" /><br />Previous</a></div>"; }
else { print "<div style=\"float: left; padding-left: 50px;\"><a href=\"?page=pott&action=slideshow&id=$prevpott\"><img src=\"images/pott/$prevpott.sm\" style=\"border: 0px solid #000000; alt=\"Previous\" /><br />Previous</a></div>"; }
// Next
if ($nextpott == $pott + 1) { print ""; }
else if ($nextpott < 10) { print "<div style=\"padding-right: 50px; float: right;\"><a href=\"?page=pott&action=slideshow&id=00$nextpott\"><img src=\"images/pott/00$nextpott.sm\" style=\"border: 0px solid #000000; alt=\"Next\" /><br />Next</a></div>"; }
else if ($nextpott > 9 && $nextpott < 100) { print "<div style=\"padding-right: 50px; float: right;\"><a href=\"?page=pott&action=slideshow&id=0$nextpott\"><img src=\"images/pott/0$nextpott.sm\" style=\"border: 0px solid #000000; alt=\"Next\" /><br />Next</a></div>"; }
else { print "<div style=\"padding-right: 50px; float: right;\"><a href=\"?page=pott&action=slideshow&id=$nextpott\"><img src=\"images/pott/$nextpott.sm\" style=\"border: 0px solid #000000; alt=\"Next\" /><br />Next</a></div>"; }
}
}
//
// End Slideshow
//
//
// Random Picture~
//
else if ($action == random) {
echo "<h2><div align=\"left\" style=\"float: center; padding: 2px;\"><b>Random PotT!</b></div></h2>";
echo "<div style=\"float: center; padding: 2px;\">";
echo "Because we all like to be random!";
echo "<br /><br />";
echo "<div align=\"center\">";
$randompic = rand(1,$pott);
if ($randompic < 10) { echo "<img src=\"images/pott/00$randompic.jpg\" style=\"border: 0px solid #000000; padding: 2px;\" alt=\"Random Pic!\" />"; }
else if ($randompic > 9 && $randompic < 100) { echo "<img src=\"images/pott/0$randompic.jpg\" style=\"border: 0px solid #000000; padding: 2px;\" alt=\"Random Pic!\" />"; }
else { echo "<img src=\"images/pott/$randompic.jpg\" style=\"border: 0px solid #000000; padding: 2px;\" alt=\"Random Pic!\" />"; }
print "</div>";
}
//
// End Random Picture
//
//
// And if we aren't in the pretty gallery, or in a slideshow, or doing the random picture...
// let's just post the PotT! :D
//
else {
echo "<h2><div align=\"left\" style=\"float: center; padding: 2px;\"><b>Picture of the Timeframe";
// Check to see if it's an old picture - if it is, add " Archive" after it
if (!$id) { echo ""; }
else { echo " Archive"; }
// End check
echo "</b></div></h2>";
echo "<div style=\"float: center; padding: 2px;\">";
// Old or new pic? We have different phrases for that
if (!$id) { echo "Randomly updated with a new picture every now and then :D"; }
else { echo "This is the archive of the PotT. You're looking at picture number $id :D<br /><br />Wanna start a slideshow? Then <a href=\"?page=pott&action=slideshow&id=$id\">click here</a>!"; } // oh, connecting the slideshow up!
// End
echo "<br /><br />";
echo "<div align=\"center\">";
$folder = "images/pott/";
$ext = ".jpg";
$main = "images/pott/$pott.jpg"; // if we don't have $id set
$page = "$folder" . $_GET['id']; // find out what image we're dealing with here
$newpage = $page . $ext;
if(!isset($_GET['id'])){
print "<img src=\"$main\" alt=\"PotT\" />"; // do this if we don't have $id set
}
else {
print "<img src=\"$newpage\" alt=\"PotT\" />"; // and if we do :D
}
echo "</div>";
}
?>