summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php50
1 files changed, 39 insertions, 11 deletions
diff --git a/index.php b/index.php
index fce390a..cc3e7cb 100644
--- a/index.php
+++ b/index.php
@@ -46,20 +46,35 @@ 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 {
+ $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
//ROW 1
if ($accepted) {
@@ -135,6 +150,19 @@ switch ($request) {
case "test":
require("pages/test.php");
break;
+
+ // deprecate at some point
+ case "creategame":
+ require("pages/creategame.php");
+ break;
+
+ case "games":
+ require("pages/games.php");
+ break;
+
+ case "matches":
+ require("pages/matches.php");
+ break;
case "m":
require("pages/mobile.php");
@@ -287,4 +315,4 @@ switch ($request) {
require("pages/home.php");
}
-?>
+?> \ No newline at end of file