diff options
author | raylu <raylu@cmu.edu> | 2011-04-07 00:27:27 -0400 |
---|---|---|
committer | raylu <raylu@cmu.edu> | 2011-04-07 00:27:27 -0400 |
commit | f8c9eb5220afaf2f9a62f9a176a45913240f4081 (patch) | |
tree | 99775178acfcef6e86e39184be0ac96083042f1b /pages/home.php | |
download | pathery-f8c9eb5220afaf2f9a62f9a176a45913240f4081.tar.xz |
Initial import from Dropbox
Diffstat (limited to 'pages/home.php')
-rw-r--r-- | pages/home.php | 167 |
1 files changed, 167 insertions, 0 deletions
diff --git a/pages/home.php b/pages/home.php new file mode 100644 index 0000000..4a034c3 --- /dev/null +++ b/pages/home.php @@ -0,0 +1,167 @@ +<?PHP
+htmlHeader();
+?>
+
+<body>
+<script type="text/javascript" src="sounds/script/soundmanager.js"></script>
+
+<?php
+include('./includes/maps.php');
+include('./includes/mapoftheday.php');
+
+include('./includes/datas.php');
+
+switch ($_GET['maptype']) {
+ case "normal":
+ case "2":
+ $maptype = 2;
+ break;
+
+ case "hard":
+ case "3":
+ $maptype = 3;
+ break;
+
+ case "day":
+ case "4":
+ $maptype = 4;
+ break;
+
+ case "easy":
+ case "1":
+ default:
+ $maptype = 1;
+}
+
+//$motd = getMapOfTheDay();
+$motd = MapOfTheDay($maptype);
+
+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>";
+$mergesolution = $map;
+
+//Like button
+ //<br /><b>I made a like button!</b> I'm not sure what happens if you press it.
+ //<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.snapems.com&layout=button_count&show_faces=false&width=90&action=like&font&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe>
+ //<br />Let me know if it makes your computer explode or something.
+
+
+?>
+<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!
+ <p>
+ New maps are generated daily at 9:00 PM Pacific Time.
+ <br />Maps for <?php echo "$date" ?>:
+ <br /><a href='?page=home&maptype=easy'>Simple</a>
+ <br /><a href='?page=home&maptype=normal'>Normal</a>
+ <br /><a href='?page=home&maptype=hard'>Complex</a>
+ <br /><a href='?page=home&maptype=day'>Today's Special</a>
+ </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.
+ <?
+} else
+ 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 = "ABC's";
+ break;
+}
+
+echo "<br />$date<br /><a href='?page=home&maptype=easy'>Simple</a> | ";
+echo "<a href='?page=home&maptype=normal'>Normal</a> | ";
+echo "<a href='?page=home&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&maptype=day'>$today $mapstyle</a>";
+
+
+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
+//
+
+?>
+
+ <br />Please spread the word about this game.
+ <br />Send feedback to <a href='mailto:snapems@gmail.com'>snapems@gmail.com</a> (or IM me if you know me).
+ <br />We've been aptly implementing changes from feedback.
+ <br />This game is being adjusted, some 'rules' may change.
+ <br />Copyright © 2011 Snapems.com
+
+</div>
+
+<script type="text/javascript">soundManagerInit();</script>
+
+
+</body>
+</html>
|