diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2013-02-17 03:06:24 -0800 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2013-02-17 03:06:24 -0800 |
commit | e6ecd5ae507731050d7281f2a2a192849f41912b (patch) | |
tree | 07956b8f2725935dd5fd6078a1c2f95d64bf5b40 /pages/scores.php | |
parent | aecf8ced62fd1e8594239566d62f5cc71e8fd27c (diff) | |
download | pathery-e6ecd5ae507731050d7281f2a2a192849f41912b.tar.xz |
Now using Jquery everywhere.
Moved displayMap to mapSpecs.
Using displayMap @ Home.
Cleaned up scores page.
Diffstat (limited to 'pages/scores.php')
-rw-r--r-- | pages/scores.php | 88 |
1 files changed, 25 insertions, 63 deletions
diff --git a/pages/scores.php b/pages/scores.php index 118dfa7..cf33b49 100644 --- a/pages/scores.php +++ b/pages/scores.php @@ -5,51 +5,23 @@ htmlHeader( array('scores', 'dateformat')
);
-include_once('./includes/maps.php');
-//include('./includes/mapoftheday.php');
-include_once('./includes/datas.php');
-include_once('./includes/mapclass.php');
-include_once('./includes/constants.php');
-
-include_once ('./includes/sqlEmbedded.php');
-
-$time_start = microtime(true);
-$time_end = microtime(true);
-
-//TESTCODE
-
-$time = $time_end - $time_start;
-if ($_GET['debug'] == true) echo "StatContent Rechieve: $time seconds\n";
-
-
//The date to display
$dateDisplay = date('Y-m-d', strtotime("-1 days"));
//This is only used in a strtotime function, so this should be safe.
if (isset($_GET['date'])) {
$dateLookup = $_GET['date'];
- if (!strtotime($dateLookup))
- $dateLookup = $dateDisplay;
-} else
- $dateLookup = $dateDisplay;
-
-$daysAgo = day_diff($dateLookup, date('Y-m-d'));
-$dateAgo = strtotime("-$daysAgo days");
+ if (!strtotime($dateLookup)) $dateLookup = $dateDisplay;
+} else $dateLookup = $dateDisplay;
-$dateAsStr = date('l, F jS, Y', $dateAgo);
$dateNextDay = date('Y-m-d', strtotime("+1 day", $dateAgo));
-$datePrevDay = date('Y-m-d', strtotime("-1 day", $dateAgo));
-
-//No cheater cheaters
-if ($daysAgo < 1)
- die("You must specify a date previous to today.");
//!! TODO:
$timeUntilNewDailyMap = strtotime("tomorrow") - strtotime("now");
?>
-<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 type="text/javascript">
@@ -98,19 +70,6 @@ keys: ['arrow up', 'arrow up', 'arrow down', 'arrow down', 'arrow left', 'arrow alert('You unlocked awesomeness!');
});
-function displayMap(mapID, divID, goalSize) {
- $("#mapDisplay").fadeOut('fast');
- $.ajax({
- type: "GET",
- url: 'map/'+mapID+".js",
- cache: true,
- data: '',
- //TODO: Better fail option?
- fail: (function() { console.log("FAIL Map Download"); }),
- complete: function(data) {$("#"+divID).html(mapAsHTML(decryptJSON(data.responseText), goalSize)).fadeIn('slow');}
- });
-}
-
function displayMapScores(mapID) {
pointerMapID = mapID;
updateHash();
@@ -123,6 +82,7 @@ function displayMapScores(mapID) { newDiv.prependTo('#scoreDisplay');
}
scoresShowPage(1, mapID);
+ $("#mapDisplay").fadeOut('fast');
displayMap(mapID, "mapDisplay", 595);
}
@@ -136,10 +96,7 @@ function updateHash() { }
var pointerDate;
-function getMapIDs(request) {
- console.log("getMapIDs exe", request);
-
- pointerDate = request;
+function getMapIDs(request) {
switch (request) {
case "next":
if (pointerTime.getTime() + (24*60*60*1000) > serverTime.getTime()) {
@@ -159,8 +116,6 @@ function getMapIDs(request) { pointerDate = pointerTime.format("yyyy-mm-dd");
break;
}
-
- console.log("setting showdate");
$('#displayDate').html(pointerTime.format("dddd, mmmm ddS, yyyy"));
var urlString = "ajax/scores.ajax.php?getmapidsbydate="+pointerDate;
@@ -283,31 +238,38 @@ function mapThumbnailHTML(map, targetWidth) { <body>
<?php
+echo soundManager2();
topbar($Links);
?>
<div class="wrapper">
-<div style='font-size: 105%;text-align:center;padding-bottom:7px;' id='displayDate'>
-Loading...
-</div>
+ <div style='font-size: 105%;text-align:center;padding-bottom:7px;' id='displayDate'>
+ Loading...
+ </div>
-<div id="daynav">
-<div class='mapNavCon'>
- <div class='mapNavLeft mapNavBtn' onclick='javascript:getMapIDs("prev");'><</div>
- <div class='mapNavRight mapNavBtn' onclick='javascript:getMapIDs("next");'>></div>
- <div class='mapNavCenter'>
- <div id='mapNavigation'>
- Loading...
+ <div class='mapNavCon'>
+ <div class='mapNavLeft mapNavBtn' onclick='javascript:getMapIDs("prev");'><</div>
+ <div class='mapNavRight mapNavBtn' onclick='javascript:getMapIDs("next");'>></div>
+ <div class='mapNavCenter'>
+ <div id='mapNavigation'></div>
</div>
</div>
+
+ <div style='clear:both'></div>
+ <div>
+ <div id='scoreDisplay' style="float:left;"></div>
+ <div id='mapDisplay' style='display:none; float:left;' class="col2"></div>
+ </div>
+
+
+ <div style='clear:both'></div>
</div>
-<div style='clear:both'></div>
-<?
+<!--
<script src="sounds/script/soundmanager.js"></script>
<script type="text/javascript">soundManagerInit();</script>
-
+-->
<?php
htmlFooter();
?>
\ No newline at end of file |