diff options
-rw-r--r-- | globe.php | 4 | ||||
-rw-r--r-- | images/Achievement_MazeCareer.png | bin | 0 -> 368 bytes | |||
-rw-r--r-- | images/Achievement_PathCareer.png | bin | 0 -> 293 bytes | |||
-rw-r--r-- | images/MedalGoldCAR.png | bin | 0 -> 1547 bytes | |||
-rw-r--r-- | images/MedalSilverCAR.png | bin | 0 -> 1605 bytes | |||
-rw-r--r-- | includes/datas.php | 3 | ||||
-rw-r--r-- | index.php | 4 | ||||
-rw-r--r-- | pages/achievements.php | 59 | ||||
-rw-r--r-- | pages/feedback.php | 25 | ||||
-rw-r--r-- | pages/home.php | 31 | ||||
-rw-r--r-- | pages/memberlist.php | 7 |
11 files changed, 71 insertions, 62 deletions
@@ -1,5 +1,5 @@ <?PHP
-date_default_timezone_set('America/Los_Angeles');
+date_default_timezone_set('America/New_York');
if (!session_id())
session_start();
//session_regenerate_id();
@@ -22,6 +22,7 @@ function sql_clean($string) { }
function CookieLogin() {
+ global $accepted;
include_once "includes/db.inc.php";
$userID = $_COOKIE['userID'];
$auth = $_COOKIE['auth'];
@@ -53,6 +54,7 @@ function CookieLogin() { if ($auth == $three) {
$_SESSION['accepted'] = 1;
+ $accepted = 1;
$_SESSION['userID'] = $userID;
$_SESSION['displayName'] = $display;
if ($isAdmin == 1)
diff --git a/images/Achievement_MazeCareer.png b/images/Achievement_MazeCareer.png Binary files differnew file mode 100644 index 0000000..b04fefa --- /dev/null +++ b/images/Achievement_MazeCareer.png diff --git a/images/Achievement_PathCareer.png b/images/Achievement_PathCareer.png Binary files differnew file mode 100644 index 0000000..37559f0 --- /dev/null +++ b/images/Achievement_PathCareer.png diff --git a/images/MedalGoldCAR.png b/images/MedalGoldCAR.png Binary files differnew file mode 100644 index 0000000..75e7f26 --- /dev/null +++ b/images/MedalGoldCAR.png diff --git a/images/MedalSilverCAR.png b/images/MedalSilverCAR.png Binary files differnew file mode 100644 index 0000000..daf46ff --- /dev/null +++ b/images/MedalSilverCAR.png diff --git a/includes/datas.php b/includes/datas.php index 8c0309c..0041da2 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -496,6 +496,7 @@ function getMazeMasteryArray() { $r[9] = array(225, 2, 'CircleLarge_W_I.png', 'Inverted Bright Large Circle', 0); $r[10] = array(300, 2, 'DiamondSmall_B_I.png', 'Inverted Dark Small Diamond', 0); $r[11] = array(400, 2, 'CircleLargeDonut_B.png', 'Dark Annulated Circle', 0); + $r[12] = array(550, 2, 'CrossXL_B_I.png', 'Inverted Dark Large Present', 0); //$cp[4] = array(10000, 2, 'DiamondSmall_B.png', 'Dark Small Diamond', 0); @@ -513,7 +514,7 @@ function getWinsArray() { $r[6] = array(75, 2, 'OffsetStripesHorizontal_B_I.png', 'Inverted Dark Horizontal Stripes', 0); $r[7] = array(100, 2, 'CrossXLDonut_B_I.png', 'Inverted Dark Large Intersection', 0); $r[8] = array(150, 2, 'DiamondLarge_B.png', 'Dark Large Diamond', 0); - + $r[9] = array(225, 1, '#22ff22', 'Neon Lime', 1); //$r[7] = array(75, 2, 'CircleSmall_W_I.png', 'Inverted Bright Small Circle', 0); return $r; @@ -5,6 +5,10 @@ include_once("./includes/header.php"); if (!$accepted)
if (isset($_COOKIE['doLogin']) && $_COOKIE['doLogin'] == 'yes')
CookieLogin();
+
+
+if (isset($_SESSION['accepted']) AND $_SESSION['accepted'] == 1)
+ $accepted = true;
//Links appear in order.
$Links['home'] = "Home";
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>
|