diff options
-rw-r--r-- | index.php | 11 | ||||
-rw-r--r-- | pages/scores.php (renamed from pages/leaderboard.php) | 164 |
2 files changed, 126 insertions, 49 deletions
@@ -51,7 +51,7 @@ $footerLinks['members'] = "Member List"; //ROW 2
$footerLinks['chat'] = "Chat";
-$footerLinks['leaderboard'] = "Scores";
+$footerLinks['scores'] = "Scores";
$footerLinks['about'] = "About Us";
//ROW 3
@@ -71,7 +71,7 @@ $footerLinks['#top'] = "Back to Top"; //Links appear in order.
$Links['home'] = "Home";
-$Links['leaderboard'] = "Scores";
+$Links['scores'] = "Scores";
$Links['challengelist'] = "Challenges <i>BETA!</i>";
//$Links['howtoplay'] = "How to Play";
//$Links['tutorial'] = "Tutorial";
@@ -149,8 +149,13 @@ switch ($request) { require("pages/howtoplay.php");
break;
+ //Support older links.
case "leaderboard":
- require("pages/leaderboard.php");
+ header("Location: $mydomain"."scores?date=".$_GET['date']);
+ exit;
+ break;
+ case "scores":
+ require("pages/scores.php");
break;
case "cp":
diff --git a/pages/leaderboard.php b/pages/scores.php index 963faa2..3a79529 100644 --- a/pages/leaderboard.php +++ b/pages/scores.php @@ -1,45 +1,9 @@ <?php
-htmlHeader(array('stats', 'challenge'), 'Pathery Scores', 'Score history for Pathery');
-?>
-
-<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
-
-
-<script>
-
-$.ajaxSetup ({
- cache: false
-});
-var ajax_load = "<img src='images/loading.gif' alt='loading...' />";
-// load() functions
-var loadUrl = "ajax/load.php";
-
-$("#load_basic").click(function(){
- $("#result").html(ajax_load).load(loadUrl);
-});
-
-var loadUrl = "ajax/load.php";
-
-$("#load_basic").click(function(){
- $("#result").html(ajax_load).load(loadUrl);
-});
-
-
-function displayMap(mapID) {
- var urlString = 'ajax/scores.ajax.php?mapID='+mapID;
- $("#mapDisplay").hide('fast');
- //.html(ajax_load)
- $("#mapDisplay").load(urlString, null, function() {$("#mapDisplay").fadeIn('slow');});
- //urlString = 'do.php?r=reqScorePage&reqPage=1&mapID='+mapID;
- //$("#scoreDisplay").html(ajax_load).load(urlString);
-}
-</script>
-
-
-<body>
-
-<?php
-topbar($Links);
+htmlHeader(
+ array('stats', 'challenge'), 'Scores',
+ 'Score history for Pathery',
+ array('scores', 'dateformat')
+);
include_once('./includes/maps.php');
//include('./includes/mapoftheday.php');
@@ -82,6 +46,115 @@ if ($daysAgo < 1) die("You must specify a date previous to today.");
+?>
+
+<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
+<script type="text/javascript" src="js/jquery.keystrokes.min.js"></script>
+
+<script>
+
+
+//Contra
+$(document).bind('keystrokes', {
+keys: ['arrow up', 'arrow up', 'arrow down', 'arrow down', 'arrow left', 'arrow right', 'arrow left', 'arrow right', 'b', 'a', 'enter']
+}, function(){
+alert('You unlocked awesomeness!');
+});
+
+
+var daysAgo = <? echo $daysAgo; ?>;
+
+$.ajaxSetup ({
+ cache: false
+});
+var ajax_load = "<img src='images/loading.gif' alt='loading...' />";
+// load() functions
+var loadUrl = "ajax/load.php";
+
+$("#load_basic").click(function(){
+ $("#result").html(ajax_load).load(loadUrl);
+});
+
+var loadUrl = "ajax/load.php";
+
+$("#load_basic").click(function(){
+ $("#result").html(ajax_load).load(loadUrl);
+});
+
+
+function displayMap(mapID) {
+ var urlString = 'ajax/scores.ajax.php?getmap=true&mapID='+mapID;
+ $("#mapDisplay").fadeOut('fast');
+ //.html(ajax_load)
+ $("#mapDisplay").load(urlString, null, function() {$("#mapDisplay").fadeIn('slow');});
+ urlString = 'do.php?r=reqScorePage&reqPage=1&mapID='+mapID;
+ //$("#scoreDisplay").html(ajax_load).load(urlString);
+
+ if (!$('#'+mapID+',dspScore').length) {
+ var newDiv = $('<div/>', {
+ 'id': mapID+',dspScore',
+ html: ''
+ });
+ $('#scoreDisplay').empty();
+ newDiv.prependTo('#scoreDisplay');
+ }
+ scoresShowPage(mapID, 1);
+
+ // $.ajax({
+ // type: "GET",
+ // url: "ajax/chat.ajax.php",
+ // data: dataString,
+ // success: function(data) {getChatDone(data);}
+ // });
+ // var newDiv = $('<div/>', {
+ // 'id': mapID+',dspScore',
+ // 'class': 'my-new-list',
+ // 'style': 'display: none',
+ // html: ''
+ // });
+}
+function getMaplist(request) {
+ // daysAgo++
+ switch (request) {
+ case "next":
+ if (daysAgo <= 1)
+ return;
+ daysAgo--;
+ break;
+ case "prev":
+ daysAgo++;
+ break;
+ case "yesterday":
+ if (daysAgo == 1)
+ return;
+ daysAgo = 1;
+ break;
+ }
+
+ var urlString = 'ajax/scores.ajax.php?getmaplist=true&daysago='+daysAgo;
+ $("#mapNavigation").fadeOut('fast');
+ //.html(ajax_load)
+ $("#mapNavigation").load(urlString, null, function() {$("#mapNavigation").fadeIn('slow');});
+}
+
+
+function handleJSONResponse(data) {
+ json = jQuery.parseJSON(data);
+ // $.each(json, function(key, user) {
+
+ // }
+}
+
+</script>
+
+
+<body>
+
+<?php
+topbar($Links);
+
+
+
$todaysScoreMaps = getMapsPlayed($daysAgo);
?>
@@ -93,9 +166,9 @@ $todaysScoreMaps = getMapsPlayed($daysAgo); </div>
<div id="daynav">
-<a href='javascript:alert("prev");' title='Older'>< Previous Day</a>
-<a href='javascript:alert("next");' title='Newer'>Next Day ></a>
-<a href='javascript:alert("current");' title='Now'>Current Day >></a>
+<a href='javascript:getMaplist("prev");' title='Older'>< Previous Day</a>
+<a href='javascript:getMaplist("next");' title='Newer'>Next Day ></a>
+<a href='javascript:getMaplist("yesterday");' title='Now'>Yesterday >></a>
<div id='mapNavigation'>
<? echo getMapNavigation($todaysScoreMaps); ?>
</div>
@@ -156,8 +229,7 @@ if ($specialMapName != '') <div id=\"yms-$mapType\">
<div id='scoreDisplay' class="col1">
- <b>EXAMPLE DATA</b>
- <table class="score"><tbody><tr><td colspan="3" style="text-align:center;"> <b style="color:#aaaabb; font-size:150%;">1</b> <a href="javascript:scoresShowPage(2768, 2)">2</a> <a href="javascript:scoresShowPage(2768, 3)">3</a> <a href="javascript:scoresShowPage(2768, 4)">4</a></td></tr><tr title="Updated 4:49 AM (EST)"><th>Rank</th><th style="width:125px; overflow:hidden; text-align:left; padding-left:42px;">Name</th><th>Moves</th></tr><tr style=" background-color: #20202a; color:#a9b1f6;" title="Scored 9:01:09 PM"><td style="text-align:left;"><img title="Current Champion" src="../images/MedalGoldCAR.png" style="width:32px;height:32px;vertical-align:middle">1</td><td style="vertical-align: middle;"> <div class="grid_td" style="float:left; width:35px; height:35px; background:#4444ff url(images/marks/DiagonalCover_B.png);"> <div style="background-color:transparent;" class="grid_td_inner grid_td_rocks"> </div> </div><span style="float:left; padding: 5px 0px 3px 3px; width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; "><a href="achievements?id=378" style="color:#a9b1f6">vzl[pi]</a></span></td><td style="text-align:right;">41</td></tr><tr style=" background-color: #262631; color:#aafcbb;" title="Scored 9:01:58 PM"><td style="text-align:left;"><img title="Tied Top Score" src="../images/MedalSilverCAR.png" style="width:32px;height:32px;vertical-align:middle">2</td><td style="vertical-align: middle;"> <div class="grid_td" style="float:left; width:35px; height:35px; background:#eeeeee url(images/marks/blank.png);"> <div style="background-color:transparent;" class="grid_td_inner grid_td_rocks"> </div> </div><span style="float:left; padding: 5px 0px 3px 3px; width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; "><a href="achievements?id=348" style="color:#aafcbb">Anderson[pi]</a></span></td><td style="text-align:right;">41</td></tr><tr style=" background-color: #20202a; color:#a9b1f6;" title="Scored 9:08:46 PM"><td style="text-align:left;"><img title="Tied Top Score" src="../images/MedalSilverCAR.png" style="width:32px;height:32px;vertical-align:middle">3</td><td style="vertical-align: middle;"> <div class="grid_td" style="float:left; width:35px; height:35px; background:#eeeeee url(images/marks/CrossXL_B.png);"> <div style="background-color:transparent;" class="grid_td_inner grid_td_rocks"> </div> </div><span style="float:left; padding: 5px 0px 3px 3px; width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; "><a href="achievements?id=393" style="color:#a9b1f6">???t?d?</a></span></td><td style="text-align:right;">41</td></tr><tr style=" background-color: #262631; color:#a9b1f6;" title="Scored 9:29:36 PM"><td style="text-align:left;"><img title="Tied Top Score" src="../images/MedalSilverCAR.png" style="width:32px;height:32px;vertical-align:middle">4</td><td style="vertical-align: middle;"> <div class="grid_td" style="float:left; width:35px; height:35px; background:#cc22aa url(images/marks/DiagonalCover_B.png);"> <div style="background-color:transparent;" class="grid_td_inner grid_td_rocks"> </div> </div><span style="float:left; padding: 5px 0px 3px 3px; width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; "><a href="achievements?id=370" style="color:#a9b1f6">DothThouHoist?</a></span></td><td style="text-align:right;">41</td></tr><tr style=" background-color: #20202a; color:#aafcbb;" title="Scored 9:34:16 PM"><td style="text-align:left;"><img title="Tied Top Score" src="../images/MedalSilverCAR.png" style="width:32px;height:32px;vertical-align:middle">5</td><td style="vertical-align: middle;"> <div class="grid_td" style="float:left; width:35px; height:35px; background:#aaaa22 url(images/marks/CrossXL_B.png);"> <div style="background-color:transparent;" class="grid_td_inner grid_td_rocks"> </div> </div><span style="float:left; padding: 5px 0px 3px 3px; width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; "><a href="achievements?id=400" style="color:#aafcbb">WuTheFWasThat</a></span></td><td style="text-align:right;">41</td></tr><tr style=" background-color: #262631; color:#cccccc;" title="Scored 9:38:52 PM"><td style="text-align:left;"><img title="Tied Top Score" src="../images/MedalSilverCAR.png" style="width:32px;height:32px;vertical-align:middle">6</td><td style="vertical-align: middle;"> <div class="grid_td" style="float:left; width:35px; height:35px; background:#ff9922 url(images/marks/OffsetStripesVertical_B_I.png);"> <div style="background-color:transparent;" class="grid_td_inner grid_td_rocks"> </div> </div><span style="float:left; padding: 5px 0px 3px 3px; width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; "><a href="achievements?id=466" style="color:#cccccc">Eric (??)</a></span></td><td style="text-align:right;">41</td></tr><tr style=" background-color: #20202a; color:#cccccc;" title="Scored 10:07:19 PM"><td style="text-align:left;"><img title="Tied Top Score" src="../images/MedalSilverCAR.png" style="width:32px;height:32px;vertical-align:middle">7</td><td style="vertical-align: middle;"> <div class="grid_td" style="float:left; width:35px; height:35px; background:#9922ff url(images/marks/OffsetStripesVertical_B_I.png);"> <div style="background-color:transparent;" class="grid_td_inner grid_td_rocks"> </div> </div><span style="float:left; padding: 5px 0px 3px 3px; width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; "><a href="achievements?id=574" style="color:#cccccc">Lana Del Gabe</a></span></td><td style="text-align:right;">41</td></tr><tr style=" background-color: #262631; color:#cccccc;" title="Scored 10:26:34 PM"><td style="text-align:left;"><img title="Tied Top Score" src="../images/MedalSilverCAR.png" style="width:32px;height:32px;vertical-align:middle">8</td><td style="vertical-align: middle;"> <div class="grid_td" style="float:left; width:35px; height:35px; background:#666666 url(images/marks/);"> <div style="background-color:transparent;" class="grid_td_inner grid_td_rocks"> </div> </div><span style="float:left; padding: 5px 0px 3px 3px; width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; "><a href="achievements?id=474" style="color:#cccccc">deWax</a></span></td><td style="text-align:right;">41</td></tr><tr style=" background-color: #20202a; color:#aafcbb;" title="Scored 10:34:46 PM"><td style="text-align:left;"><img title="Tied Top Score" src="../images/MedalSilverCAR.png" style="width:32px;height:32px;vertical-align:middle">9</td><td style="vertical-align: middle;"> <div class="grid_td" style="float:left; width:35px; height:35px; background:#666666 url(images/marks/CircleSmall_W.png);"> <div style="background-color:transparent;" class="grid_td_inner grid_td_rocks"> </div> </div><span style="float:left; padding: 5px 0px 3px 3px; width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; "><a href="achievements?id=406" style="color:#aafcbb">Jared[pi]</a></span></td><td style="text-align:right;" id="aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown">41</td></tr><tr style=" background-color: #262631; color:#ffbb77;" title="Scored 10:36:12 PM"><td style="text-align:left;"><img title="Tied Top Score" src="../images/MedalSilverCAR.png" style="width:32px;height:32px;vertical-align:middle">10</td><td style="vertical-align: middle;"> <div class="grid_td" style="float:left; width:35px; height:35px; background:#ffdd88 url(images/marks/CircleLargeDonut_B.png);"> <div style="background-color:transparent;" class="grid_td_inner grid_td_rocks"> </div> </div><span style="float:left; padding: 5px 0px 3px 3px; width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; "><a href="achievements?id=134" style="color:#ffbb77">Goa [R-TD]</a></span></td><td style="text-align:right;">41</td></tr></tbody></table>
+
</div>
<div id='mapDisplay' style='display:none' class="col2">
|