From 6b8c58ac2d4de502421acef48f4434bee605633f Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 8 Jan 2013 01:53:05 -0800 Subject: Challenges Implementation. LOTS of stuff Fixed an issue with loading best solution from logged out to logged in state. Commented out a lot of firephp stuff; feel free to uncomment. --- includes/maps.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'includes/maps.php') diff --git a/includes/maps.php b/includes/maps.php index 431f006..1df258d 100644 --- a/includes/maps.php +++ b/includes/maps.php @@ -726,6 +726,19 @@ function getSolution($userID, $mapID) { } } +function getChallengeSolution($userID, $challengeID) { + include_once('db.inc.php'); + $sql = "SELECT `solution`, `moves` + FROM `challengeSolutions` + WHERE `userID` = '$userID' AND + `challengeID` = '$challengeID' + "; + $result = mysql_query($sql); + if (mysql_num_rows($result) > 0) { + return mysql_fetch_assoc($result); + } +} + function getMapCode($mapID) { include_once('db.inc.php'); $sql = "SELECT `code` -- cgit v1.2.3