diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2012-05-15 11:20:40 -0700 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2012-05-15 11:20:40 -0700 |
commit | 7d2ce170b02d3fa0f7006084c92f6ec56dfbf9f1 (patch) | |
tree | a708f686265774740f564400910a09cafb615a2c | |
parent | f7d2bffb4f3600757e28494d0556d5162d9fe024 (diff) | |
download | pathery-7d2ce170b02d3fa0f7006084c92f6ec56dfbf9f1.tar.xz |
Pronoun adjustment, and other minor fixes.
-rw-r--r-- | includes/datas.php | 5 | ||||
-rw-r--r-- | pages/achievements.php | 37 | ||||
-rw-r--r-- | 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 "<div class='wrapper'><h1>Achievements Page</h1>
No selection.
</div>";
@@ -424,6 +431,7 @@ if (isset($unlocks)) { echo "<br><br>";
+//!! Depreciated
//Type 1; wall unlocks:
if (isset($unlocks[1]) AND 1 == 2) {
@@ -481,6 +489,7 @@ if (isset($unlocks[3]) AND 1 == 2) { echo "<br />";
}
+
if (!$viewer) {
echo "
<form action='achievements' method='post' name='updateBadge'>
@@ -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 "<br />Currently you have $nUCurrent $currency";
+ echo "<br />Currently $pronoun $nUCurrent $currency";
echo "
<div title='$percent% to $nRequired' style='align:left;width:210px;height:16px;background-color:#222;border:1px solid #26b;'>
<div style='border-right:1px solid #37e;width:$percent%;height:16px;background-color:#26b;'>
@@ -573,19 +586,6 @@ foreach($achievements as $aType => $a) { echo displayUnlock($unlockType, $unlockValue, $unlockName);
}
-if (false) {
-echo "<h3>Mazes Career: $UTotalSolutions</h3>
-You have played $UTotalSolutions mazes.
-
-Wall embelms unlocked:
-<table><tr>
-<td style='background-color:#fff;' class='grid_td_rocks'>
- <div class='grid_td' style='background:url(../images/TeleportInW.png);'></div>
-</td>
-
-";
-}
-
function displayUnlock($uType, $uValue, $uName) {
switch ($uType) {
@@ -606,11 +606,6 @@ function displayUnlock($uType, $uValue, $uName) { }
-
-
-
-
-
?>
</div>
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));
|