diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2012-11-26 22:00:22 -0800 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2012-11-26 22:00:22 -0800 |
commit | 4b470911a5086ab9d2b648a134e447524b2f4747 (patch) | |
tree | 9eb16b552ed5ffd83df3cc6cea721b02ff861af2 /includes/header.php | |
parent | 4158e556d247830832b631fd4ef869e7c8e541e5 (diff) | |
download | pathery-4b470911a5086ab9d2b648a134e447524b2f4747.tar.xz |
Added badge near username.
Diffstat (limited to 'includes/header.php')
-rw-r--r-- | includes/header.php | 63 |
1 files changed, 44 insertions, 19 deletions
diff --git a/includes/header.php b/includes/header.php index f74a942..7c086fb 100644 --- a/includes/header.php +++ b/includes/header.php @@ -1,5 +1,20 @@ <?php
$accepted = isset($_SESSION['accepted']) && $_SESSION['accepted'] == 1;
+
+if ($accepted) {
+ $userID = $_SESSION['userID'];
+ include_once ('./includes/db.inc.php');
+ $sql = "
+ SELECT
+ userData.wallColor,
+ userData.wallEmblem
+ FROM `userData`
+ WHERE userID = '$userID' ";
+ $result = mysql_query($sql);
+ if ($result)
+ list($wallColor, $wallEmblem) = mysql_fetch_row($result);
+}
+
function htmlHeader($css = array(), $title = 'Pathery', $desc = '', $scripts = array()) {
global $accepted;
?>
@@ -116,7 +131,7 @@ function htmlFooter() { }
function topbar($links) {
- global $accepted;
+ global $accepted, $wallColor, $wallEmblem;
echo '<div id="topbar">';
$page = isset($_GET['page']) ? $_GET['page'] : 'home';
@@ -130,28 +145,38 @@ function topbar($links) { echo "<div id='user'>";
if ($accepted) {
- echo "Logged in as <a href='cp' title='change name'>$_SESSION[displayName]</a><br>";
+ echo " <div style='float:left;'>";
+ echo " Logged in as <a href='cp' title='change name'>$_SESSION[displayName]</a><br>";
if ($_SESSION['displayName'] == 'noname')
- echo "<a href='cp' title='change name'>Update your name</a> | ";
- echo "<a href='logout'>Logout</a>";
+ echo " <a href='cp' title='change name'>Update your name</a> | ";
+ echo " <a href='logout'>Logout</a>";
+ echo " </div>";
+ echo "
+ <div class='grid_td' style='float:left; margin:5px 1px 1px 9px; width:35px; height:35px; background:$wallColor url(images/marks/$wallEmblem);'>
+ <a href='achievements'>
+ <div style='background-color:transparent;' class='grid_td_inner grid_td_rocks'>
+ </div>
+ </a>
+ </div>";
+
+
} 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 href="login?op=google"><img id="oid_btn" src="images/btns/signin_Google.png" alt="Sign in with Google" /></a>
- <a 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>
- <?
+ <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 href="login?op=google"><img id="oid_btn" src="images/btns/signin_Google.png" alt="Sign in with Google" /></a>
+ <a 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>";
-
- echo "</div>";
+ echo " </div>";
+ echo "</div>"; //div id='user'
}
?>
|