summaryrefslogtreecommitdiffstats
path: root/pages/home.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2011-05-02 22:52:56 -0700
committerPatrick Davison <snapwilliam@gmail.com>2011-05-02 22:52:56 -0700
commitf9333b70547ae514ecc848fb195011a11897ee68 (patch)
tree5ea7abc10c215c2a4ca837f1fa90ebef874b9490 /pages/home.php
parent6554ac5bcacd25b6062d298a0e0b7ed6982282ba (diff)
downloadpathery-f9333b70547ae514ecc848fb195011a11897ee68.tar.xz
Improved map validation.
Diffstat (limited to 'pages/home.php')
-rw-r--r--pages/home.php94
1 files changed, 53 insertions, 41 deletions
diff --git a/pages/home.php b/pages/home.php
index a6d73d6..d905476 100644
--- a/pages/home.php
+++ b/pages/home.php
@@ -11,26 +11,70 @@ include('./includes/mapoftheday.php');
include('./includes/datas.php');
+
+
+//Get the current day as int.
+$numday = date('w');
+$numday = intval($numday);
+switch ($numday) {
+ case 0:
+ $mapstyle = 'Thirty';
+ break;
+ case 1:
+ $mapstyle = 'Simple';
+ break;
+ case 2:
+ $mapstyle = "ABC's";
+ break;
+ case 3:
+ $mapstyle = 'Teleport Madness';
+ break;
+ case 4:
+ $mapstyle = 'Rocky Maze';
+ break;
+ case 5: //Friday
+ $mapstyle = 'Side to Side';
+ break;
+ case 6: //Saturday
+ $mapstyle = "Seeing Double";
+ break;
+}
+
+$normal = 'Normal';
+$easy = 'Simple';
+$hard = 'Complex';
+
+$today = date('l');
+//if ($today == 'Sunday' OR $today == 'Saturday')
+ //$today = 'Weekend Map';
+//else
+ $today .= "'s";
+$special = "$today $mapstyle";
+
switch ($_GET['maptype']) {
case "normal":
case "2":
$maptype = 2;
+ $normal = '<b>Normal</b>';
break;
case "hard":
case "3":
$maptype = 3;
+ $hard = '<b>Complex</b>';
break;
case "day":
case "4":
$maptype = 4;
+ $special = "<b>$special</b>";
break;
case "easy":
case "1":
default:
$maptype = 1;
+ $easy = '<b>Simple</b>';
}
//$motd = getMapOfTheDay();
@@ -58,15 +102,14 @@ $mergesolution = $map;
<br />
<div class="col1">
- <b>I'm testing letting the path go over the START and FINISH tiles.</b>
- <br /> Have an opinion about this? Let me know!
+ <b>Some very exciting changes to be expected April 23rd!</b>
<p>
New maps are generated daily at 9:00 PM Pacific Time.
<br />Maps for <?php echo "$date" ?>:
- <br /><a href='?page=home&amp;maptype=easy'>Simple</a>
- <br /><a href='?page=home&amp;maptype=normal'>Normal</a>
- <br /><a href='?page=home&amp;maptype=hard'>Complex</a>
- <br /><a href='?page=home&amp;maptype=day'>Today's Special</a>
+ <br /><a href='?page=home&amp;maptype=easy'><? echo $easy; ?></a>
+ <br /><a href='?page=home&amp;maptype=normal'><? echo $normal; ?></a>
+ <br /><a href='?page=home&amp;maptype=hard'><? echo $hard; ?></a>
+ <br /><a href='?page=home&amp;maptype=day'><? echo $special; ?></a>
</p>
<? echo $topscorediv; ?>
@@ -85,42 +128,11 @@ if ($_SESSION['accepted'] != 1) {
echo "<br />";
-//Get the current day as int.
-$numday = date('w');
-$numday = intval($numday);
-switch ($numday) {
- case 0:
- $mapstyle = 'Thirty';
- break;
- case 1:
- $mapstyle = 'Simple';
- break;
- case 2:
- $mapstyle = "ABC's";
- break;
- case 3:
- $mapstyle = 'Teleport Madness';
- break;
- case 4:
- $mapstyle = 'Rocky Maze';
- break;
- case 5: //Friday
- $mapstyle = 'Side to Side';
- break;
- case 6: //Saturday
- $mapstyle = "Seeing Double";
- break;
-}
-echo "<br />$date<br /><a href='?page=home&amp;maptype=easy'>Simple</a> | ";
-echo "<a href='?page=home&amp;maptype=normal'>Normal</a> | ";
-echo "<a href='?page=home&amp;maptype=hard'>Complex</a> | ";
-$today = date('l');
-//if ($today == 'Sunday' OR $today == 'Saturday')
- //$today = 'Weekend Map';
-//else
- $today .= "'s";
-echo "<i><b> NEW: </b></i> <a href='?page=home&amp;maptype=day'>$today $mapstyle</a>";
+echo "<br />$date<br /><a href='?page=home&amp;maptype=easy'>$easy</a> | ";
+echo "<a href='?page=home&amp;maptype=normal'>$normal</a> | ";
+echo "<a href='?page=home&amp;maptype=hard'>$hard</a> | ";
+echo "<a href='?page=home&amp;maptype=day'>$special</a>";
echo DisplayMap($mergesolution, $mapID);