diff options
author | raylu <raylu@mixpanel.com> | 2012-07-18 01:45:55 -0700 |
---|---|---|
committer | raylu <raylu@mixpanel.com> | 2012-07-18 01:45:55 -0700 |
commit | 79d928cd42c32122edd47d1a450fb0c4ced3de2f (patch) | |
tree | 9989a6fc699476a01b7721a13a330f9e214fe0de /includes/header.php | |
parent | 9f7a77eb549d1cfe93b406a0c29862db8664de76 (diff) | |
download | pathery-79d928cd42c32122edd47d1a450fb0c4ced3de2f.tar.xz |
fix lots of warnings, whitespace
Diffstat (limited to 'includes/header.php')
-rw-r--r-- | includes/header.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/includes/header.php b/includes/header.php index d718588..887aa41 100644 --- a/includes/header.php +++ b/includes/header.php @@ -1,6 +1,7 @@ <?php
-
+$accepted = isset($_SESSION['accepted']) && $_SESSION['accepted'] == 1;
function htmlHeader($css = array(), $title = 'Pathery', $desc = '') {
+ global $accepted;
?>
<!DOCTYPE html>
<html xml:lang="en" lang="en">
@@ -25,7 +26,7 @@ function htmlHeader($css = array(), $title = 'Pathery', $desc = '') { for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c})(document,[]);
mixpanel.init("24743c6567f831ddfcbbbd3f397e11e4");
<?php
- if ($_SESSION['accepted'] == 1) {
+ if ($accepted) {
if ($_SESSION['displayName'] != 'noname')
echo 'mixpanel.name_tag(' . json_encode($_SESSION['displayName']) . ');';
if ($_SERVER['HTTP_HOST'] == 'www.pathery.com')
@@ -89,11 +90,10 @@ function htmlFooter() { }
function topbar($links) {
+ global $accepted;
echo '<div id="topbar">';
- $page = $_GET['page'];
- if ($page == '')
- $page = 'home';
+ $page = isset($_GET['page']) ? $_GET['page'] : 'home';
foreach ($links as $key => $value) {
if ($page == $key)
$selected = " selected";
@@ -103,7 +103,7 @@ function topbar($links) { }
echo "<div id='user'>";
- if ($_SESSION['accepted'] == 1) {
+ if ($accepted) {
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> | ";
|