diff options
Diffstat (limited to 'includes/datas.php')
-rw-r--r-- | includes/datas.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/includes/datas.php b/includes/datas.php index c341ddf..1db0060 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -646,7 +646,9 @@ function getMazeMasteryArray() { //TYPE 4 function getChampionPointsArray() { //$cp[0] = array(requiredpoints, type, 'value', 'name'); - $r[1] = array(100, 2, 'DiagonalCover_B.png', 'Light Diagnol Cover', 0); + //TODO: Crap.... typo... Need to fix this in SQL too. + //$r[1] = array(100, 2, 'DiagonalCover_B.png', 'Light Diagnol Cover', 0); + $r[1] = array(100, 2, 'DiagonalCover_B.png', 'Light Diagonal Cover', 0); $r[2] = array(250, 1, '#22aaaa', 'Teal'); $r[3] = array(500, 2, 'OffsetStripesDiagonal_B.png', 'Dark Diagonal Stripes', 0); $r[4] = array(1000, 2, 'DiamondLargeDonut_W_I.png', 'Inverted Light Annulated Diamond', 0); @@ -807,7 +809,7 @@ function getScores($mapID, $pageNumber = 1, $pageDivide = 10) { timediff(solutions.dateModified, TIMESTAMP(CURDATE())) as diff, users.displayName as display, solutions.moves as moves, - solutions.challengePointsWorth as points, + solutions.championPointsWorth as points, users.ID as ID, users.displayColor, users.wallColor, @@ -825,7 +827,7 @@ function getScores($mapID, $pageNumber = 1, $pageDivide = 10) { $result = mysql_query($sql); //$utime = date("g:i A (T)"); - $output['updateTime'] = date("g:i A (T)"); + $output['updateTime'] = time(); $i = 0; $foundUser = false; @@ -853,7 +855,7 @@ function getScores($mapID, $pageNumber = 1, $pageDivide = 10) { } $scoredDate = strtotime($row['cdate']); - $secondsSinceScored = strtotime("now") - $scoredDate ; + $secondsSinceScored = strtotime("now") - $scoredDate; //Alternate background colors $background = '#262631'; @@ -980,4 +982,20 @@ function loadChallengeMapCode($mapIdUnsanitized) } return NULL; } + + +function isCurrentMap($mapID) { + include_once('./includes/sqlEmbedded.php'); + $sql = "SELECT mapID + FROM `mapOfTheDay` + WHERE `mapID` = '$mapID' + AND mapExpireTime > NOW() + LIMIT 1 + "; + + $result = mysql_query($sql) or die(mysql_error()); + return (mysql_num_rows($result) != 0); +} + + ?> |