summaryrefslogtreecommitdiffstats
path: root/pages/challengelist.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-01-08 22:47:13 -0800
committerPatrick Davison <snapwilliam@gmail.com>2013-01-08 22:47:13 -0800
commit16567167343024754247818e92115ed83255ed0d (patch)
treedcd71d452cdee6996cf7547c3e1665390d9d76de /pages/challengelist.php
parente04ac8f4c4db236005ac045a9dbb36b163f227ee (diff)
downloadpathery-16567167343024754247818e92115ed83255ed0d.tar.xz
Map class and Challenges
The mapclass should eventually replace the current mapmatrix array w/ headers. Work on challenges progresses nicely
Diffstat (limited to 'pages/challengelist.php')
-rw-r--r--pages/challengelist.php29
1 files changed, 24 insertions, 5 deletions
diff --git a/pages/challengelist.php b/pages/challengelist.php
index 03dfdb3..eb9993d 100644
--- a/pages/challengelist.php
+++ b/pages/challengelist.php
@@ -8,17 +8,20 @@ include_once ('./includes/maps.php');
include_once ('./includes/mapoftheday.php');
include_once ('./includes/db.inc.php');
include_once ('./includes/datas.php');
+include_once ('./includes/mapclass.php');
topbar($Links);
?>
+
<div id="challengelist_wrapper" class="wrapper">
<?
//Check that the user is allowed to do the challenges
if (!$accepted) {
- echo "<center>Please <a href='login'>login</a> to do the challenges!</div>";
+ echo "<center>Please <a href='login'>login</a> to do the challenges!</center>";
+ echo "<br /><br /></div>";
htmlFooter();
return;
}
@@ -42,6 +45,7 @@ $challengeListResultset = loadChallengeListing($userID);
displayChallengeList($challengeListResultset);
?>
+
</div>
<?php
@@ -57,18 +61,22 @@ function displayChallengeList($challengeListResultset)
echo '<div id="challengelist">';
$currentTier = -1;
$currentMap = -1;
+
while($challenge = mysql_fetch_array($challengeListResultset))
{
//Each challenge gets its own header/table
+ // echo "<br>L: $currentTier<br>N: ";
+ // echo $challenge["challengeTier"];
+ // echo "<br>";
if($challenge["challengeTier"] != $currentTier)
{
if($currentTier >= 0)
{
- echo '</table>';
+ echo '</table>EndTier';
}
$currentTier = $challenge["challengeTier"];
echo "<div class='challengelist_tier'>Tier $currentTier</div>";
- echo "<table class='challengelist_table'>";
+ echo "<table class='challengelist_table'>\n";
}
//Each map gets it own row
@@ -79,10 +87,20 @@ function displayChallengeList($challengeListResultset)
echo '</td></tr>';
}
$currentMap = $challenge["mapID"];
- $mapName = $challenge["name"];
+
+ $mapCode = getMapCode($currentMap);
+ $map = new map($mapCode);
+ $thumbnail = DisplayMapThumbnail($map);
+
+ $mapName = $map->name;
if($mapName == NULL || $mapName == "")
$mapName = "(unknown)";
- echo "<tr><td class='challengelist_link'><a href='challenge?mapID=$currentMap'>$mapName</a></td>";
+
+ echo "<tr style='border:2px solid red;'>
+ <td class='challengelist_link' style='cursor:pointer' onclick='document.location.href=\"challenge?mapID=$currentMap\"'>
+ $thumbnail
+ <a href='challenge?mapID=$currentMap'>$mapName</a>
+ </td>";
echo "<td class='challengelist_stars'>";
}
@@ -94,5 +112,6 @@ function displayChallengeList($challengeListResultset)
echo "<div class='$cssClass'></div>";
}
echo "</td></tr></table>";
+ echo "</div>";
}
?> \ No newline at end of file