summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBlueRaja <BlueRaja.admin@gmail.com>2013-01-13 20:02:50 -0600
committerBlueRaja <BlueRaja.admin@gmail.com>2013-01-13 20:02:50 -0600
commitd2a9bf56c2625b71016f1ce879aaf10ade57754a (patch)
treeb8af9d77dd8252a0c69ea74c0531a93fd9ee49a6
parentdb7f5c43e70cb6497b21109feec445f47bb8997d (diff)
downloadpathery-d2a9bf56c2625b71016f1ce879aaf10ade57754a.tar.xz
Small bugfix for not loading disabled challenges
-rw-r--r--includes/datas.php13
1 files changed, 2 insertions, 11 deletions
diff --git a/includes/datas.php b/includes/datas.php
index b29f1c9..66c816b 100644
--- a/includes/datas.php
+++ b/includes/datas.php
@@ -1058,22 +1058,13 @@ function loadChallengesForMap($mapIdUnsanitized, $userIdUnsanitized)
function loadChallengeListing($userIdUnsanitized)
{
$userID = mysql_escape_string($userIdUnsanitized);
- $sql = "
- SELECT maps.ID AS mapID, maps.challengeTier, maps.name AS name,
- challengeSolutions.dateSolved, challengeSolutions.challengeID AS challengeID
- FROM maps
- INNER JOIN challenges ON maps.ID = challenges.mapID
- LEFT JOIN challengeSolutions ON challenges.ID = challengeSolutions.challengeID
- WHERE maps.isChallenge = 1 AND challenges.enabled = 1
- AND (challengeSolutions.userID IS NULL OR challengeSolutions.userID = '$userID')
- AND maps.challengeTier <= (SELECT challengeTier FROM users WHERE users.ID = '$userID')
- ORDER BY maps.challengeTier, maps.challengeSuborder, challenges.ordering
- ";
+
$sql = " SELECT maps.ID AS mapID, maps.challengeTier, maps.name AS name,
challengeSolutions.dateSolved, challengeSolutions.challengeID AS challengeID
FROM challenges
LEFT JOIN maps ON challenges.mapID = maps.ID
LEFT JOIN challengeSolutions ON challenges.ID = challengeSolutions.challengeID AND challengeSolutions.userID = '$userID'
+ WHERE challenges.enabled = 1
ORDER BY maps.challengeTier, maps.challengeSuborder, challenges.ordering";
$result = mysql_query($sql);