diff options
-rw-r--r-- | includes/datas.php | 1 | ||||
-rw-r--r-- | js/scores.js | 11 |
2 files changed, 7 insertions, 5 deletions
diff --git a/includes/datas.php b/includes/datas.php index e321a9f..74487fd 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -889,6 +889,7 @@ function getScores($mapID, $pageNumber = 1, $pageDivide = 10) { } $output['pageCount'] = ceil(($i / $pageDivide)); + $output['isCurrentMap'] = $currentMap; return $output; } diff --git a/js/scores.js b/js/scores.js index 34d3c87..0e81213 100644 --- a/js/scores.js +++ b/js/scores.js @@ -110,21 +110,22 @@ function scoresPreparePage (mapid, page) { var scoresShowNavSideBtns = false;
function scoresFormatPage(JO) {
+ var solutionsGiven = !JO.isCurrentMap;
+
var p = "<table class='score'>";
//console.log("jo object", JO);
var navi = '';
+ var naviColSpan = 3;
+ if (solutionsGiven) naviColSpan++;
if (JO.pageCount > 1) {
- navi = "<tr><th class='unselectable' colspan='4' style='text-align:center;'>"+formatPageNavi(JO, "scoresShowPage", JO.mapid)+"</th></tr>";
+ navi = "<tr><th class='unselectable' colspan='"+naviColSpan+"' style='text-align:center;'>"+formatPageNavi(JO, "scoresShowPage", JO.mapid)+"</th></tr>";
p = p+navi;
}
var localTime = new Date();
var updatedLocalTime = new Date();
updatedLocalTime.setTime(JO.updateTime * 1000);
-
- //Hack to determine if solutions are given
- var solutionsGiven = (JO.users && JO.users[1] && JO.users[1].solution);
-
+
p = p+"<tr title='Last-Update: "+updatedLocalTime.format("mmm d, h:MM TT")+"'>";
p = p+"<th>Rank</th>";
p = p+"<th style='width:125px; overflow:hidden; text-align:left; padding-left:42px;'>Name</th>";
|