summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-03-14 02:00:08 -0700
committerPatrick Davison <snapwilliam@gmail.com>2013-03-14 02:00:08 -0700
commitf797f84a2f708912ac039340a217e18066f9eba3 (patch)
tree354080a94208c97acc8e3958154ca60291850912
parentfdbc1c157ef331d37b177f61de01fa298628bf02 (diff)
downloadpathery-f797f84a2f708912ac039340a217e18066f9eba3.tar.xz
More achievement cleanups
-rw-r--r--includes/datas.php29
-rw-r--r--pages/achievements.php3
2 files changed, 14 insertions, 18 deletions
diff --git a/includes/datas.php b/includes/datas.php
index d79e3ae..f599533 100644
--- a/includes/datas.php
+++ b/includes/datas.php
@@ -12,7 +12,6 @@ include_once('constants.php');
//Returns text refering to any notifications.
function getNotified($userID) {
-
$r = '';
$sql = "SELECT `ID`, `type`, `level`
@@ -22,25 +21,25 @@ function getNotified($userID) {
LIMIT 5";
$resultA = mysql_query($sql);
- if (mysql_num_rows($resultA) <= 0)
- return false;
+ if (mysql_num_rows($resultA) <= 0) return false;
// --------- We found an achievement they don't know they got!
while (list($aID, $aType, $aLevel) = mysql_fetch_row($resultA)) {
- if ($r != '')
- $r .= '<br /><hr />';
+ if ($r != '') $r .= '<br /><hr />';
- $aTypeNames[1] = "Path Career Level $aLevel!";
- $aTypeNames[2] = "Mazes Career Level $aLevel!";
- $aTypeNames[3] = "Maze Mastery Level $aLevel!";
- $aTypeNames[4] = "Champion Level $aLevel!";
- $aTypeNames[32] = 'Tutorial Complete!';
+ $aTypeNames[ACHIEVEMENT_MOVES_CAREER] = "Path Career Level $aLevel!";
+ $aTypeNames[ACHIEVEMENT_MAZE_CAREER] = "Mazes Career Level $aLevel!";
+ $aTypeNames[ACHIEVEMENT_MAZE_MASTERY] = "Maze Mastery Level $aLevel!";
+ $aTypeNames[ACHIEVEMENT_CHAMPION_POINTS] = "Champion Level $aLevel!";
+ $aTypeNames[ACHIEVEMENT_PERFECT_DAY] = 'Perfect Day Level!';
+ $aTypeNames[ACHIEVEMENT_TUTORIAL] = 'Tutorial Complete!';
- $aTypeCurrency[1] = "total moves mazed";
- $aTypeCurrency[2] = "mazes played";
- $aTypeCurrency[3] = "mazes with (tied) top score";
- $aTypeCurrency[4] = "champion points";
+ $aTypeCurrency[ACHIEVEMENT_MOVES_CAREER] = "total moves mazed";
+ $aTypeCurrency[ACHIEVEMENT_MAZE_CAREER] = "mazes played";
+ $aTypeCurrency[ACHIEVEMENT_MAZE_MASTERY] = "mazes with (tied) top score";
+ $aTypeCurrency[ACHIEVEMENT_CHAMPION_POINTS] = "champion points";
+ $aTypeCurrency[ACHIEVEMENT_PERFECT_DAY] = "total times you've tied all 4 maps";
$aName = $aTypeNames[$aType];
$currency = $aTypeCurrency[$aType];
@@ -79,8 +78,6 @@ function getNotified($userID) {
}
-
-
// Item ID List
$aIDList[] = "'$aID'";
}
diff --git a/pages/achievements.php b/pages/achievements.php
index a5e56ed..383de70 100644
--- a/pages/achievements.php
+++ b/pages/achievements.php
@@ -491,8 +491,7 @@ foreach($achievements as $aType => $a) {
$aCompleted = $a['dateCompleted'];
$aCompleted = relative_date(strtotime($aCompleted));
- if (!isset($uStats[$aType]))
- $uStats[$aType] = getAchievementCurrency($userID, $aType);
+ if (!isset($uStats[$aType])) $uStats[$aType] = getAchievementCurrency($userID, $aType);
$uStats[$aType] = str_replace(",", "", $uStats[$aType]);