diff options
Diffstat (limited to 'pages/leaderboard.php')
-rw-r--r-- | pages/leaderboard.php | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/pages/leaderboard.php b/pages/leaderboard.php index fafcb23..8f8d782 100644 --- a/pages/leaderboard.php +++ b/pages/leaderboard.php @@ -134,19 +134,32 @@ if ($daysago > 1) { echo "<a href='leaderboard?date=$dateNextDay' title='Newer'>Next Day</a>";
}
echo "<a href='leaderboard?date=$datePrevDay' title='Older'>Previous Day</a>";
+
+$statContent .= displayPastMaze(1, 'Simple', $daysago);
+$statContent .= displayPastMaze(2, 'Normal', $daysago);
+$statContent .= displayPastMaze(3, 'Complex', $daysago);
+$statContent .= displayPastMaze(4, 'Special', $daysago);
+
+$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">Special</a>
-<a href="javascript:showStats(5)" id="dl-5">Overall</a>
-<a href="javascript:showStats(6)" id="dl-6">Week/Month</a>
+ <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)
@@ -187,11 +200,14 @@ function displayPastMaze($mapType, $name, $daysago = 1) { }
$stats = displayStats($result, $statname);
-
$pastMap = pastMap($mapType, $daysago);
$mapID = $pastMap;
$mapcode = getMapCode($mapID);
$map = GenerateMapByCode($mapcode);
+
+ //Sucky temporary solution:
+ $GLOBALS['specialMapName'] = $map[0][6];
+
$sql = "SELECT `moves`, `displayName`, `solution`
FROM `solutions`, `users`
WHERE `mapID` = '$mapID' AND
@@ -205,17 +221,20 @@ function displayPastMaze($mapType, $name, $daysago = 1) { //$map = MergeMapSolution($map, $solution);
//echo DisplayMap($map, $mapID);
}
- echo '<div style="clear: both"></div>';
- echo "<div id=\"yms-$mapType\">";
- echo '<div class="col1">';
- echo $stats;
- echo '</div>';
-
- echo '<div class="col2">';
- echo "Best solution for this map: <b>$bestMoves by $byName </b>";
- echo DisplayMap($map, $mapID, 'example', 2);
- echo '</div>';
- echo '</div>';
+ $r = '';
+
+ $r .= '<div style="clear: both"></div>';
+ $r .= "<div id=\"yms-$mapType\">";
+ $r .= '<div class="col1">';
+ $r .= $stats;
+ $r .= '</div>';
+
+ $r .= '<div class="col2">';
+ $r .= "Best solution for this map: <b>$bestMoves by $byName </b>";
+ $r .= DisplayMap($map, $mapID, 'example', 2);
+ $r .= '</div>';
+ $r .= '</div>';
+ return $r;
}
function displaystats($result, $caption = NULL) {
@@ -268,18 +287,6 @@ function mysql_field_array( $query ) { return $names;
}
-// $sql = 'select columnname etc'
-// $result = mysql_query($sql);
-// while ($data[] = mysql_fetch_row($result));
-
-// $data[1]['columnname'] == 'my data';
-
-
-
-displayPastMaze(1, 'Simple', $daysago);
-displayPastMaze(2, 'Normal', $daysago);
-displayPastMaze(3, 'Complex', $daysago);
-displayPastMaze(4, 'Special', $daysago);
?>
|