diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2013-05-13 01:00:15 -0700 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2013-05-13 01:00:15 -0700 |
commit | 0761f76cc24350c4391efc981e49a9ad9828a94d (patch) | |
tree | 587532e8dbdb4f400c8ac74d3dd8049def23f3cc | |
parent | 136ce85b66802c663264d5d10ccc6e58efec7059 (diff) | |
download | pathery-0761f76cc24350c4391efc981e49a9ad9828a94d.tar.xz |
Many PHP warnings/notices fixes.
-rw-r--r-- | ajax/chat.ajax.php | 4 | ||||
-rw-r--r-- | do.php | 5 | ||||
-rw-r--r-- | includes/datas.php | 2 | ||||
-rw-r--r-- | pages/achievements.php | 44 | ||||
-rw-r--r-- | pages/mapeditor.php | 5 | ||||
-rw-r--r-- | pages/massemail.php | 10 |
6 files changed, 47 insertions, 23 deletions
diff --git a/ajax/chat.ajax.php b/ajax/chat.ajax.php index 59f7ae3..9017ab0 100644 --- a/ajax/chat.ajax.php +++ b/ajax/chat.ajax.php @@ -5,6 +5,10 @@ session_start(); // header("HTTP/1.0 404 Not Found");
// exit;
// }
+
+if (isset($_SESSION['chatLastReset'])) $chatLastReset = $_SESSION['chatLastReset'];
+else $chatLastReset = 0;
+
if (strtotime('now') - $_SESSION['chatLastReset'] > 6) {
$_SESSION['chatSendCount'] = 0;
$_SESSION['chatLastReset'] = strtotime('now');
@@ -285,8 +285,9 @@ if ($_GET['r'] == 'getpath') { // ---------- CLOSING THE SESSION $_SESSION WILL NO LONGER WORK FOR WRITING
session_write_close();
//Now that is done, we can easily do whatever we want - Like, send any emails that there might be.
- include_once('./includes/emails.php');
- SendQueuedEmail();
+ //TODO: Move to process.php!
+ //include_once('./includes/emails.php');
+ //SendQueuedEmail();
$json['error'][] = 'user is logged in';
// --------- USER LOGGED IN
diff --git a/includes/datas.php b/includes/datas.php index b8ffef7..6bf04d6 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -7,7 +7,6 @@ include_once('constants.php'); //FirePHP stuff - TODO: Delete //require_once('includes/FirePHPCore/FirePHP.class.php'); -//FirePHP stuff - TODO: Delete //Returns text refering to any notifications. function getNotified($userID) { @@ -95,6 +94,7 @@ function getNotified($userID) { } function displayUnlock($uType, $uValue, $uName) { + $r = ''; switch ($uType) { case UNLOCK_WALL_COLOR: $r .= "$uName Wall Color!"; 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 .= "<td class='$class' id='color_$item[id]' title='$unlockTitle' ";
- $r .= "onClick='colorclick(this,\"$item[value]\", \"$item[id]\")' ";
- $r .= "style='background-color:$item[value];'><div></div></td>";
+ $r .= "<td class='$class' id='color_{$item['id']}' title='$unlockTitle' ";
+ $r .= "onClick='colorclick(this,\"{$item['value']}\", \"{$item['id']}\")' ";
+ $r .= "style='background-color:{$item['value']};'><div></div></td>";
// USE THIS? $style = "background-color:$item[value];";
break;
@@ -432,30 +440,30 @@ function unlockItemAsTD($uType, $item) { if ($GLOBALS['wallEmblem'] == $item[value]) {
$class .= ' active';
} else $class .= ' inactive';
- $r .= "<td class='$class' title='$unlockTitle' id='' onClick='emblemclick(this,\"$item[value]\", \"$item[id]\")' style='background-image: url(../images/marks/$item[value]);' >
+ $r .= "<td class='$class' title='$unlockTitle' id='' onClick='emblemclick(this,\"{$item['value']}\", \"{$item['id']}\")' style='background-image: url(../images/marks/{$item['value']});' >
<div></div></td>";
- // 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 .= "<td class='name_color_select'><span title='$unlockTitle' onClick='namecolorclick(this,\"$item[value]\", \"$item[id]\")' style='color:$item[value]; margin-right:15px;$border'>";
- $r .= " $item[name] ";
+ $r .= "<td class='name_color_select'><span title='$unlockTitle' onClick='namecolorclick(this,\"{$item['value']}\", \"{$item['id']}\")' style='color:{$item['value']}; margin-right:15px;$border'>";
+ $r .= " {$item['name']} ";
$r .= "</span></td>";
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 .= "<td class='name_color_select'>";
$r .= "<td class='name_color_select'>";
- $r .= "<input onClick='wallOrientationClick(this,\"$item[value]\", \"$item[id]\")' type='radio' name='wallOrientation' value='male' $checked>$item[name] ";
+ $r .= "<input onClick='wallOrientationClick(this,\"{$item['value']}\", \"{$item['id']}\")' type='radio' name='wallOrientation' value='male' $checked>{$item['name']} ";
$r .= "</td>";
break;
case UNLOCK_EXTRAS:
- $r .= "<td style='border: 1px solid gray;' class='name_color_select' title='$unlockTitle'>$item[name]</td>";
+ $r .= "<td style='border: 1px solid gray;' class='name_color_select' title='$unlockTitle'>{$item['name']}</td>";
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 "<table>";
foreach($subtype as $key => $content) {
$content = implode($content);
+ echo "<b>:$uType:$key:</b>";
$tmpName = $uSubtypeNames[$uType][$key];
- if (count($subtype) > 1)
- echo "</table><strong>$tmpName</strong><table>";
+ if (count($subtype) > 1) echo "</table><strong>$tmpName</strong><table>";
echo "<tr>$content</tr>";
}
echo "</table>";
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) { <?PHP $tilesArray = array( + //: q? 's', 's2', 'f', 'p', 'space', - 'r', 'r2', 'o', 'q', 'x', 'x2', + 'x', 'x2', + 'space', + 'r', 'r2', 'r3', 'o', 'space', 'c', 'c2', 'c3', 'c4', 'c5', 'space', diff --git a/pages/massemail.php b/pages/massemail.php index 74c8fdc..a85451b 100644 --- a/pages/massemail.php +++ b/pages/massemail.php @@ -9,9 +9,9 @@ htmlHeader( <?php
topbar($Links);
-include('./includes/datas.php');
-include('./includes/sqlEmbedded.php');
-include('./includes/emails.php');
+include_once('./includes/datas.php');
+include_once('./includes/sqlEmbedded.php');
+include_once('./includes/emails.php');
if (!$accepted) exit;
@@ -21,7 +21,7 @@ To unsubscribe: %mydomaincp Questions? Email us! snap@pathery.com";
-if ($_POST['queueMassEmail'] == 'true') {
+if (isset($_POST['queueMassEmail']) AND $_POST['queueMassEmail'] == 'true') {
echo "Action started...<br/>";
if ($_SESSION['isAdmin'] !== true)
return;
@@ -97,7 +97,7 @@ $count = $row['count']; //echo "<br>Script execution: $time seconds XX\n <br>";
$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');
|