From d2a9bf56c2625b71016f1ce879aaf10ade57754a Mon Sep 17 00:00:00 2001 From: BlueRaja Date: Sun, 13 Jan 2013 20:02:50 -0600 Subject: Small bugfix for not loading disabled challenges --- includes/datas.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'includes') 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); -- cgit v1.2.3