diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/embed.php | 113 | ||||
-rw-r--r-- | pages/home.php | 102 | ||||
-rw-r--r-- | pages/login.php | 19 | ||||
-rw-r--r-- | pages/tutorial.php | 116 |
4 files changed, 304 insertions, 46 deletions
diff --git a/pages/embed.php b/pages/embed.php new file mode 100644 index 0000000..4c1ca68 --- /dev/null +++ b/pages/embed.php @@ -0,0 +1,113 @@ +<?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');
+
+
+
+//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 = MapOfTheDay($maptype);
+$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;
+
+?>
+<div class="col2" style="text-align: center">
+<?
+echo "$date: <a href='?page=embed&maptype=easy'>Easy</a> | ";
+echo "<a href='?page=embed&maptype=normal'>Normal</a> | ";
+echo "<a href='?page=embed&maptype=hard'>Hard</a> | ";
+echo "<a href='?page=embed&maptype=day'>Special</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;
+?>
+<a href="http://www.pathery.com">www.pathery.com</a>
+</div>
+<script type="text/javascript">soundManagerInit();</script>
+
+</body>
+</html>
diff --git a/pages/home.php b/pages/home.php index 4a034c3..928a99e 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,16 @@ $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!
<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>
+ <center><strong>News:</strong></center>
+ <strong>We've moved to www.Pathery.com </strong> (look up, you're already there) <strong>You'll need to re-allow your email-address with google.
+ <br />Don't worry- we've saved all your solutions and history - (soon you'll be able to access it too! hehe)</strong> - 09-09-11
+ <br />New maps are generated daily at 9:00 PM Pacific Time.
+ <br /><i>Maps for <?php echo "$date" ?>:</i>
+ <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>
<? echo $topscorediv; ?>
@@ -85,42 +130,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 = "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 "<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);
@@ -156,7 +170,7 @@ echo $solutiondiv; <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
+ <br />Copyright © 2011 www.pathery.com
</div>
diff --git a/pages/login.php b/pages/login.php index c730846..1c16fe8 100644 --- a/pages/login.php +++ b/pages/login.php @@ -39,7 +39,9 @@ try { //I know just where to put this stuff!
require './includes/db.inc.php';
//Unless I already have this information...
- $sql = "SELECT `ID`, `isAdmin` FROM `users` WHERE `openID` = '$claimedid'";
+ //* Modify this to WHERE `email`
+ $sql = "SELECT `ID`, `isAdmin`, `openID` FROM `users` WHERE `email` = '$email'";
+ //$sql = "SELECT `ID`, `isAdmin` FROM `users` WHERE `openID` = '$claimedid'";
$result = mysql_query($sql);
$_SESSION['isAdmin'] = false;
@@ -51,6 +53,19 @@ try { if (mysql_result($result, 0, 'isAdmin') == 1)
$_SESSION['isAdmin'] = true;
+ //TEMPORARY CODE
+ //Check openID; and update it if necessary
+ if (mysql_result($result, 0, 'openID') == $claimedid) {
+ //Don't need to do anything
+ } else {
+ //Update the OpenID Code
+ $sql = "UPDATE `users`
+ SET `openID` = '$claimedid'
+ WHERE `ID` = '$userID'";
+ mysql_query($sql);
+ }
+ // </TEMPORARY CODE>
+
//I last-see you now!
$sql = "UPDATE `users`
SET `dateLogin` = NOW()
@@ -96,7 +111,7 @@ try { $two = MD5($one.$salt);
$three = MD5($pepper.$two);
- $expire = time() + (7 * 24 * 60 * 60);
+ $expire = time() + (31 * 24 * 60 * 60);
setcookie("userID", $userID, $expire);
setcookie("doLogin", "yes", $expire);
setcookie("auth", $three, $expire);
diff --git a/pages/tutorial.php b/pages/tutorial.php new file mode 100644 index 0000000..3ce0d06 --- /dev/null +++ b/pages/tutorial.php @@ -0,0 +1,116 @@ +<?PHP
+htmlHeader();
+?>
+<body>
+<?php
+topbar($Links);
+?>
+
+<script type="text/javascript" src="sounds/script/soundmanager.js"></script>
+
+<?
+$requiredmoves = '18';
+?>
+
+<script type="text/javascript">
+ischallenge = true;
+
+function challengecomplete(mapid) {
+ var moves = mapjson[mapid].moves;
+
+ if (moves == <? echo $requiredmoves; ?>) {
+ flashelement('nextbtn', 15, null, 400);
+ updateDsp(1, 'instructions', 'Great Job!<br />Lets move on to the next shall we?')
+ } else {
+ //challengehint();
+ updateDsp(1, 'instructions', 'Place some walls<br />What would make it travel the longest?')
+ flashelement('1,instructions', 2, '#cce', 700);
+ setTimeout("flashelement('1,3,5', 10, '#cce', 760);", 1500);
+ setTimeout("flashelement('1,4,6', 10, '#cce', 760);", 1500);
+ }
+}
+
+function challengehint() {
+ //setTimeout("flashelement('1,3,5', 10, '#cce', 620);", 100);
+ //setTimeout("flashelement('1,4,6', 10, '#cce', 620);", 100);
+ setTimeout("flashelement('1,btn', 6, '#ee4', 620);", 1500);
+ setTimeout("flashelement('1,instructions', 3, '#cce', 620);", 700);
+ //updateDsp(mapid, element, data) {
+}
+
+
+</script>
+
+<?php
+include('./includes/maps.php');
+
+include('./includes/datas.php');
+
+
+?>
+<div class="col2" style="text-align: center">
+<br /> <br />
+<strong><p id='1,instructions'>
+Press GO!
+<br />
+</p>
+</strong>
+<br />
+<?
+echo "<a href='#'>Previous</a> | <a href='#' id='nextbtn'>Next</a> ";
+
+$challenge1[] = "sooraooof";
+$challenge1[] = "sooorooof";
+$challenge1[] = "sooooooof";
+$challenge1[] = "sooooooof";
+$challenge1[] = "sooooooof";
+
+$myparams['checkpoints'] = 1;
+$myparams['teleports'] = 0;
+$myparams['walls'] = 2;
+
+$map1 = GenerateShapedMap($challenge1, $myparams);
+
+$challenge2[] = "soooraoof";
+$challenge2[] = "sooooroof";
+$challenge2[] = "sooooooof";
+$challenge2[] = "sooroooof";
+$challenge2[] = "soobrooof";
+
+$myparams['checkpoints'] = 2;
+$myparams['teleports'] = 0;
+$myparams['walls'] = 4;
+
+$map2 = GenerateShapedMap($challenge2, $myparams);
+
+$challenge3[] = "soooraoof";
+$challenge3[] = "sooooroof";
+$challenge3[] = "sooooooof";
+$challenge3[] = "sooroooof";
+$challenge3[] = "soobrooof";
+
+$myparams['checkpoints'] = 1;
+$myparams['teleports'] = 0;
+$myparams['walls'] = 4;
+
+$map3 = GenerateShapedMap($challenge3, $myparams);
+
+echo DisplayMap($map1, 1);
+echo "<br />";
+echo "<br /><center>map2</center>";
+echo "<br />";
+//echo DisplayMap($map2, 2);
+
+//$mysolution = getSolution($userID, $mapID);
+//$solutiondiv .= "<div id='mapsol' style='visibility:hidden;display:none'>";
+//$solutiondiv .= "<div id='mapsol'>";
+//$solutiondiv .= $mapID.":".$mysolution;
+//$solutiondiv .= '</div>';
+
+//echo $solutiondiv;
+?>
+</div>
+<script type="text/javascript">soundManagerInit();</script>
+
+</body>
+</html>
|