diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2012-09-30 21:48:56 -0700 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2012-09-30 21:48:56 -0700 |
commit | bc456f1ef6a74a74e821304df1a08a5aeb341f7a (patch) | |
tree | a36e8a4ff2dadbfda7a94d0ca849bab8b6786086 /pages | |
parent | be06cd9fdc0253b5fdf2fb17de4aac6f10bff80c (diff) | |
parent | 60c8232de409d0cb6de37ef87a489049f060003d (diff) | |
download | pathery-bc456f1ef6a74a74e821304df1a08a5aeb341f7a.tar.xz |
Merge branch 'HEAD' of ssh://git@git.raylu.net/pathery
Diffstat (limited to 'pages')
-rw-r--r-- | pages/challenge.php | 34 | ||||
-rw-r--r-- | pages/tutorial.php | 4 |
2 files changed, 21 insertions, 17 deletions
diff --git a/pages/challenge.php b/pages/challenge.php index 1fa420a..6990644 100644 --- a/pages/challenge.php +++ b/pages/challenge.php @@ -1,7 +1,7 @@ <?php
ob_start("ob_gzhandler");
htmlHeader(
- array('tutorial'), 'Pathery Challenges',
+ array('tutorial', 'challenge'), 'Pathery Challenges',
'Challenges', array('scores', 'dateformat')
);
@@ -50,6 +50,7 @@ if (getCookie('pref_mute') != 'true') { <body>
<script type="text/javascript">
+var isChallenge = true;
playerWallColor = '<?PHP echo isset($wallColor) ? $wallColor : ''; ?>';
playerWallEmblem = '<?PHP echo isset($wallEmblem) ? $wallEmblem : ''; ?>';
</script>
@@ -58,7 +59,7 @@ playerWallEmblem = '<?PHP echo isset($wallEmblem) ? $wallEmblem : ''; ?>'; topbar($Links);
?>
-<div class="wrapper">
+<div id="challenge_wrapper" class="wrapper">
<?
@@ -92,18 +93,18 @@ $mapContent = displayMap(GenerateMapByCode($mapCode), 1); $challengeResultset = loadChallengesForMap($_GET["mapID"], $userID);
if($challengeResultset === NULL)
{
-
//TODO: Redirect to challenge listing also
return;
}
-displayChallenges($challengeResultset);
-
?>
<noscript>Sorry, this game requires scripts to run. Please enable javascript and <a href='home'>Reload this site</a>
<br />This game is best viewed in <a href='http://www.google.com/chrome'>Google Chrome</a>
</noscript>
- <? echo $mapContent; ?>
+ <?
+ echo $mapContent;
+ displayChallenges($challengeResultset);
+ ?>
</div>
<div id="copy" style='width:100%;clear: both'>
@@ -119,18 +120,25 @@ htmlFooter(); ?>
<?php
+/**
+ * Outputs the given list of challenges on the page
+ */
function displayChallenges($challengeResultset)
{
- echo "<div>";
+ echo '<div id="challenges">';
+ echo '<div id="challenges_title">Challenges</div>';
+ echo '<div id="challenges_listing"><ol>';
while($challenge = mysql_fetch_array($challengeResultset))
{
+ echo "<li>";
if($challenge["dateCompleted"] !== NULL)
- echo "<strike>" . getChallengeDisplayString($challenge) . "</strike>";
+ $cssClass = "challenge_complete";
else
- echo getChallengeDisplayString($challenge);
- echo "<br />";
+ $cssClass = "challenge_incomplete";
+ echo "<span class='$cssClass'>" . getChallengeDisplayString($challenge) . "</span>";
+ echo "</li>";
}
- echo "</div>";
+ echo "</ol></div></div>";
}
/**
@@ -140,7 +148,7 @@ function displayChallenges($challengeResultset) function getChallengeDisplayString($challenge)
{
$returnMe = "";
- if($challenge['goal'] == 0)
+ if($challenge["goal"] == 0)
$returnMe .= "Complete the maze";
else if ($challenge['inequality'] == "greater than")
$returnMe .= "Get " . $challenge['goal'];
@@ -220,4 +228,4 @@ function getChallengeDisplayString($challenge) $returnMe .= ".";
return $returnMe;
}
-?>
+?>
\ No newline at end of file diff --git a/pages/tutorial.php b/pages/tutorial.php index d09480c..f6517c4 100644 --- a/pages/tutorial.php +++ b/pages/tutorial.php @@ -36,19 +36,15 @@ playerWallEmblem = '<?PHP echo isset($wallEmblem) ? $wallEmblem : ''; ?>'; <script>
isChallenge = true;
-challengeID = 1;
-
function challengeLoad() {}
-
challenge1 = new Object();
challenge2 = new Object();
challenge3 = new Object();
challenge4 = new Object();
challenge5 = new Object();
-
challenge1.start = "The objective in this game is to create the longest <i>path</i> between the start and the finish.<br>Below is a demonstration.<br>Press <b>Go!</b>";
challenge1.complete = "Now that you see what is going on, let's move on to some puzzles.<br/>Press <b>Next</b>";
|