From e6b60448bc08df316daf220db8ecfddc58aefe84 Mon Sep 17 00:00:00 2001 From: Snap Date: Fri, 1 May 2015 16:25:28 -0700 Subject: Minor fixes and adjustments. Moved Javascript in chat to: js/chat.js re-ordered script loading so Jquery loads first. Fixed cookie login issue. --- index.php | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 3d99b95..2ac1aa1 100644 --- a/index.php +++ b/index.php @@ -46,18 +46,28 @@ if (!$accepted) { if (isset($_SESSION['accepted']) AND $_SESSION['accepted'] == 1) $accepted = true; -//TODO: We could store this data in the session -if ($accepted) { - $userID = $_SESSION['userID']; - $sql = " - SELECT - users.wallColor, - users.wallEmblem, - users.wallOrientation - FROM `users` - WHERE ID = '$userID' "; - $result = mysql_query($sql); - if ($result) list($wallColor, $wallEmblem, $wallOrientation) = mysql_fetch_row($result); +//Could be simplified; but store $wallColor and etc. +if ($accepted && !isset($wallColor)) { + if (isset($_SESSION['wallColor'])) { + $wallColor = $_SESSION['wallColor']; + $wallEmblem = $_SESSION['wallEmblem']; + $wallOrientation = $_SESSION['wallOrientation']; + } else { + $userID = $_SESSION['userID']; + $sql = " + SELECT + users.wallColor, + users.wallEmblem, + users.wallOrientation + FROM `users` + WHERE ID = '$userID' "; + $result = mysql_query($sql); + if ($result) list($wallColor, $wallEmblem, $wallOrientation) = mysql_fetch_row($result); + + $_SESSION['wallColor'] = $wallColor; + $_SESSION['wallEmblem'] = $wallEmblem; + $_SESSION['wallOrientation'] = $wallOrientation; + } } // Footer Links @@ -135,6 +145,14 @@ switch ($request) { case "test": require("pages/test.php"); break; + + case "creategame": + require("pages/creategame.php"); + break; + + case "games": + require("pages/games.php"); + break; case "m": require("pages/mobile.php"); -- cgit v1.2.3