diff options
Diffstat (limited to 'includes/header.php')
-rw-r--r-- | includes/header.php | 60 |
1 files changed, 39 insertions, 21 deletions
diff --git a/includes/header.php b/includes/header.php index cf427e4..71c2a5c 100644 --- a/includes/header.php +++ b/includes/header.php @@ -41,17 +41,17 @@ function htmlHeader($css = array(), $title = 'Pathery', $desc = '', $scripts = a </script>
<script>
-<? echo userDataToJS(); ?>
function showSignin() {
- if (document.getElementById('oid_hidden') !== undefined) {
+ if (typeof document.getElementById('oid_hidden') !== 'undefined') {
document.getElementById('oid_hidden').id = 'oid_wrapper';
}
}
function hideSignin() {
- if (document.getElementById('oid_wrapper') !== undefined) {
+ if (typeof document.getElementById('oid_wrapper') !== 'undefined') {
document.getElementById('oid_wrapper').id = 'oid_hidden';
}
}
+<? echo userDataToJS(); ?>
</script>
</head>
@@ -145,7 +145,6 @@ function htmlFooter() { ?>
})();
- createSignin();
</script>
</body>
@@ -154,7 +153,25 @@ function htmlFooter() { }
function topbar($links) {
- global $accepted, $wallColor, $wallEmblem, $request;
+ global $accepted, $wallColor, $wallEmblem, $wallOrientation, $request;
+
+
+
+ //Empty first-div contains sound manager stuff
+ echo '<div></div>';
+
+ //echo '<script>createSignin();</script>';
+ echo ' <div class="wrapper" id="oid_hidden" >
+ <h2>Sign in</h2>
+ <div id="oid_box">
+ <h2 style="color:#333;">Do you have an account here?</h2>
+ <a rel="nofollow" href="login?op=google"><img id="oid_btn" src="images/btns/signin_Google.png" alt="Sign in with Google" /></a>
+ <a rel="nofollow" href="login?op=yahoo"><img id="oid_btn" src="images/btns/signin_Yahoo.png" alt="Sign in with Yahoo" /></a>
+ <a id="oid_learn" href="http://openid.net/get-an-openid/what-is-openid/" target="_blank" >Learn more about OpenID</a>
+ <a id="oid_cancel" href="javascript:hideSignin();">X</a>
+ </div>
+ </div>';
+
echo '<div id="topbar"><div id="topbarContent">';
foreach ($links as $key => $value) {
@@ -174,7 +191,7 @@ function topbar($links) { echo " <a href='cp' title='change name'>Update your name</a> | ";
echo " <a href='logout'>Logout</a>";
echo " </div>";
- echo "<div id='topbarBadge' style='background-color: $wallColor; background-image: url(images/marks/$wallEmblem);'>
+ echo "<div id='topbarBadge' style='background-color: $wallColor; background-image: url(".linkEmblem($wallEmblem, $wallOrientation).");'>
<a href='achievements'><div></div></a>
</div>";
@@ -183,16 +200,6 @@ function topbar($links) { } else {
?>
<a href='javascript:showSignin();'>Sign in</a>
-<!-- <div class="wrapper" id="oid_hidden" >
- <h2>Sign in</h2>
- <div id="oid_box">
- <h2 style="color:#333;">Do you have an account here?</h2>
- <a rel="nofollow" href="login?op=google"><img id="oid_btn" src="images/btns/signin_Google.png" alt="Sign in with Google" /></a>
- <a rel="nofollow" href="login?op=yahoo"><img id="oid_btn" src="images/btns/signin_Yahoo.png" alt="Sign in with Yahoo" /></a>
- <a id="oid_learn" href="http://openid.net/get-an-openid/what-is-openid/" target="_blank" >Learn more about OpenID</a>
- <a id="oid_cancel" href="javascript:hideSignin();">X</a>
- </div>
- </div> -->
<?
}
echo " </div>";
@@ -200,14 +207,25 @@ function topbar($links) { }
function userDataToJS() {
- global $wallColor, $wallEmblem, $accepted;
+ global $wallColor, $wallEmblem, $wallOrientation, $accepted;
if (!$accepted) {
- $r = 'var userObj = {"wallColor":false,"wallEmblem":false,';
- $r .= '"ID":"-1","accepted":false};';
+ $r = 'var userObj = {"wallColor":false,"wallEmblem":false,"wallOrientation":false,';
+ $r .= '"ID":"-1","accepted":false,"hasInsaneSpeed":false};';
} else {
$userID = $_SESSION['userID'];
- $r = 'var userObj = {"wallColor":"'.$wallColor.'","wallEmblem":"'.$wallEmblem.'",';
- $r .= '"ID":"'.$userID.'","accepted":true};';
+ include_once('includes/datas.php');
+ $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['wallOrientation'] = $wallOrientation;
+ $json['hasInsaneSpeed'] = $hasInsaneSpeed;
+ $json['accepted'] = 'true';
+
+ $encoded = json_encode($json);
+ $r = 'var userObj = decryptJSON(\''.json_encode($json).'\');'."\n";
}
return $r;
}
|