diff options
-rw-r--r-- | do.php | 2 | ||||
-rw-r--r-- | includes/datas.php | 6 | ||||
-rw-r--r-- | includes/header.php | 22 | ||||
-rw-r--r-- | index.php | 24 | ||||
-rw-r--r-- | js/mapspecs.js | 6 | ||||
-rw-r--r-- | pages/home.php | 26 | ||||
-rw-r--r-- | pages/share.php | 8 | ||||
-rw-r--r-- | pages/tutorial.php | 2 |
8 files changed, 44 insertions, 52 deletions
@@ -188,7 +188,7 @@ if ($_GET['r'] == 'getpath') { WHERE
`mapID` = '$mapID' AND
`userID` = users.ID
- ORDER BY `moves` DESC, `dateModified` ASC
+ ORDER BY `moves` DESC, `dateModified` ASC, solutions.ID DESC
LIMIT 1";
$result = mysql_query($sql);
if (mysql_num_rows($result) > 0) {
diff --git a/includes/datas.php b/includes/datas.php index fa8bfb0..f1f4377 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -5,7 +5,7 @@ include_once('db.inc.php'); //FirePHP stuff - TODO: Delete -require_once('includes/FirePHPCore/FirePHP.class.php'); +//require_once('includes/FirePHPCore/FirePHP.class.php'); //FirePHP stuff - TODO: Delete //Select Stats/Scores. @@ -719,7 +719,7 @@ function trackMOTDstats($mapType) { DATE_FORMAT(maps.dateCreated,'%Y-%m-%d') AND `mapType` = '$mapType' GROUP BY solutions.userID - ORDER BY Moves DESC, MAX(dateModified) ASC + ORDER BY Moves DESC, MAX(dateModified) ASC, solutions.ID DESC "; $mainResult = mysql_query($sql); @@ -804,7 +804,7 @@ function getScores($mapid, $pageNumber = 1, $pageDivide = 10) { LEFT JOIN `userData` ON users.ID = userData.userID WHERE solutions.mapID = '$mapid' - ORDER BY solutions.moves DESC, solutions.dateModified ASC + ORDER BY solutions.moves DESC, solutions.dateModified ASC, solutions.ID DESC "; $result = mysql_query($sql); //$utime = date("g:i A (T)"); diff --git a/includes/header.php b/includes/header.php index 74a773a..c415e75 100644 --- a/includes/header.php +++ b/includes/header.php @@ -1,20 +1,4 @@ <?php
-$accepted = isset($_SESSION['accepted']) && $_SESSION['accepted'] == 1;
-
-if ($accepted) {
- $userID = $_SESSION['userID'];
- include_once ('./includes/db.inc.php');
- $sql = "
- SELECT
- userData.wallColor,
- userData.wallEmblem
- FROM `userData`
- WHERE userID = '$userID' ";
- $result = mysql_query($sql);
- if ($result)
- list($wallColor, $wallEmblem) = mysql_fetch_row($result);
-}
-
function htmlHeader($css = array(), $title = 'Pathery', $desc = '', $scripts = array()) {
global $accepted;
?>
@@ -37,7 +21,7 @@ function htmlHeader($css = array(), $title = 'Pathery', $desc = '', $scripts = a echo "<script src='js/$s.js?v=2'></script>";
?>
<script src="js/ajax.js" async="async"></script>
- <script src="js/mapspecs.js?v=112612"></script>
+ <script src="js/mapspecs.js?v=112512"></script>
<script>
(function(c,a){window.mixpanel=a;var b,d,h,e;b=c.createElement("script");b.type="text/javascript";b.async=!0;b.src=("https:"===c.location.protocol?"https:":"http:")+'//cdn.mxpnl.com/libs/mixpanel-2.1.min.js';d=c.getElementsByTagName("script")[0];d.parentNode.insertBefore(b,d);a._i=[];a.init=function(b,c,f){function d(a,b){var c=b.split(".");2==c.length&&(a=a[c[0]],b=c[1]);a[b]=function(){a.push([b].concat(Array.prototype.slice.call(arguments,0)))}}var g=a;"undefined"!==typeof f?
@@ -167,8 +151,8 @@ function topbar($links) { <h2>Sign in</h2>
<div id="oid_box">
<h2 style="color:#333;">Do you have an account here?</h2>
- <a href="login?op=google"><img id="oid_btn" src="images/btns/signin_Google.png" alt="Sign in with Google" /></a>
- <a href="login?op=yahoo"><img id="oid_btn" src="images/btns/signin_Yahoo.png" alt="Sign in with Yahoo" /></a>
+ <a rel="nofollow" href="login?op=google"><img id="oid_btn" src="images/btns/signin_Google.png" alt="Sign in with Google" /></a>
+ <a rel="nofollow" href="login?op=yahoo"><img id="oid_btn" src="images/btns/signin_Yahoo.png" alt="Sign in with Yahoo" /></a>
<a id="oid_learn" href="http://openid.net/get-an-openid/what-is-openid/" target="_blank" >Learn more about OpenID</a>
<a id="oid_cancel" href="javascript:hideSignin();">X</a>
</div>
@@ -1,15 +1,33 @@ <?PHP
+//globe will start the session.
include_once("globe.php");
include_once("./includes/header.php");
+$accepted = isset($_SESSION['accepted']) && $_SESSION['accepted'] == 1;
+
+//Not logged in?
if (!$accepted)
if (isset($_COOKIE['doLogin']) && $_COOKIE['doLogin'] == 'yes')
CookieLogin();
-
-
if (isset($_SESSION['accepted']) AND $_SESSION['accepted'] == 1)
$accepted = true;
+//TODO: We could store this data in the session
+if ($accepted) {
+ $userID = $_SESSION['userID'];
+ include_once ('./includes/db.inc.php');
+ $sql = "
+ SELECT
+ userData.wallColor,
+ userData.wallEmblem
+ FROM `userData`
+ WHERE userID = '$userID' ";
+ $result = mysql_query($sql);
+ if ($result)
+ list($wallColor, $wallEmblem) = mysql_fetch_row($result);
+}
+
+
//Links appear in order.
$Links['home'] = "Home";
$Links['leaderboard'] = "Scoreboard";
@@ -20,7 +38,7 @@ if ($accepted) { $linkname = 'achievements?id='.$_SESSION['userID'];
$Links[$linkname] = "Achievements";
}
-$Links['members'] = "<i title='New!'>Member List</i>";
+$Links['members'] = "Member List";
if (isset($_SESSION['isAdmin']) && $_SESSION['isAdmin'] == true) {
$Links['admin'] = 'Admin';
}
diff --git a/js/mapspecs.js b/js/mapspecs.js index 87de7de..5299b60 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -302,7 +302,8 @@ function request_path_done() { //Mark off challenges
- if(isChallenge)
+ //TODO: Temporarly disabled because it breaks the tutorial;
+ if(isChallenge && 2 == 4)
{
for(var i = 0; i < JO.completedChallenges.length; i++)
{
@@ -509,8 +510,6 @@ function doanimate(x, y, p, c, mapid, pathNumber) { handle.pressed = true;
} else {
if (contains(mapdata[mapid].usedTiles, eid)) {
- console.log("executed on", eid, c);
- console.log("true:", contains(mapdata[mapid].usedTiles, eid));
handle.style.backgroundColor = '#dddddd';
setTimeout("document.getElementById('"+eid+"').style.backgroundColor = '#dddddd';", 865);
handle.pressed = true;
@@ -563,7 +562,6 @@ function doanimate(x, y, p, c, mapid, pathNumber) { //Switch for range result.
var disptext = ""
var improvedScore = (count[mapid] > mapjson[mapid].mybest && mapjson[mapid].mybest != "0");
- console.log(mapjson[mapid].mybest,mapjson[mapid].mybest == 0 )
switch (true) {
case (count[mapid] > mapjson[mapid].best):
disptext = "Beat "+mapjson[mapid].bestby+"'s record of "+mapjson[mapid].best+" with "+count[mapid]+"!";
diff --git a/pages/home.php b/pages/home.php index ad9f74e..dbc1a01 100644 --- a/pages/home.php +++ b/pages/home.php @@ -1,33 +1,19 @@ <?php
ob_start("ob_gzhandler");
-htmlHeader(
- array('stats'), 'Pathery',
- 'Compete to create the longest maze possible. 4 New maps every day at 9 PM Pacific',
- array('scores', 'dateformat')
-);
include_once ('./includes/maps.php');
include_once ('./includes/mapoftheday.php');
include_once ('./includes/db.inc.php');
include_once ('./includes/datas.php');
+htmlHeader(
+ array('stats'), 'Pathery',
+ 'Compete to create the longest path possible. New maps every day!',
+ array('scores', 'dateformat')
+);
$noteScript = '';
if ($accepted) {
- $userID = $_SESSION['userID'];
-
- // $sql = "
- // SELECT
- // userData.wallColor,
- // userData.wallEmblem
- // FROM `userData`
- // WHERE userID = '$userID' ";
- // $result = mysql_query($sql);
- // if ($result)
- // list($wallColor, $wallEmblem) = mysql_fetch_row($result);
- //global $wallColor;
- //echo ": Wallcolor: $wallColor :" ;
-
//$note = getNotified($userID);
$note = false;
if ($note !== false) {
@@ -268,7 +254,7 @@ $timerem = strtotime("tomorrow") - strtotime("now"); var stamp = hours + ":" + minutes;
//if (hours < 1 && minutes < 5)
stamp = stamp + ":" + seconds
- stamp = 'New maps ' + formatedTomorrow + '<br />' + stamp + ' Remain';
+ stamp = 'New maps ' + formatedTomorrow + '<br />Time remaining: ' + stamp;
document.getElementById("countdown").innerHTML = stamp;
if (totalSeconds <= 1 && userConfirm == true) {
diff --git a/pages/share.php b/pages/share.php index 1193bb6..098c281 100644 --- a/pages/share.php +++ b/pages/share.php @@ -17,11 +17,17 @@ if (is_int($_GET['mapid'] + 0)) $mapID = $_GET['mapid'] + 0;
$mapcode = getMapCode($mapID);
+//New code:
+if ($_GET['mapcode'])
+ $mapcode = $_GET['mapcode'];
+
+
$map = GenerateMapByCode($mapcode);
-echo DisplayMap($map, 1, 'example', 1);
+//echo DisplayMap($map, 1, 'example', 1);
+echo DisplayMap($map, 1);
?>
<script>
diff --git a/pages/tutorial.php b/pages/tutorial.php index d09480c..5f82999 100644 --- a/pages/tutorial.php +++ b/pages/tutorial.php @@ -70,7 +70,7 @@ challenge5.complete = "Look at you, so pro.<br><a href='home'>Go play the game!< challenge5.help = "Try placing the walls as highlighted.";
function challengeGo(mapid) {
- var moves = mapjson[mapid].moves;
+ var moves = mapjson[mapid].path[0].moves;
var tiles;
switch (mapid) {
|