summaryrefslogtreecommitdiffstats
path: root/pages/home.php
diff options
context:
space:
mode:
authorraylu <raylu@mixpanel.com>2012-07-18 01:45:55 -0700
committerraylu <raylu@mixpanel.com>2012-07-18 01:45:55 -0700
commit79d928cd42c32122edd47d1a450fb0c4ced3de2f (patch)
tree9989a6fc699476a01b7721a13a330f9e214fe0de /pages/home.php
parent9f7a77eb549d1cfe93b406a0c29862db8664de76 (diff)
downloadpathery-79d928cd42c32122edd47d1a450fb0c4ced3de2f.tar.xz
fix lots of warnings, whitespace
Diffstat (limited to 'pages/home.php')
-rw-r--r--pages/home.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/pages/home.php b/pages/home.php
index e9b65be..b1335a4 100644
--- a/pages/home.php
+++ b/pages/home.php
@@ -9,7 +9,8 @@ include_once ('./includes/datas.php');
//Get custom wall colors;
$wallColor = '';
$wallEmblem = '';
-if ($_SESSION[accepted] == 1) {
+$noteScript = '';
+if ($accepted) {
$userID = $_SESSION['userID'];
$sql = "
@@ -87,8 +88,8 @@ switch ($numday) {
<body>
<script type="text/javascript">
-playerWallColor = '<?PHP echo $wallColor; ?>';
-playerWallEmblem = '<?PHP echo $wallEmblem; ?>';
+playerWallColor = '<?PHP echo isset($wallColor) ? $wallColor : ''; ?>';
+playerWallEmblem = '<?PHP echo isset($wallEmblem) ? $wallEmblem : ''; ?>';
</script>
<?php
@@ -101,7 +102,7 @@ topbar($Links);
<?
-if ($_SESSION['accepted'] == 1) {
+if ($accepted) {
if (tutorialComplete($userID) == false) {
echo "<center><a href='tutorial'>Complete the tutorial</a> to unlock a blue wall color:";
echo "<table><tr><td style='background-color:#4444ff;' class='grid_td_rocks'></td></tr></table></center><br />";
@@ -110,7 +111,7 @@ if ($_SESSION['accepted'] == 1) {
$motd = MapOfTheDay(1);
$jmid[1] = $motd['id'];
-$mapContent .= displayMaze($motd, 1);
+$mapContent = displayMaze($motd, 1);
$motd = MapOfTheDay(2);
$jmid[2] = $motd['id'];
@@ -148,7 +149,7 @@ if ($special == '') {
<?
function displayMaze($motd, $mapType) {
-
+ global $accepted, $userID;
//Gather data for map;
$mapID = $motd['id'];
$map = $motd['map'];
@@ -158,19 +159,20 @@ function displayMaze($motd, $mapType) {
$topscores = topScores($motd['id'], 30);
$topscorediv = "<div id='$mapID,dspScore'>\n$topscores\n</div>";
- $userID = $_SESSION['userID'];
- if ($_SESSION['accepted'] == 1) {
+ $mysolution = '';
+ $mymoves = '';
+ if ($accepted) {
$sol = getSolution($userID, $mapID);
$mysolution = $sol['solution'];
//!! implement mymoves
$mymoves = $sol['moves'];
}
- if (isset($_SESSION[$mapID.'sol']) AND $mysolution == '') {
+ if (isset($_SESSION[$mapID.'sol']) && $mysolution == '') {
$mysolution = $_SESSION[$mapID.'sol'];
$mymoves = $_SESSION[$mapID.'moves'];
}
- $r .= "<div id=\"yms-$mapType\" class='hidden-maps'>";
+ $r = "<div id=\"yms-$mapType\" class='hidden-maps'>";
$r .= " <div class='wrapper'>";
// if ($width <= 16) {