summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);