summaryrefslogtreecommitdiffstats
path: root/includes/header.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-03-13 02:57:50 -0700
committerPatrick Davison <snapwilliam@gmail.com>2013-03-13 02:57:50 -0700
commitd26206b8dfb2f6c9775c0a7f111e0d4caed53fe7 (patch)
tree03562ad8bd3a4b9efc89ecb49ccdd557f68ec57b /includes/header.php
parent32cce4bee8a242f7a2e6d6a9e1c9e77b4af87728 (diff)
downloadpathery-d26206b8dfb2f6c9775c0a7f111e0d4caed53fe7.tar.xz
Insane speed achievement front end.
Diffstat (limited to 'includes/header.php')
-rw-r--r--includes/header.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/includes/header.php b/includes/header.php
index cf427e4..5f0f679 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -203,11 +203,20 @@ function userDataToJS() {
global $wallColor, $wallEmblem, $accepted;
if (!$accepted) {
$r = 'var userObj = {"wallColor":false,"wallEmblem":false,';
- $r .= '"ID":"-1","accepted":false};';
+ $r .= '"ID":"-1","accepted":false,"hasInsaneSpeed":false};';
} else {
$userID = $_SESSION['userID'];
- $r = 'var userObj = {"wallColor":"'.$wallColor.'","wallEmblem":"'.$wallEmblem.'",';
- $r .= '"ID":"'.$userID.'","accepted":true};';
+ $hasInsaneSpeed = hasExtrasUnlock($userID, UNLOCK_EXTRAS, MISC_UNLOCK_INSANE_SPEED);
+ $r .= 'hasInsaneSpeed":'.$hasInsaneSpeed.'};'."\n";
+ $json = array('ID' => 'fat');
+ $json['ID'] = $userID;
+ $json['wallColor'] = $wallColor;
+ $json['wallEmblem'] = $wallEmblem;
+ $json['hasInsaneSpeed'] = $hasInsaneSpeed;
+ $json['accepted'] = 'true';
+
+ $encoded = json_encode($json);
+ $r = 'var userObj = decryptJSON(\''.json_encode($json).'\');'."\n";
}
return $r;
}