summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-05-10 02:17:14 -0700
committerPatrick Davison <snapwilliam@gmail.com>2013-05-10 02:17:14 -0700
commit86aac4847705f0a4559400da6c0e9f1aeba5cdf8 (patch)
treec8c43ab196e5a0a4d280ea84152be5d0e061e0c7 /includes
parent51d99728286212717003009dd5706bb74edcb272 (diff)
downloadpathery-86aac4847705f0a4559400da6c0e9f1aeba5cdf8.tar.xz
Many bugs and PHP notices & warning fixes.
Diffstat (limited to 'includes')
-rw-r--r--includes/datas.php10
-rw-r--r--includes/header.php16
2 files changed, 18 insertions, 8 deletions
diff --git a/includes/datas.php b/includes/datas.php
index 2e48b14..b8ffef7 100644
--- a/includes/datas.php
+++ b/includes/datas.php
@@ -512,8 +512,7 @@ function applyAchievements($userID, $aType) {
if (!isset($aArray[$aNextLevel]))
return false;
list($required, $unlockType, $unlockValue, $unlockName, $unlockSubtype) = $aArray[$aNextLevel];
- if ($amount < $required)
- return false;
+ if ($amount < $required) return false;
$sql = "INSERT INTO `achievements`
(`userID`, `type`, `level`)
@@ -788,12 +787,13 @@ function getMembers($pageNumber = 1, $pageDivide = 50, $order = 'DESC', $orderBy
$output['updateTime'] = date("g:i A (T)");
$i = $limitTop;
+ $userPosition = -1;
$foundUser = false;
while ($row = mysql_fetch_assoc($result)) {
$i++;
$userID = $row['ID'];
- if ($_SESSION['userID'] == $userID) {
+ if (isset($_SESSION['userID']) AND $_SESSION['userID'] == $userID) {
$userPosition = $i;
}
@@ -889,6 +889,7 @@ function getScores($mapID, $pageNumber = 1, $pageDivide = 10) {
$output['updateTime'] = time();
$i = 0;
+ $userPosition = -1;
$foundUser = false;
while ($row = mysql_fetch_assoc($result)) {
@@ -1056,9 +1057,8 @@ function loadChallengeMapCode($mapIdUnsanitized)
return NULL;
}
-
function isCurrentMap($mapID) {
- include_once('./includes/sqlEmbedded.php');
+ include_once('sqlEmbedded.php');
$sql = "SELECT mapID
FROM `mapOfTheDay`
WHERE `mapID` = '$mapID'
diff --git a/includes/header.php b/includes/header.php
index da5e11d..35fd323 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -1,6 +1,7 @@
<?php
function htmlHeader($css = array(), $title = 'Pathery', $desc = '', $scripts = array()) {
global $accepted;
+ $resourceVer = '050513.js';
?>
<!DOCTYPE html>
<html xml:lang="en" lang="en">
@@ -9,7 +10,14 @@ function htmlHeader($css = array(), $title = 'Pathery', $desc = '', $scripts = a
<title><? echo $title; ?></title>
<link href="css/page.css?v=011013" rel="stylesheet" type="text/css" />
- <link href="css/maps.css?v=122612" rel="stylesheet" type="text/css" />
+<?
+ if (isset($_GET['skin']) AND $_GET['skin'] == 'true') {
+ echo '<link href="skin/cute/css/maps.css" rel="stylesheet" type="text/css" />';
+ } else {
+ echo "<link href='css/maps.css?v=$resourceVer' rel='stylesheet' type='text/css' />";
+ }
+ // <link href="css/maps.css?v=122612" rel="stylesheet" type="text/css" />
+?>
<link rel="image_src" type="image/png" href="/images/linkdsp.png" />
<?php
foreach ($css as $c) {
@@ -17,7 +25,7 @@ function htmlHeader($css = array(), $title = 'Pathery', $desc = '', $scripts = a
}
if ($desc !== '') echo " <meta name='Description' content='$desc'>";
- foreach ($scripts as $s) echo "<script src='js/$s.js?v=122612'></script>";
+ foreach ($scripts as $s) echo "<script src='js/$s.js?v=$resourceVer'></script>";
?>
<script src="js/ajax.js" async="async"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
@@ -136,12 +144,14 @@ function htmlFooter() {
s.parentNode.appendChild(ga, s);
<?
+ if (isset($_SESSION['displayName'])) {
echo "mixpanel.people.set({
\$email: " . json_encode($_SESSION['email']) . ",
\$username: " . json_encode($_SESSION['displayName']) . ",
\$last_login: '" . date(DateTime::ISO8601) . "',
\$created: '" . $_SESSION['dateJoined'] . "'
});";
+ }
?>
})();
@@ -215,7 +225,7 @@ function userDataToJS() {
$userID = $_SESSION['userID'];
include_once('includes/datas.php');
$hasInsaneSpeed = hasExtrasUnlock($userID, UNLOCK_EXTRAS, MISC_UNLOCK_INSANE_SPEED);
- $r .= 'hasInsaneSpeed":'.$hasInsaneSpeed.'};'."\n";
+ $r = 'hasInsaneSpeed":'.$hasInsaneSpeed.'};'."\n";
$json = array('ID' => 'fat');
$json['ID'] = $userID;
$json['wallColor'] = $wallColor;