summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorSnap <snapwilliam@gmail.com>2015-05-01 16:25:28 -0700
committerSnap <snapwilliam@gmail.com>2015-05-01 16:25:28 -0700
commite6b60448bc08df316daf220db8ecfddc58aefe84 (patch)
tree8ec936e42a24a68cb775eb75688eabe2f71c5a18 /index.php
parent6001d7ef9b8b26fe388ea5965139d84bdd63ca22 (diff)
downloadpathery-e6b60448bc08df316daf220db8ecfddc58aefe84.tar.xz
Minor fixes and adjustments.
Moved Javascript in chat to: js/chat.js re-ordered script loading so Jquery loads first. Fixed cookie login issue.
Diffstat (limited to 'index.php')
-rw-r--r--index.php42
1 files changed, 30 insertions, 12 deletions
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");