summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-05-01 01:54:08 -0700
committerPatrick Davison <snapwilliam@gmail.com>2013-05-01 01:54:08 -0700
commit51d99728286212717003009dd5706bb74edcb272 (patch)
tree5aff9d44e5856dd256020811943f9231ccfdb225 /includes
parent95d067a02b4a979f0ff3b23291d0b3b9718f615e (diff)
downloadpathery-51d99728286212717003009dd5706bb74edcb272.tar.xz
Challengesss Challenges... DB Updates. Challenges
Diffstat (limited to 'includes')
-rw-r--r--includes/datas.php12
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");