From 0761f76cc24350c4391efc981e49a9ad9828a94d Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Mon, 13 May 2013 01:00:15 -0700 Subject: Many PHP warnings/notices fixes. --- pages/achievements.php | 44 ++++++++++++++++++++++++++++++-------------- pages/mapeditor.php | 5 ++++- pages/massemail.php | 10 +++++----- 3 files changed, 39 insertions(+), 20 deletions(-) (limited to 'pages') diff --git a/pages/achievements.php b/pages/achievements.php index bef9adb..2434823 100644 --- a/pages/achievements.php +++ b/pages/achievements.php @@ -10,6 +10,12 @@ topbar($Links); include_once('./includes/sqlEmbedded.php'); include_once('./includes/datas.php'); + +//TODO: Redo crappy code? +//Reduce complaining -- until i can fix this +error_reporting(E_ERROR | E_WARNING | E_PARSE); + + //Get UserID if (is_int($_GET['id'] * 1) AND isset($_GET['id'])) $userID = $_GET['id'] * 1; @@ -407,9 +413,9 @@ function unlockItemAsTD($uType, $item) { $by = $aTypeNames[$item['aType']]; $on = relative_date(strtotime($aCompleted)); - $unlockTitle = "$item[name]. From $by $on"; + $unlockTitle = "{$item['name']}. From $by $on"; if ($item['aType'] == -1) { - $unlockTitle = "$item[name]"; + $unlockTitle = $item['name']; } //$border = 'border: 1px solid #000; border-width: 2px 0px 2px 0px;'; @@ -417,14 +423,16 @@ function unlockItemAsTD($uType, $item) { $class = 'grid_td_walls'; $class = 'displayWallUnlock'; + $r = ''; + $border = ''; //depreciate switch ($uType) { case UNLOCK_WALL_COLOR: if ($GLOBALS['wallColor'] == $item[value]) { $class .= ' active'; } else $class .= ' inactive'; - $r .= " + $r .= "
"; - // USE THIS ? $style = "background-image: url(../images/marks/$item[value]);"; + // USE THIS ? $style = "background-image: url(../images/marks/{$item['value']});"; break; case UNLOCK_DISPLAY_COLOR: if ($GLOBALS['nameColor'] == $item[value]) $border = 'border: 1px solid #26b;'; - $r .= ""; - $r .= " $item[name] "; + $r .= ""; + $r .= " {$item['name']} "; $r .= ""; break; case UNLOCK_WALL_ORIENTATION: $checked = ''; - if (intval($GLOBALS['wallOrientation']) == intval($item[value])) $checked = 'checked'; + if (intval($GLOBALS['wallOrientation']) == intval($item['value'])) $checked = 'checked'; //$r .= ""; $r .= ""; - $r .= "$item[name] "; + $r .= "{$item['name']} "; $r .= ""; break; case UNLOCK_EXTRAS: - $r .= "$item[name]"; + $r .= "{$item['name']}"; break; } return $r; @@ -478,6 +486,14 @@ if (isset($unlocks)) { $uSubtypeNames[UNLOCK_WALL_EMBLEM][0] = "Simple"; $uSubtypeNames[UNLOCK_WALL_EMBLEM][1] = "Complicated"; + $uSubtypeNames[UNLOCK_DISPLAY_COLOR][0] = ""; + + $uSubtypeNames[UNLOCK_WALL_ORIENTATION][0] = ""; + + $uSubtypeNames[UNLOCK_EXTRAS][0] = ""; + + + //For every unlock type that the user has. foreach ($unlocks as $uType => $unlock) { $subtype = array(); @@ -492,9 +508,9 @@ if (isset($unlocks)) { echo ""; foreach($subtype as $key => $content) { $content = implode($content); + echo ":$uType:$key:"; $tmpName = $uSubtypeNames[$uType][$key]; - if (count($subtype) > 1) - echo "
$tmpName"; + if (count($subtype) > 1) echo "
$tmpName"; echo "$content"; } echo "
"; diff --git a/pages/mapeditor.php b/pages/mapeditor.php index 4d395c4..e93ac17 100644 --- a/pages/mapeditor.php +++ b/pages/mapeditor.php @@ -348,9 +348,12 @@ function constructTiles(width, height, baseMap) { "; if ($_SESSION['isAdmin'] !== true) return; @@ -97,7 +97,7 @@ $count = $row['count']; //echo "
Script execution: $time seconds XX\n
"; $where = ''; -if ($_POST['selectResultSet'] == 'true') { +if (isset($_POST['selectResultSet']) AND $_POST['selectResultSet'] == 'true') { // CLAUSES: $clause1 = $_POST['clause1']; $clauseOptions = array('ID', 'displayName', 'dateJoined', 'dateLogin', 'email', 'isAdmin'); -- cgit v1.2.3