From 7d2ce170b02d3fa0f7006084c92f6ec56dfbf9f1 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 15 May 2012 11:20:40 -0700 Subject: Pronoun adjustment, and other minor fixes. --- includes/datas.php | 5 +++-- pages/achievements.php | 37 ++++++++++++++++--------------------- pages/leaderboard.php | 2 +- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/includes/datas.php b/includes/datas.php index 86fbb54..3ac6984 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -5,7 +5,7 @@ include_once('db.inc.php'); //Select Stats/Scores. -function topScores($mapid, $top = 5) { +function topScores($mapid, $top = 5, $bottom = 0) { $sql = " SELECT timediff(solutions.dateModified, TIMESTAMP(CURDATE())) as diff, @@ -24,7 +24,7 @@ function topScores($mapid, $top = 5) { ON users.ID = userData.userID WHERE solutions.mapID = '$mapid' ORDER BY solutions.moves DESC, solutions.dateModified ASC - LIMIT $top + LIMIT $bottom, $top "; $result = mysql_query($sql); $utime = date("g:i A (T)"); @@ -492,6 +492,7 @@ function getMazeMasteryArray() { $r[6] = array(75, 2, 'CrossXL_B.png', 'Dark Large Present', 0); $r[7] = array(100, 2, 'CircleLargeDonut_W.png', 'Light Annulated Circle', 0); $r[8] = array(150, 2, 'CrossXL_W_I.png', 'Inverted Bright Large Present', 0); + $r[9] = array(225, 2, 'CircleLarge_W_I.png', 'Inverted Bright Large Circle', 0); return $r; } diff --git a/pages/achievements.php b/pages/achievements.php index 881e798..191473e 100644 --- a/pages/achievements.php +++ b/pages/achievements.php @@ -268,9 +268,10 @@ if (isset($_POST['doupdate']) AND !$viewer) { } + $achievements = array(); -//Depreciated !! +//Depreciated $sql = " SELECT type, @@ -280,6 +281,9 @@ FROM `achievements` WHERE userID = '$userID' GROUP BY `type`"; + +//Fetch data + //Thank you ranhothchord@gmail.com $sql = "select maxLevel.type, maxLevel.level, achievements.dateCompleted from achievements @@ -299,6 +303,9 @@ if ($result) { $achievements[$row['type']] = $row; } + +//Get user information to display. + $sql = " SELECT users.displayName, @@ -317,8 +324,8 @@ WHERE users.ID = '$userID' GROUP BY solutions.userID "; $result = mysql_query($sql); +//No user found? if (!$result OR mysql_num_rows($result) <= 0) { - echo "

Achievements Page

No selection.
"; @@ -424,6 +431,7 @@ if (isset($unlocks)) { echo "

"; +//!! Depreciated //Type 1; wall unlocks: if (isset($unlocks[1]) AND 1 == 2) { @@ -481,6 +489,7 @@ if (isset($unlocks[3]) AND 1 == 2) { echo "
"; } + if (!$viewer) { echo "
@@ -560,9 +569,13 @@ foreach($achievements as $aType => $a) { $percent = round($uCurrent / $required * 100, 1); //$percentLeft = 100 - $percent; + + $pronoun = "you have"; + if ($viewer) + $pronoun = "$UDisplay has"; echo "Last level earned $aCompleted"; - echo "
Currently you have $nUCurrent $currency"; + echo "
Currently $pronoun $nUCurrent $currency"; echo "
@@ -573,19 +586,6 @@ foreach($achievements as $aType => $a) { echo displayUnlock($unlockType, $unlockValue, $unlockName); } -if (false) { -echo "

Mazes Career: $UTotalSolutions

-You have played $UTotalSolutions mazes. - -Wall embelms unlocked: - - - -"; -} - function displayUnlock($uType, $uValue, $uName) { switch ($uType) { @@ -606,11 +606,6 @@ function displayUnlock($uType, $uValue, $uName) { } - - - - - ?> diff --git a/pages/leaderboard.php b/pages/leaderboard.php index 8f8d782..60a1f07 100644 --- a/pages/leaderboard.php +++ b/pages/leaderboard.php @@ -39,7 +39,7 @@ $daysago = date_diff($dateLookup, date('Y-m-d')); $dateAgo = strtotime("-$daysago days"); -$dateAsStr = date('l F dS 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)); -- cgit v1.2.3
-
-