summaryrefslogtreecommitdiffstats
path: root/pages/achievements.php
diff options
context:
space:
mode:
authorBlueRaja <BlueRaja.admin@gmail.com>2013-01-26 03:30:45 -0600
committerBlueRaja <BlueRaja.admin@gmail.com>2013-01-26 03:30:45 -0600
commitd7b0c04459a6ec42a37255c38d67cea14fb60e61 (patch)
tree4269be8ec67fa3f4d12932041d3b37fa1f007daf /pages/achievements.php
parent1e65273d68ffdec07f49c14e929499af21f7776a (diff)
downloadpathery-d7b0c04459a6ec42a37255c38d67cea14fb60e61.tar.xz
Moved usersData table to users table, added a few more columns to users (currently unused)
Diffstat (limited to 'pages/achievements.php')
-rw-r--r--pages/achievements.php30
1 files changed, 9 insertions, 21 deletions
diff --git a/pages/achievements.php b/pages/achievements.php
index e3f9e8d..f2c5aba 100644
--- a/pages/achievements.php
+++ b/pages/achievements.php
@@ -225,16 +225,6 @@ 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'];
@@ -253,9 +243,9 @@ if (isset($_POST['doupdate']) AND !$viewer) {
$unlockNameColor = '#cccccc';
if ($unlockColor == $_POST['selectColor']) {
- $sql = "UPDATE `userData`
+ $sql = "UPDATE `users`
SET `wallColor` = '$unlockColor'
- WHERE `userID` = '$userID'";
+ WHERE `ID` = '$userID'";
$result = mysql_query($sql);
if (!$result) {
echo "Error updating wall color";
@@ -267,9 +257,9 @@ if (isset($_POST['doupdate']) AND !$viewer) {
}
}
if ($unlockEmblem == $_POST['selectEmblem']) {
- $sql = "UPDATE `userData`
+ $sql = "UPDATE `users`
SET `wallEmblem` = '$unlockEmblem'
- WHERE `userID` = '$userID'";
+ WHERE `ID` = '$userID'";
$result = mysql_query($sql);
if (!$result) {
echo "Error updating wall color";
@@ -282,9 +272,9 @@ if (isset($_POST['doupdate']) AND !$viewer) {
}
if ($unlockNameColor == $_POST['selectNameColor']) {
- $sql = "UPDATE `userData`
+ $sql = "UPDATE `users`
SET `displayColor` = '$unlockNameColor'
- WHERE `userID` = '$userID'";
+ WHERE `ID` = '$userID'";
$result = mysql_query($sql);
if (!$result) {
echo "Error updating wall color";
@@ -330,14 +320,12 @@ SELECT
users.isAdmin,
users.totalMoves,
users.totalMazes AS totalSolutions,
- IfNull(userData.wallColor, '#666666'),
- IfNull(userData.displayColor, '#cccccc'),
- userData.wallEmblem
+ users.wallColor,
+ users.displayColor,
+ users.wallEmblem
FROM `users`
LEFT JOIN `solutions`
ON users.ID = solutions.userID
-LEFT JOIN `userData`
- ON users.ID = userData.userID
WHERE users.ID = '$userID'
GROUP BY solutions.userID
";