summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
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");