diff options
-rw-r--r-- | ajax/scores.ajax.php | 21 | ||||
-rw-r--r-- | css/stats.css | 24 | ||||
-rw-r--r-- | includes/constants.php | 1 | ||||
-rw-r--r-- | pages/chat.php | 3 | ||||
-rw-r--r-- | pages/leaderboard.php | 474 |
5 files changed, 325 insertions, 198 deletions
diff --git a/ajax/scores.ajax.php b/ajax/scores.ajax.php new file mode 100644 index 0000000..2b27ca2 --- /dev/null +++ b/ajax/scores.ajax.php @@ -0,0 +1,21 @@ +<?
+session_start();
+session_write_close();
+//Just doing this as evidence that $_SESSION as read-only is still available.
+$userID = $_SESSION['userID'];
+
+require('../includes/maps.php');
+require('../includes/mapclass.php');
+require('../includes/datas.php');
+
+
+
+$mapID = $_GET['mapID'];
+
+$code = getMapCode($mapID);
+$map = GenerateMapByCode($code);
+echo displaymap($map, $mapID);
+
+
+
+?>
\ No newline at end of file diff --git a/css/stats.css b/css/stats.css index 8ea79da..6ddc38f 100644 --- a/css/stats.css +++ b/css/stats.css @@ -30,6 +30,30 @@ height: 0; } +#mapNavigation { + padding:15px; + background-color:#888; + border-radius:10px; + min-height:130px; + text-align:left; + overflow-x:hidden; + overflow-y:hidden; + width:1100px; +} +.mapThumbnail { + float:left; + padding: 10px; + background-color:#334; + margin: 7px; + border-radius:10px; + cursor:pointer; + padding-top: 4px; +} +.mapThumbnail:hover { + background-color:#445; +} + + table { border-collapse: collapse; diff --git a/includes/constants.php b/includes/constants.php index 7774aa4..a6826b1 100644 --- a/includes/constants.php +++ b/includes/constants.php @@ -68,6 +68,7 @@ class MapType const Special = 4; const Weekly = 5; } +$mapNamesByType = array(1 => 'Simple', 2 => 'Normal', 3 => 'Complex', 4 => 'Special', 5 => 'Weekly'); /** * Required number of challenges beaten to move up to each tier. 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 @@ <?php
-htmlHeader(array('stats'), 'Pathery Scores', 'Score history for Pathery');
+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);
-include('./includes/maps.php');
+include_once('./includes/maps.php');
//include('./includes/mapoftheday.php');
-include('./includes/datas.php');
+include_once('./includes/datas.php');
+include_once('./includes/mapclass.php');
+include_once('./includes/constants.php');
include_once ('./includes/sqlEmbedded.php');
-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;
-}
+$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"));
@@ -38,7 +72,7 @@ if (isset($_GET['date'])) { $daysAgo = day_diff($dateLookup, date('Y-m-d'));
$dateAgo = strtotime("-$daysAgo days");
-$dateAsStr = date('l F jS Y', $dateAgo);
+$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));
@@ -48,18 +82,241 @@ if ($daysAgo < 1) die("You must specify a date previous to today.");
+$todaysScoreMaps = getMapsPlayed($daysAgo);
+
+?>
+
+<div class="wrapper" style='width:1100px;'>
+
+<div id='#displayDate' style='text-align:center;padding-bottom:7px;'>
+<h2 title='Maps that were played during this day'><? echo $dateAsStr; ?></h2>
+</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>
+<div id='mapNavigation'>
+<? echo getMapNavigation($todaysScoreMaps); ?>
+</div>
+<?
+
+
+function getMapsPlayed($daysAgo) {
+ $sql = "
+ SELECT `mapID`, `code`, `mapType`
+ FROM `mapOfTheDay`
+ INNER JOIN `maps` ON `mapID` = maps.ID
+ WHERE DATE_ADD(CURDATE(), INTERVAL -$daysAgo DAY) =
+ mapDate AND
+ `mapType` IN (1, 2, 3, 4)
+ ";
+ $result = mysql_query($sql) or die(mysql_error());
+ if (mysql_num_rows($result) == 0)
+ return -1;
+ global $mapNamesByType;
+ $r = array();
+ while($data = mysql_fetch_array($result)) {
+ $code = $data['code'];
+ $mapID = $data['mapID'];
+ $mapType = $data['mapType'];
+ $map = new map($code);
+ if ($map->name == '')
+ $map->name = $mapNamesByType[$mapType];
+ $r[$mapID] = $map;
+
+ }
+ return $r;
+}
+
+
+function getMapNavigation(&$maps) {
+ foreach ($maps as $mapID => &$map) {
+ $r .= "<div class='mapThumbnail' onclick='displayMap($mapID)'>";
+ $r .= $map->name;
+ $r .= DisplayMapThumbnail($map);
+ $r .= "</div>";;
+ }
+ 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;
+
+?>
+</div>
+
+ <div style="clear: both"></div>
+ <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">
+
+ </div>
+ </div>
+
+<?
+
+
+//echo $statContent;
+
+
+
+
+?>
+
+<div style="clear: both"></div>
+
+<!--
+<div id="yms-5">
+ <div class="col1">
+ <? echo $tStats;?>
+ </div>
+ <div class="col2">
+ <? echo $yStats;?>
+ </div>
+</div>
+
+<div id="yms-6">
+ <div class="col1">
+ <? echo $wStats;?>
+ </div>
+ <div class="col2">
+ <? echo $mStats;?>
+ </div>
+</div>
+-->
+
+<br class="clear">
+</div>
+
+<script>
+
+
+
+function showStats(type) {
+ //super usefulll
+ //var anchor = window.location.hash.substring(1);
+
+ for (var i = 1; i <= 4; i++) {
+ var elem = document.getElementById("yms-" + i);
+ if (elem.className.indexOf('hidden-stats') < 0)
+ elem.className += 'hidden-stats';
+ elem = document.getElementById("dl-" + i);
+ elem.className = elem.className.replace('selected', '');
+ }
+ elem = document.getElementById("yms-" + type);
+ elem.className = elem.className.replace('hidden-stats', '');
+ elem = document.getElementById("dl-" + type);
+ if (elem.className.indexOf('selected') < 0)
+ elem.className += 'selected';
+}
+showStats(1);
+</script>
+
+<script src="sounds/script/soundmanager.js"></script>
+<script type="text/javascript">soundManagerInit();</script>
+
+<?php
+
+
+
+
+htmlFooter();
+
+//TODO !! DELETE FUNCTIONS WHEN DONE!!
+function mysql_field_array( $query ) {
+ $field = mysql_num_fields( $query );
+ for ( $i = 0; $i < $field; $i++ ) {
+ $names[] = mysql_field_name( $query, $i );
+ }
+ return $names;
+}
+function displaystats($result, $caption = NULL) {
+ //Get names.
+ $headers = "<tr class='leaderboardHeaders'>";
+ $headers .= "<th class='leaderboardHeadersRank'>Rank</th>";
+ $headers .= "<th class='leaderboardHeadersName'>Name</th>";
+ $headers .= "<th class='leaderboardHeadersMoves'>Moves</th>";
+ $headers .= "<th class='leaderboardHeadersTime'>Time taken</th>";
+ $headers .= "</th>";
+ //Start table
+ //$r .= "<table style='border:1px solid #FFF'>";
+ //$r .= "<caption>$caption</caption>";
+ //Headers on the top. including Rank.
+ //$r .= "<tr>";
+ //$r .= $headers;
+ //$r .= "</tr>";
+
+ $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 = "<tr class='lbrow' onmouseover='changeWallEmblem(\"$wallEmblem\"); changeWallColor(\"$wallColor\"); loadSol(\"$mapid:$solution\");'>\n";
+ $x .= "<td>$i</td>";
+ $x .= "<td class='leaderboardName'><span title='UserID: $userID'><a href='achievements?id=$userID' style='color:$displayColor'>$displayName</a></span></td>";
+ //$x .= "<td style='color:$displayColor';>" . $row['Name'] . '</td>';
+ $x .= '<td><a href="javascript:void(0)">' . $row['Moves'] . '</a></td>';
+ $x .= '<td>' . $row['Timetaken'] . '</td>';
+ $x .= "</tr>";
+
+ 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 .= "<div class='myPoints'>Points earned: <span class='myPointsValue'>$championPoints</span> <img src='../images/championpoints.png' width='16px' height='16px'></img></div>";
+ }
+ $r .= "<table style='border:1px solid #FFF'>";
+ $r .= "<caption>$caption</caption>";
+ $r .= $headers;
+ $r .= $promotedContent;
+ $r .= $content;
+
+ $r .= "</table>";
+ 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);
}
-?>
-
-<div class="wrapper">
-
-<div style='text-align:center;padding-bottom:7px;'>
-<strong>12-28-12. I plan on making considerable changes to this page in the near future.
-<br />Thank you for your patience!</strong>
-<br />
-<br />Showing scores for the maps played on <? echo $dateAsStr; ?>
-</div>
-
-<div id="daynav">
-<?
-if ($daysAgo > 1) {
- echo "<a href='leaderboard?date=$dateDisplay' title='Now'>Current Day</a>";
- echo "<a href='leaderboard?date=$dateNextDay' title='Newer'>Next Day</a>";
-}
- echo "<a href='leaderboard?date=$datePrevDay' title='Older'>Previous Day</a>";
-
-
-
-$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;
-
-?>
-</div>
-
-<div id="difficulties">
- <a href="javascript:showStats(1)" id="dl-1">Simple</a>
- <a href="javascript:showStats(2)" id="dl-2">Normal</a>
- <a href="javascript:showStats(3)" id="dl-3">Complex</a>
- <a href="javascript:showStats(4)" id="dl-4"><? echo $special; ?></a>
- <a href="javascript:showStats(5)" id="dl-5">Overall</a>
- <a href="javascript:showStats(6)" id="dl-6">Week/Month</a>
-</div>
-
-<?
-
-echo $statContent;
-
function displayPastMaze($mapType, $name, $daysAgo = 1) {
//Ensure no cheating
if ($daysAgo < 1)
@@ -252,126 +455,5 @@ function displayPastMaze($mapType, $name, $daysAgo = 1) { return $r;
}
-function displaystats($result, $caption = NULL) {
- //Get names.
- $headers = "<tr class='leaderboardHeaders'>";
- $headers .= "<th class='leaderboardHeadersRank'>Rank</th>";
- $headers .= "<th class='leaderboardHeadersName'>Name</th>";
- $headers .= "<th class='leaderboardHeadersMoves'>Moves</th>";
- $headers .= "<th class='leaderboardHeadersTime'>Time taken</th>";
- $headers .= "</th>";
- //Start table
- //$r .= "<table style='border:1px solid #FFF'>";
- //$r .= "<caption>$caption</caption>";
- //Headers on the top. including Rank.
- //$r .= "<tr>";
- //$r .= $headers;
- //$r .= "</tr>";
-
- $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 = "<tr class='lbrow' onmouseover='changeWallEmblem(\"$wallEmblem\"); changeWallColor(\"$wallColor\"); loadSol(\"$mapid:$solution\");'>\n";
- $x .= "<td>$i</td>";
- $x .= "<td class='leaderboardName'><span title='UserID: $userID'><a href='achievements?id=$userID' style='color:$displayColor'>$displayName</a></span></td>";
- //$x .= "<td style='color:$displayColor';>" . $row['Name'] . '</td>';
- $x .= '<td><a href="javascript:void(0)">' . $row['Moves'] . '</a></td>';
- $x .= '<td>' . $row['Timetaken'] . '</td>';
- $x .= "</tr>";
-
- if ($userID == $_SESSION['userID']) {
- $promotedContent .= $x;
- $championPoints = $row['championPointsWorth'];
- } else {
- $content .= $x;
- }
-
- $i++;
- }
-
- $r = '';
- if($championPoints != null && $championPoints > 0)
- {
- $r .= "<div class='myPoints'>Points earned: <span class='myPointsValue'>$championPoints</span> <img src='../images/championpoints.png' width='16px' height='16px'></img></div>";
- }
- $r .= "<table style='border:1px solid #FFF'>";
- $r .= "<caption>$caption</caption>";
- $r .= $headers;
- $r .= $promotedContent;
- $r .= $content;
-
- $r .= "</table>";
- 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;
-}
-
-
-?>
-<div style="clear: both"></div>
-
-<div id="yms-5">
- <div class="col1">
- <? echo $tStats;?>
- </div>
- <div class="col2">
- <? echo $yStats;?>
- </div>
-</div>
-
-<div id="yms-6">
- <div class="col1">
- <? echo $wStats;?>
- </div>
- <div class="col2">
- <? echo $mStats;?>
- </div>
-</div>
-
-<br class="clear">
-</div>
-
-<script>
-function showStats(type) {
- for (var i = 1; i <= 6; i++) {
- var elem = document.getElementById("yms-" + i);
- if (elem.className.indexOf('hidden-stats') < 0)
- elem.className += 'hidden-stats';
- elem = document.getElementById("dl-" + i);
- elem.className = elem.className.replace('selected', '');
- }
- elem = document.getElementById("yms-" + type);
- elem.className = elem.className.replace('hidden-stats', '');
- elem = document.getElementById("dl-" + type);
- if (elem.className.indexOf('selected') < 0)
- elem.className += 'selected';
-}
-showStats(1);
-</script>
-
-<script src="sounds/script/soundmanager.js"></script>
-<script type="text/javascript">soundManagerInit();</script>
-
-<?php
-htmlFooter();
?>
|