A project by Christopher Thomas Nicodemus.
Instructions: Just enter a nick name (or leave it blank), and then hit the reset button whenever you want!
How it works: It uses MySQL to store the resets in a database and PHP for the page generation. Then AJAX is used for showing the updated time. The comic to the left is from XKCD.com, it gave me the idea for this project. Complete source code below.
It has been 213 days, 3 hours, 28 minutes and 49 seconds since someone reset this sign.
On average, it has been reset every 40 days, 16 hours, 41 minutes and 41 seconds.
Since the beginning in September 2008 the sign has been reset a total of 90 times.
//This is the AJAX code that requests the time every second for a period of time.
//This will be replaced with better ajax code in the future.
//This is the code to decompress the data from the server.
// Update for up to 10 days.
echo '<table><tr><td><a href="http://xkcd.com/363/"><img alt="picture from xkcd.com"
PHP for the page generation. Then AJAX is used for showing the updated time.
The comic to the left is from XKCD.com, it gave me the idea for this project.
/*Site Updated: 2008-09-11<br>Added multiple realms with their own reset times.
echo '<h3>Your nick name (Max 12):<br><input type="text" value="'.$_SESSION['nickname'].'" name="nickname" size="12"
//This checks the RCode and if it is a valid reset click, do the reset!
// This takes a number of seconds and converts it to a format like x years, y days, and z seconds.
//Do we say and or put a , or is this it?
//Do we say and or is this it?
//Create a reset code, so someone can't just reset by visiting the reset URL.
//to request it every sec.
//This displays the average reset time on the main page.
//This function returns the total number of times the button has been hit.
//This functions displays the last so many resets, a person can walk through the list.
$ret .= '<a href="index.php?r=' . $r . '&lastStart=' .
$ret .= ' <a href="index.php?r=' . $r . '&lastStart=' .
$ret .= '<tr><td>' . $x++ . '</td><td><a href="userstats.php?user=' .
createTime ( $row ['gap'] ) . '</td><td>' .
//This functions displays the best reset times, a person can walk through the list.
//Check that a list view number is actually a number.
//Check if the provided number is an integer.
//Stats for individual users. Displays resets and average reset time.
FROM `resetbutton` WHERE `realm` = $r AND `user` = " . $db->quoteSmart(stripcslashes($user)) . "
//Verify that the reset code is a valid one, then reset and delete the code.
//This occurs when a person validly hits the reset button.
//This is the page that is requested every second to update the last reset time to the client.
//Takes a number of seconds and converts it to something like X years, Y days, and Z seconds.
//It then compresses the result and sends it to the client.