diff options
Diffstat (limited to 'pages/home.php')
-rw-r--r-- | pages/home.php | 179 |
1 files changed, 60 insertions, 119 deletions
diff --git a/pages/home.php b/pages/home.php index 8bd7d11..044fc5f 100644 --- a/pages/home.php +++ b/pages/home.php @@ -1,10 +1,8 @@ <?PHP
-htmlHeader();
+htmlHeader(array('stats'));
?>
<body>
-<script type="text/javascript" src="sounds/script/soundmanager.js"></script>
-
<?php
include('./includes/maps.php');
include('./includes/mapoftheday.php');
@@ -16,63 +14,57 @@ $numday = date('w'); $numday = intval($numday);
switch ($numday) {
case 0:
- $mapstyle = 'Thirty';
- break;
+ $mapstyle = 'Thirty';
+ break;
case 1:
- $mapstyle = 'Simple';
- break;
+ $mapstyle = 'Simple';
+ break;
case 2:
- $mapstyle = "ABC's";
- break;
+ $mapstyle = "ABC's";
+ break;
case 3:
- $mapstyle = 'Teleport Madness';
- break;
+ $mapstyle = 'Teleport Madness';
+ break;
case 4:
- $mapstyle = 'Rocky Maze';
- break;
+ $mapstyle = 'Rocky Maze';
+ break;
case 5: //Friday
- $mapstyle = 'Side to Side';
- break;
+ $mapstyle = 'Side to Side';
+ break;
case 6: //Saturday
- $mapstyle = "Seeing Double";
- break;
+ $mapstyle = "Seeing Double";
+ break;
}
-$normal = 'Normal';
-$easy = 'Simple';
-$hard = 'Complex';
+$easy = '<a href="?page=home&maptype=easy">Simple</a>';
+$normal = '<a href="?page=home&maptype=normal">Normal</a>';
+$hard = '<a href="?page=home&maptype=hard">Complex</a>';
-$today = date('l');
-//if ($today == 'Sunday' OR $today == 'Saturday')
- //$today = 'Weekend Map';
-//else
- $today .= "'s";
-$special = "$today $mapstyle";
+$today = date('l') . "'s";
+$special = "<a href=\"?page=home&maptype=day\">$today $mapstyle</a>";
switch ($_GET['maptype']) {
+ case "easy":
+ case "1":
+ default:
+ $maptype = 1;
+ $easy = '<a href="?page=home&maptype=easy" class="selected">Simple</a>';
+ break;
case "normal":
case "2":
- $maptype = 2;
- $normal = '<b>Normal</b>';
- break;
-
+ $maptype = 2;
+ $normal = '<a href="?page=home&maptype=normal" class="selected">Normal</a>';
+ break;
case "hard":
case "3":
- $maptype = 3;
- $hard = '<b>Complex</b>';
- break;
-
+ $maptype = 3;
+ $hard = '<a href="?page=home&maptype=hard" class="selected">Complex</a>';
+ break;
case "day":
case "4":
- $maptype = 4;
- $special = "<b>$special</b>";
- break;
-
- case "easy":
- case "1":
- default:
- $maptype = 1;
- $easy = '<b>Simple</b>';
+ $maptype = 4;
+ $special = "<a href=\"?page=home&maptype=day\" class=\"selected\">$today $mapstyle</a>";
+ break;
}
//$motd = getMapOfTheDay();
@@ -83,7 +75,6 @@ topbar($Links); $mapID = $motd['id'];
$map = $motd['map'];
$userID = $_SESSION['userID'];
-$date = date("m-d-y");
//$mergesolution = mergeMapSolution($map, $mysolution);
$topscores = topScores($motd['id'], 30);
$topscorediv = "<div id='$mapID,dspScore'>\n$topscores\n</div>";
@@ -91,89 +82,39 @@ $mergesolution = $map; ?>
-<br>
-<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com/pages/Pathery/176985129018434&layout=button_count&show_faces=false&width=90&action=like&font&colorscheme=dark&height=21" style="border:none; overflow:hidden; width:95px; height:21px; float:right"></iframe>
-
-<div class="col1">
- <p>
- <strong>News:</strong><br>
- <strong>We've moved to pathery.com</strong> (look up, you're already there)! You'll need to re-login with Google.
- <br />Don't worry – we've saved all your solutions and history (soon you'll even be able to see them! hehe).
- </p>
- <p>Maps for <?php echo "$date" ?>:
- <br><a href='?page=home&maptype=easy'><? echo $easy; ?></a>
- <br><a href='?page=home&maptype=normal'><? echo $normal; ?></a>
- <br><a href='?page=home&maptype=hard'><? echo $hard; ?></a>
- <br><a href='?page=home&maptype=day'><? echo $special; ?></a>
- </p>
- <p>
- New maps are generated daily at 9:00 PM Pacific Time.
- <br>
- </p>
-
- <? echo $topscorediv; ?>
-</div>
-
-<div class="col2" style="text-align: center">
-<?
-if ($_SESSION['accepted'] != 1) {
- ?>
- New? Check out <a href='?page=howtoplay'>How to Play</a>
- <br /><span style="background-color: #444; font-weight: bold">
- The object of the game is to make the longest maze.</span>
- <br /><a href='?page=login'>Sign in using Google</a> to have your best solution saved.
+<div class="wrapper">
<?
-} else
- echo "<br />";
-
+ echo "<div id='difficulties'>";
+ echo "$easy";
+ echo "$normal";
+ echo "$hard";
+ echo "$special";
+ echo "</div>";
-
-echo "<br />$date<br /><a href='?page=home&maptype=easy'>$easy</a> | ";
-echo "<a href='?page=home&maptype=normal'>$normal</a> | ";
-echo "<a href='?page=home&maptype=hard'>$hard</a> | ";
-echo "<a href='?page=home&maptype=day'>$special</a>";
+ echo DisplayMap($mergesolution, $mapID);
+ $mysolution = getSolution($userID, $mapID);
+ $solutiondiv .= "<div id='mapsol' style='visibility:hidden;display:none'>";
+ $solutiondiv .= $mapID.":".$mysolution;
+ $solutiondiv .= '</div>';
-echo DisplayMap($mergesolution, $mapID);
-
-$mysolution = getSolution($userID, $mapID);
-$solutiondiv .= "<div id='mapsol' style='visibility:hidden;display:none'>";
-//$solutiondiv .= "<div id='mapsol'>";
-$solutiondiv .= $mapID.":".$mysolution;
-$solutiondiv .= '</div>';
-
-echo $solutiondiv;
-
-//Start tests
-
-// echo "<br /><br />map $map mapid $mapID userID $userID";
-// $mysolution = getSolution($userID, $mapID);
-// $mysolution = formSolution($mysolution);
-// echo " last-best solution $mysolution";
-// $mergesolution = mergeMapSolution($map, $mysolution);
-// echo " merge sol1: $mergesolution <br />";
-// $mergesolution = seperateMapSolution($mergesolution);
-// $mergesolution = formSolution($mergesolution);
-// echo " merge sol2: $mergesolution <br />";
-
-//echo "<br /><div id='debug'>tmp debug data</div><br />";
-
-//End tests
-//
-//
-// <meta property="og:title" content="Pathery - The Game"/>
-// <meta property="og:site_name" content="Pathery.com"/>
-// <meta property="og:image" content="http://www.pathery.com/ some sort of logo.... "/>
+ echo $solutiondiv;
+ echo $topscorediv;
?>
- <br />
- <br />Copyright © 2011 pathery.com
-
+ <div id="fb">
+ </div>
</div>
-<script type="text/javascript">soundManagerInit();</script>
+<div id="copy">
+ <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com/pages/Pathery/176985129018434&layout=button_count&show_faces=false&width=90&action=like&font&colorscheme=dark&height=21"></iframe>
+ Copyright © 2011 pathery.com
+</div>
+<script src="sounds/script/soundmanager.js" async="async"></script>
+<script type="text/javascript">soundManagerInit();</script>
-</body>
-</html>
+<?php
+htmlFooter();
+?>
|