From 86aac4847705f0a4559400da6c0e9f1aeba5cdf8 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Fri, 10 May 2013 02:17:14 -0700 Subject: Many bugs and PHP notices & warning fixes. --- includes/datas.php | 10 +++++----- includes/header.php | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) (limited to 'includes') 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 @@ @@ -9,7 +10,14 @@ function htmlHeader($css = array(), $title = 'Pathery', $desc = '', $scripts = a <? echo $title; ?> - +'; + } else { + echo ""; + } + // +?> "; - foreach ($scripts as $s) echo ""; + foreach ($scripts as $s) echo ""; ?> @@ -136,12 +144,14 @@ function htmlFooter() { s.parentNode.appendChild(ga, s); })(); @@ -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; -- cgit v1.2.3