summaryrefslogtreecommitdiffstats
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/achievements.php59
-rw-r--r--pages/feedback.php25
-rw-r--r--pages/home.php31
-rw-r--r--pages/memberlist.php7
4 files changed, 62 insertions, 60 deletions
diff --git a/pages/achievements.php b/pages/achievements.php
index 76d993d..1d81220 100644
--- a/pages/achievements.php
+++ b/pages/achievements.php
@@ -224,6 +224,17 @@ if ($result) {
//Validate selection and then update.
if (isset($_POST['doupdate']) AND !$viewer) {
+
+ // Ensure the user is located in userData.
+ $sql = "SELECT * FROM `userData`
+ WHERE `userID` = '$userID'";
+ $result = mysql_query($sql);
+ if (mysql_num_rows($result) == 0) {
+ $sql = "INSERT INTO `userData` (`userID`, `displayColor`, `wallColor`)
+ VALUES ('$userID', '#cccccc', '#666666')";
+ mysql_query($sql);
+ }
+
//print_R($unlocks);
$unlockIDC = $_POST['selectColorID'];
$unlockColor = $unlocks[1][$unlockIDC]['value'];
@@ -246,41 +257,48 @@ if (isset($_POST['doupdate']) AND !$viewer) {
SET `wallColor` = '$unlockColor'
WHERE `userID` = '$userID'";
$result = mysql_query($sql);
- if (!$result)
+ if (!$result) {
echo "Error updating wall color";
+ $data = array();
+ $data['error'] = "Error when updating wall color";
+ $data['session'] = print_r($_SESSION, true);
+ $data['post'] = print_r($_POST, true);
+ EmailError($data);
+ }
}
if ($unlockEmblem == $_POST['selectEmblem']) {
$sql = "UPDATE `userData`
SET `wallEmblem` = '$unlockEmblem'
WHERE `userID` = '$userID'";
$result = mysql_query($sql);
- if (!$result)
- echo "Error updating Emblem";
+ if (!$result) {
+ echo "Error updating wall color";
+ $data = array();
+ $data['error'] = "Error when updating wall color";
+ $data['session'] = print_r($_SESSION, true);
+ $data['post'] = print_r($_POST, true);
+ EmailError($data);
+ }
+
}
if ($unlockNameColor == $_POST['selectNameColor']) {
$sql = "UPDATE `userData`
SET `displayColor` = '$unlockNameColor'
WHERE `userID` = '$userID'";
$result = mysql_query($sql);
- if (!$result)
- echo "Error updating Username Display Color";
+ if (!$result) {
+ echo "Error updating wall color";
+ $data = array();
+ $data['error'] = "Error when updating wall color";
+ $data['session'] = print_r($_SESSION, true);
+ $data['post'] = print_r($_POST, true);
+ EmailError($data);
+ }
}
-
}
-
$achievements = array();
-//Depreciated
-$sql = "
-SELECT
- type,
- MAX(level) as level,
- MAX(dateCompleted)
-FROM `achievements`
-WHERE userID = '$userID'
-GROUP BY `type`";
-
//Fetch data
@@ -478,8 +496,8 @@ foreach($achievements as $aType => $a) {
$uCurrent = $uStats[$aType];
$nUCurrent = number_format($uCurrent);
- $aTypeNames[1] = "Path Career Level $aLevel!";
- $aTypeNames[2] = "Mazes Career Level $aLevel!";
+ $aTypeNames[1] = "<img src='../images/Achievement_PathCareer.png' style='width:36px;height:36px;vertical-align:middle'>Path Career Level $aLevel!";
+ $aTypeNames[2] = "<img src='../images/Achievement_MazeCareer.png' style='width:36px;height:36px;vertical-align:middle'>Mazes Career Level $aLevel!";
$aTypeNames[3] = "<img src='../images/MedalSilverCAR.png' style='width:36px;height:36px;vertical-align:middle'>Maze Mastery Level $aLevel!";
$aTypeNames[4] = "<img src='../images/MedalGoldCAR.png' style='width:36px;height:36px;vertical-align:middle'>Champion Level $aLevel!";
$aTypeNames[32] = 'Tutorial Complete!';
@@ -500,11 +518,10 @@ foreach($achievements as $aType => $a) {
$lastlevel = true;
foreach ($CPD as $item) {
list($required, $unlockType, $unlockValue, $unlockName) = $item;
-
if ($debug)
echo "At $required: <table>".displayUnlock($unlockType, $unlockValue, $unlockName)."</table>";
-
+
$nRequired = number_format($required);
if ($required > $uCurrent) {
$lastlevel = false;
diff --git a/pages/feedback.php b/pages/feedback.php
index dfe022f..3e10cef 100644
--- a/pages/feedback.php
+++ b/pages/feedback.php
@@ -1,16 +1,32 @@
<?php
-if (isset($_POST['regarding'])) {
+if (isset($_POST['regarding']) AND isset($_SESSION['accepted'])) {
+ if (!$accepted)
+ return;
$data = $_POST;
$data['session'] = print_r($_SESSION, true);
+
+ $userID = $_SESSION['userID'] * 1;
+ if (!is_int($userID))
+ return;
+
+ include_once "includes/db.inc.php";
+ $sql = "SELECT `email` FROM `users`
+ WHERE `ID` = '$userID'";
+ $result = mysql_query($sql);
+
+ $email = mysql_result($result, 0, 'email');
+
+ $data['email'] = $email;
+
EmailError($data, "Pathery Feedback");
- DoRedirect("Thank you for your feedback! <br />
+ DoRedirect("<b>Thank you for your feedback!</b> <br />
I'm Reading this right now.<br />
Well, obviously I'm not reading it right NOW.<br />
I guess what I meant to say is that I'll be reading it soon.<br />
Wow this redirect is taking a while.. Sorry<br />
Are you still here?<br />
- Something must be wrong, you should really have been redirected by now", $mydomain, 8);
+ Something must be wrong, you should really have been redirected by now", $mydomain, 5);
exit;
}
@@ -34,7 +50,7 @@ if (!$accepted) {
?>
-<div class="wrapper">
+<div class="wrapper" style="width:600px;">
<h2>Contact us</h2>
<h3>Send us a line!</h3>
@@ -48,6 +64,7 @@ if (!$accepted) {
<option value='Feedback' selected='selected'>General Feedback</option>
<option value='Bug'>Bug report</option>
<option value='Suggestion'>Suggestion</option>
+ <option value='Question'>Question</option>
<option value='Hi'>Just saying Hi</option>
<option value='Other'>Other</option>
</select>
diff --git a/pages/home.php b/pages/home.php
index c2a8e8a..7e5e401 100644
--- a/pages/home.php
+++ b/pages/home.php
@@ -58,37 +58,6 @@ function tutorialComplete($userID) {
return false;
}
-//Get the current day as int.
-$numday = date('w');
-$numday = intval($numday);
-switch ($numday) {
- case 0:
- $mapstyle = 'Thirty';
- break;
- case 1:
- $mapstyle = 'Simple';
- break;
- case 2:
- $mapstyle = "ABC's";
- break;
- case 3:
- $mapstyle = 'Teleport Madness';
- break;
- case 4:
- $mapstyle = 'Rocky Maze';
- break;
- case 5: //Friday
- $mapstyle = 'Side to Side';
- break;
- case 6: //Saturday
- $mapstyle = "Seeing Double";
- break;
-}
-
-
-
-
-
?>
<body>
diff --git a/pages/memberlist.php b/pages/memberlist.php
index a682579..9c0f3ce 100644
--- a/pages/memberlist.php
+++ b/pages/memberlist.php
@@ -54,7 +54,6 @@ if (isset($_GET['o'])) {
$sql = "SELECT
users.ID,
users.displayName,
- userData.displayColor,
(SELECT SUM(moves) FROM solutions WHERE solutions.userID = users.ID) AS totalMoves,
(SELECT SUM(moves) FROM solutions
WHERE solutions.userID = users.ID AND
@@ -127,7 +126,7 @@ foreach ($cat as $name => $item) {
//Echo Table Data
$i = 0;
-while (list($userID, $display, $displayColor, $moveCount, $moveCountWeek, $mazeCount, $winCount, $tieCount, $wallColor, $nameColor, $wallEmblem, $joined, $lastLogon) = mysql_fetch_row($result)) {
+while (list($userID, $display, $moveCount, $moveCountWeek, $mazeCount, $winCount, $tieCount, $wallColor, $nameColor, $wallEmblem, $joined, $lastLogon) = mysql_fetch_row($result)) {
//Prepare data
$i++;
@@ -150,7 +149,7 @@ while (list($userID, $display, $displayColor, $moveCount, $moveCountWeek, $mazeC
$background = '#343c57';
echo "
-<tr style='background-color: $background; color:$displayColor;' >
+<tr style='background-color: $background; color:$nameColor;' >
<td>$i</td>
<td>
<div class='grid_td' style='width:35px; height:35px; background:$wallColor url(images/marks/$wallEmblem);'>
@@ -158,7 +157,7 @@ while (list($userID, $display, $displayColor, $moveCount, $moveCountWeek, $mazeC
</div>
</div>
</td>
- <td><span title='UserID: $userID'><a href='achievements?id=$userID' style='color:$displayColor'>$display</a></span></td>
+ <td><span title='UserID: $userID'><a href='achievements?id=$userID' style='color:$nameColor'>$display</a></span></td>
<td>$mazeCount</td>
<td>$moveCount</td>