diff options
Diffstat (limited to 'pages/challenge.php')
-rw-r--r-- | pages/challenge.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/pages/challenge.php b/pages/challenge.php index 2ab279d..8d312d1 100644 --- a/pages/challenge.php +++ b/pages/challenge.php @@ -1,5 +1,4 @@ <?php
-ob_start("ob_gzhandler");
htmlHeader(
array('tutorial', 'challenge'), 'Pathery Challenges',
'Challenges', array('scores', 'dateformat')
@@ -94,8 +93,11 @@ if($mapCode === NULL) return;
}
+// TODO: !! Sanitize mapid
+$mapID = $_GET["mapID"];
+
$mapContent = displayMap(GenerateMapByCode($mapCode), $_GET["mapID"]);
-$challengeResultset = loadChallengesForMap($_GET["mapID"], $userID);
+$challengeResultset = loadChallengesForMap($mapID, $userID);
if($challengeResultset === NULL)
{
redirectToChallengeListing();
@@ -112,9 +114,6 @@ if($challengeResultset === NULL) ?>
</div>
-<div id="copy" style='width:100%;clear: both'>
- Copyright © 2011-2012 pathery.com
-</div>
<script src="sounds/script/soundmanager.js"></script>
<script type="text/javascript">soundManagerInit();</script>
@@ -135,13 +134,15 @@ function displayChallenges($challengeResultset) echo '<div id="challenges_listing"><ol>';
while($challenge = mysql_fetch_array($challengeResultset))
{
+ $mapID = $_GET["mapID"];
$challengeId = $challenge["challengeID"];
echo "<li>";
if($challenge["dateSolved"] !== NULL)
$cssClass = "challenge_complete";
else
$cssClass = "challenge_incomplete";
- echo "<span class='$cssClass' id='challenge_id_$challengeId'>" . getChallengeDisplayString($challenge) . "</span>";
+ $loadSolutionString = "<a href='javascript:requestChallengeSolution(\"$mapID\", \"$challengeId\");'> Load this solution</a>";
+ echo "<span class='$cssClass' id='challenge_id_$challengeId'>" . getChallengeDisplayString($challenge) . " $loadSolutionString </span>";
echo "</li>";
}
echo "</ol></div></div>";
@@ -157,7 +158,7 @@ function getChallengeDisplayString($challenge) if($challenge["goal"] == 0)
$returnMe .= "Complete the maze";
else if ($challenge['inequality'] == "greater than")
- $returnMe .= "Get " . $challenge['goal'];
+ $returnMe .= "Get " . $challenge['goal'] . ' or more';
else if ($challenge['inequality'] == "less than")
$returnMe .= "Get LESS THAN " . $challenge['goal'];
else //inequality == "equal"
@@ -169,7 +170,7 @@ function getChallengeDisplayString($challenge) //Wall-count restriction
if($challenge['restrictWallCount'] !== NULL)
{
- $restrictions[] = "at most " . $challenge['restrictWallCount'] . " wall" . ($challenge['restrictWallCount'] == 1 ? "" : "s");
+ $restrictions[] = "only " . $challenge['restrictWallCount'] . " wall" . ($challenge['restrictWallCount'] == 1 ? "" : "s");
$addUsingToText = true;
}
|