diff options
-rw-r--r-- | includes/datas.php | 11 | ||||
-rw-r--r-- | pages/about.php | 2 | ||||
-rw-r--r-- | pages/home.php | 38 |
3 files changed, 47 insertions, 4 deletions
diff --git a/includes/datas.php b/includes/datas.php index 912eea8..2a47a4c 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -11,7 +11,8 @@ function topScores($mapid, $top = 5) { timediff(solutions.dateModified, TIMESTAMP(CURDATE())) as diff, users.displayName as display, solutions.moves as m, - users.ID as ID + users.ID as ID, + solutions.dateModified as cdate FROM `users` JOIN `solutions` @@ -28,19 +29,21 @@ function topScores($mapid, $top = 5) { $output .= "<th>Rank</th>"; $output .= "<th>Name</th>"; $output .= "<th>Moves</th>"; - $output .= "<th>Time taken</th>"; + $output .= "<th title='Time since map generated'>Time</th>"; $output .= "</tr>"; - while (list($diff, $display, $moves, $userID) = mysql_fetch_row($result)) { + while (list($diff, $display, $moves, $userID, $cdate) = mysql_fetch_row($result)) { $i++; if ($_SESSION['userID'] == $userID) $output .= "<tr style='background-color: #356;'>"; else $output .= "<tr>"; + $cdate = date("g:i A", strtotime($cdate)); + $output .= "<td>$i</td>"; $output .= "<td><span title='UserID: $userID'>$display</span></td>"; $output .= "<td>$moves</td>"; - $output .= "<td>$diff</td>"; + $output .= "<td title='Improved $cdate (EST)'>$diff</td>"; //$output .= "<b>$i. <span title='UserID: $userID'>$display</span> with $moves moves. In $diff<br /></b>"; $output .= "</tr>"; } diff --git a/pages/about.php b/pages/about.php index 69741d7..9181a87 100644 --- a/pages/about.php +++ b/pages/about.php @@ -22,6 +22,8 @@ topbar($Links); <br />Josh
<br />Rory Matthias Quentin Maison
<br />Matt
+ <br />Radivel
+ <br />Splax
</div>
<?php
diff --git a/pages/home.php b/pages/home.php index f263c2b..ef3438c 100644 --- a/pages/home.php +++ b/pages/home.php @@ -115,6 +115,44 @@ $mergesolution = $map; <div id="fb">
</div>
+<?PHP
+$timediff = strtotime("tomorrow") - strtotime("now");
+?>
+<script type="text/javascript">
+var countdownInt=self.setInterval("countdown()", 1000);
+var timerem = <? echo $timediff; ?>;
+
+function countdown() {
+ var hours;
+ var minutes;
+ var seconds;
+ var stamp;
+ if (timerem < 1)
+ window.clearInterval(countdownInt);
+ hours = Math.floor(timerem / 3600);
+ minutes = Math.floor((timerem - (hours * 3600)) / 60);
+ seconds = timerem % 60;
+
+ hours = addZero(hours);
+ minutes = addZero(minutes);
+ seconds = addZero(seconds);
+
+ stamp = hours + ":" + minutes + ":" + seconds;
+ document.getElementById("countdown").innerHTML = stamp;
+
+ timerem--;
+}
+
+function addZero(num) {
+ var numStr = num + '';
+ if (numStr.length < 2)
+ numStr = "0" + numStr;
+ return numStr;
+}
+</script>
+ <div style='text-align: center; margin-top: 5px'>
+ New maps in: <span id="countdown">00:00:00</span>
+ </div>
</div>
<div id="copy">
|