diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/datas.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/includes/datas.php b/includes/datas.php index 934c1d7..2e48b14 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -463,6 +463,16 @@ function isChallengeMap($mapID) { $result = mysql_query($sql) or die(mysql_error()); return (mysql_num_rows($result) != 0); } +function getChallengeMapCode($mapID) { + $sql = "SELECT `code` + FROM `challengeMaps` + WHERE + ID = '$mapID'; + "; + $result = mysql_query($sql); + $row = mysql_fetch_row($result); + return $row[0]; +} function getUserChallengeTier($userID) { @@ -1015,7 +1025,7 @@ function loadChallengeListing($userIdUnsanitized) INNER JOIN challengeMaps ON challenges.mapID = challengeMaps.ID LEFT JOIN challengeSolutions ON challenges.ID = challengeSolutions.challengeID AND challengeSolutions.userID = '$userID' WHERE challenges.enabled = 1 - AND challengeMaps.challengeTier <= (SELECT challengeTier FROM users WHERE ID = '$userID' LIMIT 1) + AND challengeMaps.challengeTier <= (SELECT challengeTier FROM users WHERE ID = '$userID' LIMIT 1) OR 1 ORDER BY challengeMaps.challengeTier, challengeMaps.challengeSuborder, challenges.ordering"; $result = mysql_query($sql) OR die(mysql_error()."SQL: $sql"); |