setPageTitle("Random Timers"); $currBanner->addContent("Random Timers"); $currNavbar->setCustomLinksTitle("Random Timers"); $currNavbar->addCustomLink("/timers.php?action=add", "Add a timer"); $currNavbar->addCustomLink("/timers.php?action=viewUsers", "Top Ranked Submitters"); $currNavbar->addCustomLink("/timers.php?action=showAll", "Show Every Timer"); // if the person wants to be added, lets give them a form. if ($_REQUEST["action"] == "add") { ?>

Add a Timer.

This will let you add a timer. It'll start showing up on the site randomly, and life will be good. If you aren't logged in, then Anonymous Coward will own the timer. (you can tell if you're logged in at the top right corner, if user has your name beside it, then you're good).


Date the timer starts from (format: yyyy-mm-dd hh:mm:ss) (eg: 2003-11-01 00:00:00):
Date after which the timer should go away (same format as above - for never expires just use the default value):
Direction the timer counts
Increment of time to show in the timer
Text of the timer. Use %%1 to represent the actual time that is being tracked. eg: The game starts in %%1.
Timer added successfully!

"); // zero the counter so the quote will show up randomly $query = "UPDATE randomTimers SET counter = 0"; mysql_query($query); } if (!$result) print("

We could not add that timer. Perhaps it is already in use, or you did not fill out all fields. Here is the exact error: " . mysql_error() . "

"); } else { print("

Sorry, you do not have permission to do that. As usual, you can blame this on a few idiots (or actually, just one from Alberta) ruining it for everybody else.

"); } } // if we're viewing the submitters list elseif ($_REQUEST["action"] == "viewUsers") { $query = "SELECT users.username, users.id, COUNT(randomTimers.owner) AS timercount FROM randomTimers, users WHERE users.id = randomTimers.owner GROUP BY users.id ORDER BY timercount DESC, username ASC"; $title = "Who has the most timers?"; $result = mysql_query($query); print("

$title

\n"); print("\n"); print("\n"); while ($row = mysql_fetch_array($result)) { ?> \n"); } // show all timers elseif ($_REQUEST["action"] == "showAll") { $query = "SELECT randomTimers.id, username FROM randomTimers, users WHERE randomTimers.owner = users.id ORDER BY username ASC, id ASC"; $title = "All Timers"; $result = mysql_query($query); print("

$title

\n"); print("
UserTimers
\n"); print("\n"); while ($row = mysql_fetch_array($result)) { $myTimer = new HG_RandomTimer($row["id"]); $timerText = $myTimer->getTimer(); $timerDate = $myTimer->timerDate; print("\n"); } print("
OwnerTimerTimer Date
$row[username]$timerText$timerDate
\n"); } // if we're doing nothing else { ?>

Random Timers are those boxes that appear on the site which tell you either how close something is, or how long ago it happened. They serve no real purpose whatsoever, except that they're neat.