From fefa99bd448312e13e840f47ef8ce4dfd1645211 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Sun, 27 Jan 2013 03:24:08 -0800 Subject: The start of a new scoreboard or "Scores" page. - I have the feeling some adjustments made here might propigate to the Home page eventually. --- pages/chat.php | 3 +- pages/leaderboard.php | 474 +++++++++++++++++++++++++++++--------------------- 2 files changed, 279 insertions(+), 198 deletions(-) (limited to 'pages') diff --git a/pages/chat.php b/pages/chat.php index 5ecbaab..51444ae 100644 --- a/pages/chat.php +++ b/pages/chat.php @@ -204,11 +204,10 @@ function getChat(message) { dataString += '&send=true&messages='+prepChat(chatBuffer); chatBuffer.length = 0; } - //$.getJSON('ajax_chat.php?getChatFromID='+lastID++message, ); $.ajax({ type: "GET", - url: "ajax_chat.php", + url: "ajax/chat.ajax.php", data: dataString, success: function(data) {getChatDone(data);} }); diff --git a/pages/leaderboard.php b/pages/leaderboard.php index cb9a029..963faa2 100644 --- a/pages/leaderboard.php +++ b/pages/leaderboard.php @@ -1,28 +1,62 @@ + + + + + + + +
+ +
+

+
+ +
+< Previous Day +Next Day > +Current Day >> +
+ +
+name == '') + $map->name = $mapNamesByType[$mapType]; + $r[$mapID] = $map; + + } + return $r; +} + + +function getMapNavigation(&$maps) { + foreach ($maps as $mapID => &$map) { + $r .= "
"; + $r .= $map->name; + $r .= DisplayMapThumbnail($map); + $r .= "
";; + } + return $r; +} + + $time_start = microtime(true); -$tStats = getStat(1, $daysAgo); -$yStats = getStat(2, $daysAgo); -$wStats = getStat(3, $daysAgo); -$mStats = getStat(4, $daysAgo); -$time_end = microtime(true); -$time = $time_end - $time_start; +$special = 'Special'; +if ($specialMapName != '') + $special = $specialMapName; + +?> +
+ +
+
+ +
+ EXAMPLE DATA +
1 2 3 4
RankNameMoves
1
vzl[pi]
41
2
Anderson[pi]
41
3
???t?d?
41
4
DothThouHoist?
41
5
WuTheFWasThat
41
6
Eric (??)
41
7
Lana Del Gabe
41
8
deWax
41
9
Jared[pi]
41
10
Goa [R-TD]
41
+
+ + +
+ + + +
+ + + +
+
+ + + + + + +"; + $headers .= "Rank"; + $headers .= "Name"; + $headers .= "Moves"; + $headers .= "Time taken"; + $headers .= ""; + //Start table + //$r .= ""; + //$r .= ""; + //Headers on the top. including Rank. + //$r .= ""; + //$r .= $headers; + //$r .= ""; + + $i = 1; + $championPoints = null; + while ($row = mysql_fetch_assoc($result)) { + $rowcontent = ''; + $mapid = $row['mapID']; + $solution = $row['solution']; + $wallColor = $row['wallColor']; + $wallEmblem = $row['wallEmblem']; + $displayColor = $row['displayColor']; + $displayName = $row['Name']; + $userID = $row['userID']; + + //Default + if ($wallColor == '') + $wallColor = '#666666'; + + $x = "\n"; + $x .= ""; + $x .= ""; + //$x .= "'; + $x .= ''; + $x .= ''; + $x .= ""; + + if ($userID == $_SESSION['userID']) { + $promotedContent .= $x; + $championPoints = $row['championPointsWorth']; + } else { + $content .= $x; + } -if ($_GET['debug'] == true) echo "XX StatContent getStat Rechieve: $time seconds XX\n"; + $i++; + } + + $r = ''; + if($championPoints != null && $championPoints > 0) + { + $r .= "
Points earned: $championPoints
"; + } + $r .= "
$caption
$i$displayName" . $row['Name'] . '' . $row['Moves'] . '' . $row['Timetaken'] . '
"; + $r .= ""; + $r .= $headers; + $r .= $promotedContent; + $r .= $content; + + $r .= "
$caption
"; + return $r; +} + +function day_diff($date1, $date2) { + $current = $date1; + $datetime2 = date_create($date2); + $count = 0; + while(date_create($current) < $datetime2){ + $current = gmdate("Y-m-d", strtotime("+1 day", strtotime($current))); + $count++; + } + return $count; +} function getStat ($type, $daysAgo = 1) { @@ -126,60 +383,6 @@ function getStat ($type, $daysAgo = 1) { return displayStats($result, $statname); } -?> - -
- -
-12-28-12. I plan on making considerable changes to this page in the near future. -
Thank you for your patience!
-
-
Showing scores for the maps played on -
- -
- 1) { - echo "Current Day"; - echo "Next Day"; -} - echo "Previous Day"; - - - -$time_start = microtime(true); - -$statContent .= displayPastMaze(1, 'Simple', $daysAgo); -$statContent .= displayPastMaze(2, 'Normal', $daysAgo); -$statContent .= displayPastMaze(3, 'Complex', $daysAgo); -$statContent .= displayPastMaze(4, 'Special', $daysAgo); - -$time_end = microtime(true); -$time = $time_end - $time_start; - -if ($_GET['debug'] == true) echo "StatContent Rechieve: $time seconds\n"; - - -$special = 'Special'; -if ($specialMapName != '') - $special = $specialMapName; - -?> -
- - - -"; - $headers .= "Rank"; - $headers .= "Name"; - $headers .= "Moves"; - $headers .= "Time taken"; - $headers .= ""; - //Start table - //$r .= ""; - //$r .= ""; - //Headers on the top. including Rank. - //$r .= ""; - //$r .= $headers; - //$r .= ""; - - $i = 1; - $championPoints = null; - while ($row = mysql_fetch_assoc($result)) { - $rowcontent = ''; - $mapid = $row['mapID']; - $solution = $row['solution']; - $wallColor = $row['wallColor']; - $wallEmblem = $row['wallEmblem']; - $displayColor = $row['displayColor']; - $displayName = $row['Name']; - $userID = $row['userID']; - - //Default - if ($wallColor == '') - $wallColor = '#666666'; - - $x = "\n"; - $x .= ""; - $x .= ""; - //$x .= "'; - $x .= ''; - $x .= ''; - $x .= ""; - - if ($userID == $_SESSION['userID']) { - $promotedContent .= $x; - $championPoints = $row['championPointsWorth']; - } else { - $content .= $x; - } - - $i++; - } - - $r = ''; - if($championPoints != null && $championPoints > 0) - { - $r .= "
Points earned: $championPoints
"; - } - $r .= "
$caption
$i$displayName" . $row['Name'] . '' . $row['Moves'] . '' . $row['Timetaken'] . '
"; - $r .= ""; - $r .= $headers; - $r .= $promotedContent; - $r .= $content; - - $r .= "
$caption
"; - return $r; -} - -function mysql_field_array( $query ) { - $field = mysql_num_fields( $query ); - for ( $i = 0; $i < $field; $i++ ) { - $names[] = mysql_field_name( $query, $i ); - } - return $names; -} - - -?> -
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - - - - - - -- cgit v1.2.3