summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorBlueRaja <BlueRaja.admin@gmail.com>2015-05-07 23:14:47 -0500
committerBlueRaja <BlueRaja.admin@gmail.com>2015-05-07 23:14:47 -0500
commit3dc3919ce1b5336861979cde56884842615c967b (patch)
treef0a2418290cecd15f20c834bb071ffa9f3694b09 /index.php
parent29e872fbc6c552ef02208fe9fa5416b69773aa38 (diff)
parentc517b645c8723b5f4d20cbb91cbc4b9f45579cbb (diff)
downloadpathery-3dc3919ce1b5336861979cde56884842615c967b.tar.xz
Merge branch 'master' of git.raylu.net:pathery
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