mirror of
https://github.com/e107inc/e107.git
synced 2025-01-16 20:28:28 +01:00
Issue #1356 - PHP7 Fixes.
This commit is contained in:
parent
32636ec39d
commit
486f3d4961
@ -132,6 +132,7 @@ set_error_handler(array(&$error_handler, 'handle_error'));
|
||||
//
|
||||
define('e107_INIT', true);
|
||||
|
||||
|
||||
// MOVED TO $e107->prepare_request()
|
||||
// setup some php options
|
||||
//e107_ini_set('magic_quotes_runtime', 0);
|
||||
|
2
cron.php
2
cron.php
@ -78,7 +78,7 @@ require_once(realpath(dirname(__FILE__)."/class2.php"));
|
||||
$sql = e107::getDb();
|
||||
if($sql->select("cron",'cron_function,cron_tab','cron_active =1'))
|
||||
{
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
list($class,$function) = explode("::",$row['cron_function'],2);
|
||||
$key = $class."__".$function;
|
||||
|
@ -109,7 +109,7 @@ class cron_admin_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
$sql->gen("SELECT cron_function,cron_active FROM #cron ");
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$this->curCrons[] = $row['cron_function'];
|
||||
if($row['cron_active']==1)
|
||||
@ -403,7 +403,7 @@ class cron_admin_ui extends e_admin_ui
|
||||
$sql = e107::getDb();
|
||||
if($sql->select("cron","cron_name,cron_function","cron_id = ".intval($cron_id)))
|
||||
{
|
||||
$row = $sql->fetch(MYSQL_ASSOC);
|
||||
$row = $sql->fetch();
|
||||
$class_func = $row['cron_function'];
|
||||
$cron_name = $row['cron_name'];
|
||||
}
|
||||
|
@ -987,7 +987,7 @@ class system_tools
|
||||
|
||||
if($sql->gen($query))
|
||||
{
|
||||
while ($row = $sql->fetch(MYSQL_NUM))
|
||||
while ($row = $sql->fetch('num'))
|
||||
{
|
||||
$qry[] = $row[0];
|
||||
}
|
||||
@ -1006,7 +1006,7 @@ class system_tools
|
||||
$mes->addError("Query Failed: ".$query);
|
||||
return;
|
||||
}
|
||||
while ($row = mysql_fetch_array($result, MYSQL_NUM))
|
||||
while ($row = mysql_fetch_array($result, 'num'))
|
||||
{
|
||||
$qry[] = $row[0];
|
||||
}
|
||||
|
@ -1308,7 +1308,7 @@ class news_form_ui extends e_admin_form_ui
|
||||
{
|
||||
$auth = ($curVal) ? intval($curVal) : USERID;
|
||||
$sql->select("user", "user_name", "user_id={$auth} LIMIT 1");
|
||||
$row = $sql->fetch(MYSQL_ASSOC);
|
||||
$row = $sql->fetch();
|
||||
$text .= "<input type='hidden' name='news_author' value='".$auth.chr(35).$row['user_name']."' />";
|
||||
$text .= "<a href='".e107::getUrl()->create('user/profile/view', 'name='.$row['user_name'].'&id='.$curVal."'>".$row['user_name'])."</a>";
|
||||
}
|
||||
@ -2841,7 +2841,7 @@ class admin_newspost
|
||||
{
|
||||
$auth = ($_POST['news_author']) ? intval($_POST['news_author']) : USERID;
|
||||
$sql->select("user", "user_name", "user_id={$auth} LIMIT 1");
|
||||
$row = $sql->fetch(MYSQL_ASSOC);
|
||||
$row = $sql->fetch();
|
||||
$text .= "<input type='hidden' name='news_author' value='".$auth.chr(35).$row['user_name']."' />";
|
||||
$text .= "<a href='".$e107->url->create('user/profile/view', 'name='.$row['user_name'].'&id='.$_POST['news_author'])."'>".$row['user_name']."</a>";
|
||||
}
|
||||
@ -3922,7 +3922,7 @@ class admin_newspost
|
||||
$canDelete = isset($_POST['newsdeletecomments']);
|
||||
if ($result = e107::getDb()->db_Select_gen($qry))
|
||||
{
|
||||
while ($row = e107::getDb()->fetch(MYSQL_ASSOC))
|
||||
while ($row = e107::getDb()->fetch())
|
||||
{
|
||||
if ($canDelete && ($row['news_allow_comments'] != 0) && ($row['c_count'] > 0)) // N.B. sense of 'news_allow_comments' is 0 = allow!!!
|
||||
{ // Delete comments
|
||||
|
@ -1211,7 +1211,7 @@ function update_706_to_800($type='')
|
||||
require_once(e_HANDLER.'mail_manager_class.php');
|
||||
$mailHandler = new e107MailManager;
|
||||
$i = 0;
|
||||
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$mailRecord = array(
|
||||
'mail_create_date' => $row['gen_datestamp'],
|
||||
|
@ -608,7 +608,7 @@ if(e_AJAX_REQUEST)
|
||||
}
|
||||
elseif($sql->db_Select('userclass_classes', '*', "userclass_id='".$class_num."' "))
|
||||
{
|
||||
$row = $sql->db_Fetch(MYSQL_ASSOC);
|
||||
$row = $sql->db_Fetch();
|
||||
|
||||
//Response action - reset all group checkboxes
|
||||
$jshelper->addResponseAction('reset-checked', array('group_classes_select' => '0'));
|
||||
@ -702,7 +702,7 @@ if (isset($_POST['etrigger_delete']) && !empty($_POST['etrigger_delete']))
|
||||
userclass2_adminlog("02","ID:{$class_id} (".$e_userclass->uc_get_classname($classID).")");
|
||||
if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$classID}' OR user_class REGEXP('^{$classID},') OR user_class REGEXP(',{$classID},') OR user_class REGEXP(',{$classID}$')"))
|
||||
{ // Delete existing users from class
|
||||
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->db_Fetch())
|
||||
{
|
||||
$uidList[$row['user_id']] = $row['user_class'];
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ SC_BEGIN DOWNLOAD_CATEGORY_SELECT
|
||||
|
||||
// Its a structured display option - need a 2-step process to create a tree
|
||||
$catlist = array();
|
||||
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->db_Fetch())
|
||||
{
|
||||
$tmp = $row['download_category_parent'];
|
||||
if ($tmp == '0')
|
||||
|
@ -40,7 +40,7 @@ class core_user_url extends eUrlConfig
|
||||
* - login/index (or just 'login') -> login.php
|
||||
* - register/index (or just 'register') -> signup.php
|
||||
*/
|
||||
public function create($route, $params = array())
|
||||
public function create($route, $params = array(), $options = array())
|
||||
{
|
||||
if(!$params) return 'user.php';
|
||||
|
||||
@ -115,8 +115,8 @@ class core_user_url extends eUrlConfig
|
||||
|
||||
return $admin;
|
||||
}
|
||||
|
||||
public function parse($pathInfo)
|
||||
|
||||
public function parse($pathInfo, $params = array(), $request = NULL, $router = NULL, $config = array())
|
||||
{
|
||||
// this config doesn't support parsing, it's done by the module entry script (news.php)
|
||||
// this means News are not available via single entry point if this config is currently active
|
||||
|
@ -513,7 +513,8 @@ City, State, Country
|
||||
<field name="media_cat_owner">_common</field>
|
||||
<field name="media_cat_category">_common_image</field>
|
||||
<field name="media_cat_title">(Common Images)</field>
|
||||
<field name="media_cat_diz">Media in this category will be available in all areas of admin. </field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz">Media in this category will be available in all areas of admin.</field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
<field name="media_cat_order">0</field>
|
||||
@ -523,7 +524,8 @@ City, State, Country
|
||||
<field name="media_cat_owner">_common</field>
|
||||
<field name="media_cat_category">_common_file</field>
|
||||
<field name="media_cat_title">(Common Files)</field>
|
||||
<field name="media_cat_diz">Media in this category will be available in all areas of admin. </field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz">Media in this category will be available in all areas of admin.</field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
<field name="media_cat_order">0</field>
|
||||
@ -533,7 +535,8 @@ City, State, Country
|
||||
<field name="media_cat_owner">news</field>
|
||||
<field name="media_cat_category">news</field>
|
||||
<field name="media_cat_title">News</field>
|
||||
<field name="media_cat_diz">Will be available in the news area. </field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz">Will be available in the news area.</field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
<field name="media_cat_order">1</field>
|
||||
@ -543,7 +546,8 @@ City, State, Country
|
||||
<field name="media_cat_owner">page</field>
|
||||
<field name="media_cat_category">page</field>
|
||||
<field name="media_cat_title">Custom Pages</field>
|
||||
<field name="media_cat_diz">Will be available in the custom pages area of admin. </field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz">Will be available in the custom pages area of admin.</field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
<field name="media_cat_order">0</field>
|
||||
@ -553,6 +557,7 @@ City, State, Country
|
||||
<field name="media_cat_owner">download</field>
|
||||
<field name="media_cat_category">download_image</field>
|
||||
<field name="media_cat_title">Download Images</field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz"></field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
@ -563,6 +568,7 @@ City, State, Country
|
||||
<field name="media_cat_owner">download</field>
|
||||
<field name="media_cat_category">download_thumb</field>
|
||||
<field name="media_cat_title">Download Thumbnails</field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz"></field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
@ -573,6 +579,7 @@ City, State, Country
|
||||
<field name="media_cat_owner">download</field>
|
||||
<field name="media_cat_category">download_file</field>
|
||||
<field name="media_cat_title">Download Files</field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz"></field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
@ -583,7 +590,8 @@ City, State, Country
|
||||
<field name="media_cat_owner">news</field>
|
||||
<field name="media_cat_category">news_thumb</field>
|
||||
<field name="media_cat_title">News Thumbnails (Legacy)</field>
|
||||
<field name="media_cat_diz">Legacy news thumbnails. </field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz">Legacy news thumbnails.</field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
<field name="media_cat_order">1</field>
|
||||
@ -593,7 +601,8 @@ City, State, Country
|
||||
<field name="media_cat_owner">_icon</field>
|
||||
<field name="media_cat_category">_icon_16</field>
|
||||
<field name="media_cat_title">Icons 16px</field>
|
||||
<field name="media_cat_diz">Available where icons are used in admin. </field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz">Available where icons are used in admin.</field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
<field name="media_cat_order">0</field>
|
||||
@ -603,7 +612,8 @@ City, State, Country
|
||||
<field name="media_cat_owner">_icon</field>
|
||||
<field name="media_cat_category">_icon_32</field>
|
||||
<field name="media_cat_title">Icons 32px</field>
|
||||
<field name="media_cat_diz">Available where icons are used in admin. </field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz">Available where icons are used in admin.</field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
<field name="media_cat_order">0</field>
|
||||
@ -613,7 +623,8 @@ City, State, Country
|
||||
<field name="media_cat_owner">_icon</field>
|
||||
<field name="media_cat_category">_icon_48</field>
|
||||
<field name="media_cat_title">Icons 48px</field>
|
||||
<field name="media_cat_diz">Available where icons are used in admin. </field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz">Available where icons are used in admin.</field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
<field name="media_cat_order">0</field>
|
||||
@ -623,7 +634,8 @@ City, State, Country
|
||||
<field name="media_cat_owner">_icon</field>
|
||||
<field name="media_cat_category">_icon_64</field>
|
||||
<field name="media_cat_title">Icons 64px</field>
|
||||
<field name="media_cat_diz">Available where icons are used in admin. </field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz">Available where icons are used in admin.</field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
<field name="media_cat_order">0</field>
|
||||
@ -1080,6 +1092,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">0</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">253</field>
|
||||
@ -1091,6 +1104,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">253</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">246</field>
|
||||
@ -1102,6 +1116,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">254</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">254</field>
|
||||
@ -1113,6 +1128,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">253</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">248</field>
|
||||
@ -1124,6 +1140,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">253</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">249</field>
|
||||
@ -1135,6 +1152,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">253</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">1</field>
|
||||
@ -1146,6 +1164,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">0</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">247</field>
|
||||
@ -1157,6 +1176,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">254</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">250</field>
|
||||
@ -1168,6 +1188,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">253</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">0</field>
|
||||
@ -1179,6 +1200,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">0</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">252</field>
|
||||
@ -1190,6 +1212,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">0</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">255</field>
|
||||
@ -1201,6 +1224,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">0</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="userclass_id">251</field>
|
||||
@ -1212,6 +1236,7 @@ City, State, Country
|
||||
<field name="userclass_visibility">0</field>
|
||||
<field name="userclass_type">0</field>
|
||||
<field name="userclass_icon"></field>
|
||||
<field name="userclass_perms"></field>
|
||||
</item>
|
||||
</dbTable>
|
||||
</database>
|
||||
|
@ -281,7 +281,7 @@ class e_admin_log
|
||||
}
|
||||
|
||||
|
||||
$explain = mysql_real_escape_string($tp->toDB($explain, true, false, 'no_html'));
|
||||
$explain = e107::getDb()->escape($tp->toDB($explain, true, false, 'no_html'));
|
||||
$event_title = $tp->toDB($event_title, true, false, 'no_html');
|
||||
|
||||
//---------------------------------------
|
||||
|
@ -171,7 +171,7 @@ class e107_db_debug {
|
||||
$t['caller'] = "$sCallingFile($sCallingLine)";
|
||||
$t['query'] = $query;
|
||||
$t['ok'] = $sQryRes ? TRUE : FALSE;
|
||||
$t['error'] = $sQryRes ? '' : mysql_error();
|
||||
$t['error'] = $sQryRes ? '' : $sql->getLastErrorText(); // mysql_error();
|
||||
$t['nFields'] = $nFields;
|
||||
$t['time'] = $mytime;
|
||||
|
||||
|
@ -50,7 +50,7 @@ class db_table_admin
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
$row = $sql->db_Fetch(MYSQL_NUM);
|
||||
$row = $sql->db_Fetch('num');
|
||||
$tmp = str_replace("`", "", stripslashes($row[1])).';'; // Add semicolon to work with our parser
|
||||
$count = preg_match_all("#CREATE\s+?TABLE\s+?`{0,1}({$prefix}{$table_name})`{0,1}\s+?\((.*?)\)\s+?(?:TYPE|ENGINE)\s*\=\s*(.*?);#is", $tmp, $matches, PREG_SET_ORDER);
|
||||
if ($count === FALSE)
|
||||
|
@ -919,7 +919,7 @@ class db_verify
|
||||
if($z)
|
||||
{
|
||||
// $row = mysql_fetch_row($z);
|
||||
$row = $sql->fetch(MYSQL_NUM);
|
||||
$row = $sql->fetch('num');
|
||||
//return $row[1];
|
||||
return stripslashes($row[1]).';'; // backticks needed.
|
||||
// return str_replace("`", "", stripslashes($row[1])).';';
|
||||
|
@ -122,7 +122,7 @@ class e107_debug {
|
||||
// removed: inline debug breaks pages!
|
||||
);
|
||||
|
||||
function e107_debug()
|
||||
function __construct()
|
||||
{
|
||||
if (preg_match('/debug(=?)(.*?),?(\+|stick|-|unstick|$)/', e_MENU, $debug_param) || isset($_COOKIE['e107_debug_level']))
|
||||
{
|
||||
|
@ -4407,7 +4407,7 @@ class e_emotefilter {
|
||||
var $replace;
|
||||
var $emotes;
|
||||
|
||||
function e_emotefilter() /* constructor */
|
||||
function __construct() /* constructor */
|
||||
{
|
||||
$pref = e107::getPref();
|
||||
|
||||
@ -4495,7 +4495,7 @@ class e_profanityFilter
|
||||
{
|
||||
var $profanityList;
|
||||
|
||||
function e_profanityFilter()
|
||||
function __construct()
|
||||
{
|
||||
global $pref;
|
||||
|
||||
|
@ -972,7 +972,7 @@ class eIPHandler
|
||||
// See if address already in the banlist
|
||||
if ($sql->select('banlist', '`banlist_bantype`', "`banlist_ip`='{$ban_ip}'"))
|
||||
{
|
||||
list($banType) = $sql->fetch(MYSQL_ASSOC);
|
||||
list($banType) = $sql->fetch();
|
||||
|
||||
if ($banType >= eIPHandler::BAN_TYPE_WHITELIST)
|
||||
{ // Got a whitelist entry for this
|
||||
@ -1134,7 +1134,7 @@ class eIPHandler
|
||||
$gotIP = FALSE;
|
||||
$gotBrowser = FALSE;
|
||||
$bestRow = FALSE;
|
||||
while (FALSE !== ($row = $ourDB->fetch(MYSQL_ASSOC)))
|
||||
while (FALSE !== ($row = $ourDB->fetch()))
|
||||
{
|
||||
if ($row['user_token'] == $browser)
|
||||
{
|
||||
@ -1273,7 +1273,7 @@ class banlistManager
|
||||
|
||||
if ($sql->db_Select_gen($qry))
|
||||
{
|
||||
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->db_Fetch())
|
||||
{
|
||||
$row['banlist_ip'] = $this->trimWildcard($row['banlist_ip']);
|
||||
if ($row['banlist_ip'] == '') continue; // Ignore empty IP addresses
|
||||
|
@ -138,7 +138,7 @@ class e_jshelper
|
||||
foreach ($field_array as $field => $value)
|
||||
{
|
||||
//associative arrays only - no numeric keys!
|
||||
//to speed this up use $sql->db_Fetch(MYSQL_ASSOC);
|
||||
//to speed this up use $sql->db_Fetch();
|
||||
//when passing large data from the DB
|
||||
if (is_numeric($field) || empty($field)) continue;
|
||||
|
||||
|
@ -357,7 +357,7 @@ class userlogin
|
||||
}
|
||||
|
||||
// User is in DB here
|
||||
$this->userData = e107::getDb()->fetch(MYSQL_ASSOC); // Get user info
|
||||
$this->userData = e107::getDb()->fetch(); // Get user info
|
||||
$this->userData['user_perms'] = trim($this->userData['user_perms']);
|
||||
$this->lookEmail = $this->lookEmail && ($username == $this->userData['user_email']); // Know whether login name or email address used now
|
||||
|
||||
|
@ -623,7 +623,7 @@ class e107MailManager
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ($result = $this->db->fetch(MYSQL_ASSOC))
|
||||
if ($result = $this->db->fetch())
|
||||
{
|
||||
$this->queryActive--;
|
||||
return $this->dbToBoth($result);
|
||||
@ -1444,7 +1444,7 @@ class e107MailManager
|
||||
$errors[] = 'Not found in DB: '.$vals[1].'/'.$vals[2];
|
||||
}
|
||||
|
||||
$row = $this->db->fetch(MYSQL_ASSOC);
|
||||
$row = $this->db->fetch();
|
||||
|
||||
$row = $this->dbToBoth($row);
|
||||
|
||||
@ -1715,7 +1715,7 @@ class e107MailManager
|
||||
*/
|
||||
public function getNextTargetStatus()
|
||||
{
|
||||
$result = $this->db2->db_Fetch(MYSQL_ASSOC);
|
||||
$result = $this->db2->db_Fetch();
|
||||
if (is_array($result)) { return $this->dbToTarget($result); }
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ class mailoutAdminClass extends e107MailManager
|
||||
// Make sure DB object created
|
||||
if($this->db2->select('user', 'user_name, user_loginname', 'user_id=' . intval($uid)))
|
||||
{
|
||||
$row = $this->db2->fetch(MYSQL_ASSOC);
|
||||
$row = $this->db2->fetch();
|
||||
$this->userCache[$uid] = $row['user_name'] . ' (' . $row['user_loginname'] . ')';
|
||||
}
|
||||
else
|
||||
@ -1907,7 +1907,7 @@ class mailoutAdminClass extends e107MailManager
|
||||
{
|
||||
$items = array();
|
||||
// Store record number of any content record that needs to be changed
|
||||
while($row = $this->db2->fetch(MYSQL_ASSOC))
|
||||
while($row = $this->db2->fetch())
|
||||
{
|
||||
$items[] = $row['mail_source_id'];
|
||||
if($row['mail_source_id'])
|
||||
@ -1952,7 +1952,7 @@ class mailoutAdminClass extends e107MailManager
|
||||
// This forces one more loop, so we can clean up for last record read
|
||||
$changeCount = 0;
|
||||
$saveRow = array();
|
||||
while(($row = $this->db2->fetch(MYSQL_ASSOC)) || $notLast)
|
||||
while(($row = $this->db2->fetch()) || $notLast)
|
||||
{
|
||||
if(($lastMail > 0 && $row === FALSE) || ($lastMail != $row['mail_source_id']))
|
||||
{
|
||||
|
@ -237,7 +237,7 @@ class core_mailout
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
|
||||
if (!($row = $sql->db_Fetch(MYSQL_ASSOC))) return FALSE;
|
||||
if (!($row = $sql->db_Fetch())) return FALSE;
|
||||
$ret = array('mail_recipient_id' => $row['user_id'],
|
||||
'mail_recipient_name' => $row['user_name'], // Should this use realname?
|
||||
'mail_recipient_email' => $row['user_email'],
|
||||
|
@ -360,7 +360,7 @@ class e_media
|
||||
$qry .= "ORDER BY media_cat_order";
|
||||
|
||||
e107::getDb()->gen($qry);
|
||||
while($row = e107::getDb()->fetch(MYSQL_ASSOC))
|
||||
while($row = e107::getDb()->fetch())
|
||||
{
|
||||
$id = $row['media_cat_category'];
|
||||
$ret[$id] = $row;
|
||||
@ -494,7 +494,7 @@ class e_media
|
||||
$query .= " LIMIT ".$from." ,".$amount;
|
||||
}
|
||||
e107::getDb()->gen($query);
|
||||
while($row = e107::getDb()->fetch(MYSQL_ASSOC))
|
||||
while($row = e107::getDb()->fetch())
|
||||
{
|
||||
$id = $row['media_id'];
|
||||
$ret[$id] = $row;
|
||||
|
@ -493,7 +493,7 @@ class e_menuManager {
|
||||
$location_count--;
|
||||
}
|
||||
$sql->select("menus", "*", "menu_path NOT REGEXP('[0-9]+') ");
|
||||
while (list($menu_id, $menu_name, $menu_location, $menu_order) = $sql->fetch(MYSQL_NUM))
|
||||
while (list($menu_id, $menu_name, $menu_location, $menu_order) = $sql->fetch('num'))
|
||||
{
|
||||
if (stristr($menustr, $menu_name) === FALSE)
|
||||
{
|
||||
@ -1433,7 +1433,7 @@ class e_menuManager {
|
||||
$cl = ($this->dragDrop) ? "'portlet" : "regularMenu";
|
||||
|
||||
$menuText .= "\n<div class='column' id='area-".$menu."'>\n\n";
|
||||
while($row = $sql9->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql9->fetch())
|
||||
{
|
||||
$menuText .= "\n\n\n <!-- Menu Start ".$row['menu_name']. "-->\n";
|
||||
$menuText .= "<div class='{$cl}' id='block-".$row['menu_id']."-".$menu."'>\n";
|
||||
|
@ -63,6 +63,8 @@ $db_mySQLQueryCount = 0; // Global total number of db object queries (all db's)
|
||||
$db_ConnectionID = NULL; // Stores ID for the first DB connection used - which should be the main E107 DB - then used as default
|
||||
|
||||
|
||||
|
||||
|
||||
class e_db_mysql
|
||||
{
|
||||
// TODO switch to protected vars where needed
|
||||
@ -105,7 +107,8 @@ class e_db_mysql
|
||||
{
|
||||
|
||||
global $pref, $db_defaultPrefix;
|
||||
|
||||
|
||||
|
||||
if(defined('e_PDO') && e_PDO === true)
|
||||
{
|
||||
$this->pdo = true;
|
||||
@ -1142,6 +1145,7 @@ class e_db_mysql
|
||||
|
||||
|
||||
/**
|
||||
* @param string $type assoc|num|both
|
||||
* @return array MySQL row
|
||||
* @desc Fetch an array containing row data (see PHP's mysql_fetch_array() docs)<br />
|
||||
* @example
|
||||
@ -1152,31 +1156,57 @@ class e_db_mysql
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function fetch($type = MYSQL_ASSOC)
|
||||
function fetch($type = 'assoc')
|
||||
{
|
||||
if (!(is_int($type)))
|
||||
if (!is_int($type))
|
||||
{
|
||||
$type=MYSQL_ASSOC;
|
||||
// $type='assoc';
|
||||
}
|
||||
|
||||
if($this->pdo) // convert type to PDO.
|
||||
|
||||
if(defined('MYSQL_ASSOC'))
|
||||
{
|
||||
switch ($type)
|
||||
switch ($type)
|
||||
{
|
||||
case MYSQL_BOTH: // 3
|
||||
$type = PDO::FETCH_BOTH;
|
||||
break;
|
||||
|
||||
case MYSQL_NUM: // 2
|
||||
$type = PDO::FETCH_NUM;
|
||||
break;
|
||||
|
||||
case MYSQL_ASSOC: // 1
|
||||
default:
|
||||
$type = PDO::FETCH_ASSOC;
|
||||
break;
|
||||
case 'both':
|
||||
case MYSQL_BOTH:
|
||||
$type = MYSQL_BOTH; // 3
|
||||
break;
|
||||
|
||||
case 'num':
|
||||
case MYSQL_NUM: // 2
|
||||
$type = MYSQL_NUM;
|
||||
break;
|
||||
|
||||
case 'assoc':
|
||||
case MYSQL_ASSOC: // 1
|
||||
default:
|
||||
$type = MYSQL_ASSOC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if($this->pdo) // convert type to PDO.
|
||||
{
|
||||
switch ($type)
|
||||
{
|
||||
case 'both': // 3
|
||||
$type = PDO::FETCH_BOTH;
|
||||
break;
|
||||
|
||||
case 'num': // 2
|
||||
$type = PDO::FETCH_NUM;
|
||||
break;
|
||||
|
||||
case 'assoc': // 1
|
||||
default:
|
||||
$type = PDO::FETCH_ASSOC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$b = microtime();
|
||||
if($this->mySQLresult)
|
||||
@ -1197,7 +1227,7 @@ class e_db_mysql
|
||||
* fetch() alias
|
||||
* @deprecated
|
||||
*/
|
||||
function db_Fetch($type = MYSQL_ASSOC)
|
||||
function db_Fetch($type = null)
|
||||
{
|
||||
return $this->fetch($type);
|
||||
}
|
||||
@ -1862,12 +1892,7 @@ class e_db_mysql
|
||||
*/
|
||||
function escape($data, $strip = true)
|
||||
{
|
||||
|
||||
if($this->pdo)
|
||||
{
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
if ($strip)
|
||||
{
|
||||
$data = strip_if_magic($data);
|
||||
@ -1879,7 +1904,11 @@ class e_db_mysql
|
||||
$this->mySQLaccess = $db_ConnectionID;
|
||||
}
|
||||
|
||||
|
||||
if($this->pdo)
|
||||
{
|
||||
return $data;
|
||||
// return $this->mySQLaccess->quote($data);
|
||||
}
|
||||
|
||||
return mysql_real_escape_string($data,$this->mySQLaccess);
|
||||
}
|
||||
@ -1983,7 +2012,7 @@ class e_db_mysql
|
||||
$table = array();
|
||||
if($res = $this->db_Query("SHOW TABLES LIKE '".$this->mySQLPrefix."lan_".strtolower($language)."%' "))
|
||||
{
|
||||
while($rows = $this->fetch(MYSQL_NUM))
|
||||
while($rows = $this->fetch('num'))
|
||||
{
|
||||
$table[] = str_replace($this->mySQLPrefix,"",$rows[0]);
|
||||
}
|
||||
@ -2004,7 +2033,7 @@ class e_db_mysql
|
||||
if($res = $this->db_Query("SHOW TABLES LIKE '".$this->mySQLPrefix."%' "))
|
||||
{
|
||||
$length = strlen($this->mySQLPrefix);
|
||||
while($rows = $this->fetch(MYSQL_NUM))
|
||||
while($rows = $this->fetch('num'))
|
||||
{
|
||||
$table[] = substr($rows[0],$length);
|
||||
}
|
||||
@ -2137,7 +2166,7 @@ class e_db_mysql
|
||||
$qry = "SHOW CREATE TABLE {$old}";
|
||||
if ($this->gen($qry))
|
||||
{
|
||||
$row = $this->fetch(MYSQL_NUM);
|
||||
$row = $this->fetch('num');
|
||||
$qry = $row[1];
|
||||
// $qry = str_replace($old, $new, $qry);
|
||||
$qry = preg_replace("#CREATE\sTABLE\s`{0,1}".$old."`{0,1}\s#", "CREATE TABLE `{$new}` ", $qry, 1); // More selective search
|
||||
|
@ -179,7 +179,7 @@ class notify
|
||||
if (false !== ($count = $sql->gen($qry)))
|
||||
{
|
||||
// Now add email addresses to the list
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
if ($row['user_email'] != $emailFilter)
|
||||
{
|
||||
|
@ -22,146 +22,10 @@ if (!defined('e107_INIT'))
|
||||
*
|
||||
* @package e107
|
||||
* @subpackage e107_handlers
|
||||
* @version $Id$
|
||||
* @copyright Copyright (C) 2008-2010 e107 Inc (e107.org)
|
||||
* @copyright Copyright (C) 2008-2016 e107 Inc (e107.org)
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
// file_put_contents - introduced in PHP5
|
||||
if (!function_exists('file_put_contents'))
|
||||
{
|
||||
/**
|
||||
* @return int
|
||||
* @param string $filename
|
||||
* @param mixed $data
|
||||
* @desc Write a string to a file
|
||||
* /
|
||||
define('FILE_APPEND', 1);
|
||||
function file_put_contents($filename, $data, $flag = false)
|
||||
{
|
||||
$mode = ($flag == FILE_APPEND || strtoupper($flag) == 'FILE_APPEND') ? 'a' : 'w';
|
||||
if (($h = @fopen($filename, $mode)) === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (is_array($data))
|
||||
$data = implode($data);
|
||||
if (($bytes = @fwrite($h, $data)) === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
fclose($h);
|
||||
return $bytes;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
// stripos - introduced in PHP5
|
||||
if (!function_exists('stripos'))
|
||||
{
|
||||
function stripos($str, $needle, $offset = 0)
|
||||
{
|
||||
return strpos(strtolower($str), strtolower($needle), $offset);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
// simplexml_load_string - introduced in PHP5
|
||||
if (!function_exists('simplexml_load_string'))
|
||||
{
|
||||
|
||||
//CXml class code found on php.net
|
||||
class CXml
|
||||
{
|
||||
var $xml_data;
|
||||
var $obj_data;
|
||||
var $pointer;
|
||||
|
||||
function CXml()
|
||||
{
|
||||
}
|
||||
|
||||
function Set_xml_data(&$xml_data)
|
||||
{
|
||||
$this->index = 0;
|
||||
$this->pointer[] = &$this->obj_data;
|
||||
|
||||
//strip white space between tags
|
||||
$this->xml_data = preg_replace("/>[[:space:]]+</i", "><", $xml_data);
|
||||
$this->xml_parser = xml_parser_create("UTF-8");
|
||||
|
||||
xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, false);
|
||||
xml_set_object($this->xml_parser, $this);
|
||||
xml_set_element_handler($this->xml_parser, "_startElement", "_endElement");
|
||||
xml_set_character_data_handler($this->xml_parser, "_cData");
|
||||
|
||||
xml_parse($this->xml_parser, $this->xml_data, true);
|
||||
xml_parser_free($this->xml_parser);
|
||||
}
|
||||
|
||||
function _startElement($parser, $tag, $attributeList)
|
||||
{
|
||||
$attributes = '@attributes';
|
||||
foreach ($attributeList as $name=>$value)
|
||||
{
|
||||
$value = $this->_cleanString($value);
|
||||
$object-> {$attributes} [$name] = $value;
|
||||
// $object->$name = $value;
|
||||
}
|
||||
//replaces the special characters with the underscore (_) in tag name
|
||||
$tag = preg_replace("/[:\-\. ]/", "_", $tag);
|
||||
eval("\$this->pointer[\$this->index]->".$tag."[] = \$object;");
|
||||
eval("\$size = sizeof( \$this->pointer[\$this->index]->".$tag." );");
|
||||
eval("\$this->pointer[] = &\$this->pointer[\$this->index]->".$tag."[\$size-1];");
|
||||
|
||||
$this->index++;
|
||||
}
|
||||
|
||||
function _endElement($parser, $tag)
|
||||
{
|
||||
array_pop($this->pointer);
|
||||
$this->index--;
|
||||
}
|
||||
|
||||
function _cData($parser, $data)
|
||||
{
|
||||
if ( empty($this->pointer[$this->index]))
|
||||
{
|
||||
if (rtrim($data, "\n"))
|
||||
{
|
||||
$this->pointer[$this->index] = $data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->pointer[$this->index] .= $data;
|
||||
}
|
||||
}
|
||||
|
||||
function _cleanString($string)
|
||||
{
|
||||
return utf8_decode(trim($string));
|
||||
}
|
||||
}
|
||||
|
||||
function simplexml_load_string($xml)
|
||||
{
|
||||
$xmlClass = new CXml;
|
||||
$xmlClass->Set_xml_data($xml);
|
||||
$data = (array) $xmlClass->obj_data;
|
||||
$tmp = array_keys($data);
|
||||
$data = $data[$tmp[0]][0];
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
if (!function_exists('strptime'))
|
||||
|
@ -199,7 +199,7 @@ class e107plugin
|
||||
|
||||
if ($sql->select("plugin", "plugin_id", "plugin_path = '".(string) $path."' LIMIT 1"))
|
||||
{
|
||||
$row = $sql->fetch(MYSQL_ASSOC);
|
||||
$row = $sql->fetch();
|
||||
return intval($row['plugin_id']);
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ class e107plugin
|
||||
if ($sql->select('plugin', "*")) // Read all the plugin DB info into an array to save lots of accesses
|
||||
|
||||
{
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$pluginDBList[$row['plugin_path']] = $row;
|
||||
$pluginDBList[$row['plugin_path']]['status'] = 'read';
|
||||
|
@ -1671,7 +1671,7 @@ class themeHandler
|
||||
// echo $plug;
|
||||
if($sql->db_Select("plugin", "plugin_id", " plugin_path = '".$plug."' LIMIT 1 "))
|
||||
{
|
||||
$row = $sql->db_Fetch(MYSQL_ASSOC);
|
||||
$row = $sql->db_Fetch();
|
||||
$name = "installplugin[".$row['plugin_id']."]";
|
||||
$text .= $this->frm->admin_button($name, ADLAN_121." ".$plug."", 'delete');
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ class e107_user_extended
|
||||
|
||||
if($sql->select('user_extended_struct', '*', "user_extended_struct_text != '_system_' ORDER BY user_extended_struct_order ASC"))
|
||||
{
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
if ($row['user_extended_struct_type'] == 0)
|
||||
{ // Its a category
|
||||
@ -379,7 +379,7 @@ class e107_user_extended
|
||||
$more = ($cat) ? " AND user_extended_struct_parent = ".intval($cat)." " : "";
|
||||
if($sql->select("user_extended_struct", "*", "user_extended_struct_type > 0 AND user_extended_struct_text != '_system_' {$more} ORDER BY user_extended_struct_order ASC"))
|
||||
{
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$ret[$row['user_extended_struct_parent']][] = $row;
|
||||
}
|
||||
@ -417,7 +417,7 @@ class e107_user_extended
|
||||
|
||||
if($sql->select("user_extended_struct", "*", "user_extended_struct_type > 0 {$sys} {$more} ORDER BY user_extended_struct_order ASC"))
|
||||
{
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$ret[$row[$indexField]] = $row;
|
||||
}
|
||||
@ -438,7 +438,7 @@ class e107_user_extended
|
||||
|
||||
if($sql->select("user_extended_struct", "*", "user_extended_struct_type > 0 ORDER BY user_extended_struct_order ASC"))
|
||||
{
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$ret[] = 'user_'.$row['user_extended_struct_name'];
|
||||
}
|
||||
|
@ -865,7 +865,7 @@ Following fields auto-filled in code as required:
|
||||
}
|
||||
else
|
||||
{
|
||||
$row = $db->db_Fetch(MYSQL_ASSOC);
|
||||
$row = $db->db_Fetch();
|
||||
if ($uid && ($uid != $row['user_id']))
|
||||
{
|
||||
$error = 'UID mismatch: '.$uid.'/'.$row['user_id'];
|
||||
|
@ -148,7 +148,7 @@ class user_class
|
||||
{
|
||||
if($this->sql_r->field('userclass_classes','userclass_parent') && $this->sql_r->select('userclass_classes', '*', 'ORDER BY userclass_parent', 'nowhere')) // The order statement should give a consistent return
|
||||
{
|
||||
while ($row = $this->sql_r->fetch(MYSQL_ASSOC))
|
||||
while ($row = $this->sql_r->fetch())
|
||||
{
|
||||
$this->class_tree[$row['userclass_id']] = $row;
|
||||
$this->class_tree[$row['userclass_id']]['class_children'] = array(); // Create the child array in case needed
|
||||
@ -1081,7 +1081,7 @@ class user_class
|
||||
$qry = "SELECT user_id,{$fieldList} FROM `#user` WHERE user_class REGEXP '{$class_regex}' ORDER BY '{$orderBy}'";
|
||||
if ($this->sql_r->db_Select_gen($qry))
|
||||
{
|
||||
while ($row = $this->sql_r->db_Fetch(MYSQL_ASSOC))
|
||||
while ($row = $this->sql_r->db_Fetch())
|
||||
{
|
||||
$ret[$row['user_id']] = $row;
|
||||
}
|
||||
|
@ -1175,6 +1175,7 @@ class xmlClass
|
||||
$fieldval = (isset($f['@value'])) ? $f['@value'] : "";
|
||||
|
||||
$insert_array[$fieldkey] = $fieldval;
|
||||
|
||||
}
|
||||
if(($mode == "replace") && $sql->replace($table, $insert_array)!==FALSE)
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ class alt_login
|
||||
}
|
||||
if($aa_sql -> db_Select_gen($qry))
|
||||
{ // Existing user - get current data, see if any changes
|
||||
$row = $aa_sql->db_Fetch(MYSQL_ASSOC);
|
||||
$row = $aa_sql->db_Fetch();
|
||||
foreach ($db_vals as $k => $v)
|
||||
{
|
||||
if ($row[$k] == $v) unset($db_vals[$k]);
|
||||
|
@ -922,7 +922,7 @@ class download
|
||||
<option value=''>{$blankText}</option>\n";
|
||||
// Its a structured display option - need a 2-step process to create a tree
|
||||
$catlist = array();
|
||||
while ($dlrow = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($dlrow = $sql->fetch())
|
||||
{
|
||||
$tmp = $dlrow['download_category_parent'];
|
||||
if ($tmp == '0')
|
||||
|
@ -693,7 +693,7 @@ function forum_track()
|
||||
$data = array();
|
||||
if($sql->gen($qry))
|
||||
{
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl');
|
||||
|
||||
|
@ -2007,7 +2007,7 @@ class forumAdmin
|
||||
<th colspan='2'>".LAN_FORUM_1001."</th>
|
||||
<th>".LAN_OPTIONS."</th>
|
||||
</tr>";
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$parentList[] = $row;
|
||||
}
|
||||
@ -2049,7 +2049,7 @@ class forumAdmin
|
||||
else
|
||||
{
|
||||
$forumList = array();
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$forumList[] = $row;
|
||||
}
|
||||
@ -2123,7 +2123,7 @@ class forumAdmin
|
||||
{
|
||||
if ($sql->select('forum', '*', "forum_id=$id"))
|
||||
{
|
||||
$row = $sql->fetch(MYSQL_ASSOC);
|
||||
$row = $sql->fetch();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2188,7 +2188,7 @@ class forumAdmin
|
||||
{
|
||||
if ($sql->select('forum', '*', "forum_id=$id"))
|
||||
{
|
||||
$fInfo = $sql->fetch(MYSQL_ASSOC);
|
||||
$fInfo = $sql->fetch();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2215,7 +2215,7 @@ class forumAdmin
|
||||
|
||||
$sql->select('forum', '*', 'forum_parent=0');
|
||||
$text .= "<select name='forum_parent' class='tbox'>\n";
|
||||
while (list($fid, $fname) = $sql->fetch(MYSQL_NUM))
|
||||
while (list($fid, $fname) = $sql->fetch('num'))
|
||||
{
|
||||
$sel = ($fid == vartrue($fInfo['forum_parent']) ? "selected='selected'" : '');
|
||||
$text .= "<option value='{$fid}' {$sel}>{$fname}</option>\n";
|
||||
|
@ -867,7 +867,7 @@ class e107forum
|
||||
}
|
||||
if($sql->gen($qry))
|
||||
{
|
||||
$tmp = $sql->fetch(MYSQL_ASSOC);
|
||||
$tmp = $sql->fetch();
|
||||
if($tmp)
|
||||
{
|
||||
if(trim($tmp['thread_options']) != '')
|
||||
@ -923,7 +923,7 @@ class e107forum
|
||||
if($sql->gen($qry))
|
||||
{
|
||||
$ret = array();
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl');
|
||||
$ret[] = $row;
|
||||
@ -983,7 +983,7 @@ class e107forum
|
||||
if($sql->gen($qry))
|
||||
{
|
||||
$ret = array();
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$ret[$row['post_user']] = $row['post_count'];
|
||||
}
|
||||
@ -1029,7 +1029,7 @@ class e107forum
|
||||
|
||||
$postList = array();
|
||||
|
||||
while($row = $sql->Fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->Fetch())
|
||||
{
|
||||
$postList[] = $row['post_id'];
|
||||
}
|
||||
@ -1049,7 +1049,7 @@ class e107forum
|
||||
return true;
|
||||
}
|
||||
|
||||
$tmp = $sql->fetch(MYSQL_ASSOC);
|
||||
$tmp = $sql->fetch();
|
||||
|
||||
$attachment_array = e107::unserialize($tmp['post_attachments']);
|
||||
$files = $attachment_array['file'];
|
||||
@ -1187,7 +1187,7 @@ class e107forum
|
||||
{
|
||||
if ($sql->select('forum', 'forum_id', 'forum_parent != 0'))
|
||||
{
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$parentList[] = $row['forum_id'];
|
||||
}
|
||||
@ -1207,7 +1207,7 @@ class e107forum
|
||||
{
|
||||
if ($sql2->select('forum_t', 'thread_id', "thread_forum_id = $id AND thread_parent = 0")) // forum_t used in forum_update
|
||||
{
|
||||
while ($row = $sql2->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql2->fetch())
|
||||
{
|
||||
set_time_limit(60);
|
||||
$this->forumUpdateLastpost('thread', $row['thread_id']);
|
||||
@ -1216,7 +1216,7 @@ class e107forum
|
||||
}
|
||||
if ($sql->select('forum_thread', 'thread_id, thread_lastuser, thread_lastuser_anon, thread_datestamp', 'thread_forum_id='.$id.' ORDER BY thread_datestamp DESC LIMIT 1'))
|
||||
{
|
||||
$row = $sql->fetch(MYSQL_ASSOC);
|
||||
$row = $sql->fetch();
|
||||
$lp_info = $row['thread_datestamp'].'.'.$row['thread_id'];
|
||||
$lp_user = $row['thread_lastuser'];
|
||||
}
|
||||
@ -1258,7 +1258,7 @@ class e107forum
|
||||
|
||||
if ($sql->select('forum_thread', 'thread_id', $qry))
|
||||
{
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$newIdList[] = $row['thread_id'];
|
||||
}
|
||||
@ -1294,7 +1294,7 @@ class e107forum
|
||||
{
|
||||
if (e107::getDb()->select('forum', '*', 'forum_parent=0 ORDER BY forum_order ASC'))
|
||||
{
|
||||
while ($row = e107::getDb()->fetch(MYSQL_ASSOC)) {
|
||||
while ($row = e107::getDb()->fetch()) {
|
||||
$ret[] = $row;
|
||||
}
|
||||
return $ret;
|
||||
@ -1314,7 +1314,7 @@ class e107forum
|
||||
if($uclass == e_UC_ADMIN || trim($uclass) == '')
|
||||
{
|
||||
$sql->select('user', 'user_id, user_name','user_admin = 1 ORDER BY user_name ASC');
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$this->modArray[$row['user_id']] = $row['user_name'];
|
||||
}
|
||||
@ -1385,7 +1385,7 @@ class e107forum
|
||||
";
|
||||
if ($sql->gen($qry))
|
||||
{
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
if($type == 'all')
|
||||
{
|
||||
@ -1414,7 +1414,7 @@ class e107forum
|
||||
";
|
||||
if ($sql->gen($qry))
|
||||
{
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
if($forum_id == '')
|
||||
{
|
||||
@ -1462,7 +1462,7 @@ class e107forum
|
||||
WHERE ft.thread_lastpost > '.USERLV.' '.$viewed;
|
||||
if($sql->gen($_newqry))
|
||||
{
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$ret[] = $row['thread_forum_id'];
|
||||
if($row['forum_sub'])
|
||||
@ -1653,7 +1653,7 @@ class e107forum
|
||||
";
|
||||
if ($sql->gen($qry))
|
||||
{
|
||||
return $sql->fetch(MYSQL_ASSOC);
|
||||
return $sql->fetch();
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@ -1706,7 +1706,7 @@ class e107forum
|
||||
$ret = array();
|
||||
if ($sql->gen($qry))
|
||||
{
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
// $row['thread_sef'] = eHelper::title2sef($row['thread_name']);
|
||||
$ret[] = $row;
|
||||
@ -1929,7 +1929,7 @@ class e107forum
|
||||
if($sql->gen($qry))
|
||||
{
|
||||
$ret = array();
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$ret[$row['post_user']] = $row['cnt'];
|
||||
}
|
||||
@ -2110,7 +2110,7 @@ class e107forum
|
||||
if($sql->select('forum_post', 'post_id', 'post_thread = '.$threadId))
|
||||
{
|
||||
$postList = array();
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$postList[] = $row['post_id'];
|
||||
}
|
||||
@ -2165,7 +2165,7 @@ class e107forum
|
||||
}
|
||||
|
||||
|
||||
$row = $sql->fetch(MYSQL_ASSOC);
|
||||
$row = $sql->fetch();
|
||||
|
||||
//delete attachments if they exist
|
||||
if($row['post_attachments'])
|
||||
|
@ -615,7 +615,7 @@ class forumStats
|
||||
<th style='width:25%; text-align:center' class='forumheader'>".LAN_5."</th>
|
||||
</tr>\n";
|
||||
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
if ($row['user_name'])
|
||||
{
|
||||
|
@ -373,7 +373,7 @@ function step4()
|
||||
require_once (e_HANDLER . 'user_extended_class.php');
|
||||
$ue = new e107_user_extended;
|
||||
|
||||
while ($row = $db -> fetch(MYSQL_ASSOC))
|
||||
while ($row = $db -> fetch())
|
||||
{
|
||||
$result['usercount']++;
|
||||
$userId = (int)$row['user_id'];
|
||||
@ -716,7 +716,7 @@ function step8_ajax()
|
||||
|
||||
if ($sql->select('forum', 'forum_id', 'forum_parent != 0 AND forum_id > '.$lastThread.' ORDER BY forum_id LIMIT 2'))
|
||||
{
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$parentList[] = $row['forum_id'];
|
||||
}
|
||||
@ -766,7 +766,7 @@ function step9()
|
||||
";
|
||||
if ($sql -> gen($qry))
|
||||
{
|
||||
while ($row = $sql -> fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql -> fetch())
|
||||
{
|
||||
$threadList[] = $row['thread_id'];
|
||||
}
|
||||
@ -774,7 +774,7 @@ function step9()
|
||||
{
|
||||
if ($sql -> select('forum_thread', 'thread_options', 'thread_id = ' . $threadId, 'default'))
|
||||
{
|
||||
$row = $sql -> fetch(MYSQL_ASSOC);
|
||||
$row = $sql -> fetch();
|
||||
if ($row['thread_options'])
|
||||
{
|
||||
$opts = unserialize($row['thread_options']);
|
||||
@ -880,7 +880,7 @@ function step10_ajax()//TODO
|
||||
|
||||
if ($sql->gen($qry))
|
||||
{
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$postList[] = $row;
|
||||
}
|
||||
@ -1354,7 +1354,7 @@ class forumUpgrade
|
||||
/*
|
||||
if ($sql -> select('generic', '*', "gen_type = 'forumUpgrade'"))
|
||||
{
|
||||
$row = $sql -> fetch(MYSQL_ASSOC);
|
||||
$row = $sql -> fetch();
|
||||
$this -> updateInfo = unserialize($row['gen_chardata']);
|
||||
}
|
||||
else
|
||||
|
@ -94,7 +94,7 @@ class phpbb3_import extends base_import_class
|
||||
|
||||
if($this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}attachments`"))
|
||||
{
|
||||
while($row = $this->ourDB->fetch(MYSQL_ASSOC))
|
||||
while($row = $this->ourDB->fetch())
|
||||
{
|
||||
$id = $row['post_msg_id'];
|
||||
$key = $row['physical_filename'];
|
||||
|
@ -93,7 +93,7 @@ class newsfeedClass
|
||||
|
||||
if ($sql->select("newsfeed", $fieldList, '`newsfeed_active` > 0')) // Read in all the newsfeed info on the first go
|
||||
{
|
||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$nfID = $row['newsfeed_id'];
|
||||
|
||||
|
@ -424,14 +424,14 @@ class newsletter
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
$newsletterInfo = $sql->fetch(MYSQL_ASSOC);
|
||||
$newsletterInfo = $sql->fetch();
|
||||
|
||||
// Get parent details - has header/footer and subscriber list
|
||||
if(!$sql->select('newsletter', '*', "newsletter_id='".$newsletterInfo['newsletter_parent']."' "))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
$newsletterParentInfo = $sql->fetch(MYSQL_ASSOC);
|
||||
$newsletterParentInfo = $sql->fetch();
|
||||
$memberArray = explode(chr(1), $newsletterParentInfo['newsletter_subscribers']);
|
||||
|
||||
require(e_HANDLER.'mail_manager_class.php');
|
||||
@ -478,7 +478,7 @@ class newsletter
|
||||
{
|
||||
if($sql->select('user', 'user_name,user_email,user_loginname,user_lastvisit', 'user_id='.$memberID))
|
||||
{
|
||||
$row = $sql->db_Fetch(MYSQL_ASSOC);
|
||||
$row = $sql->db_Fetch();
|
||||
$uTarget = array('mail_recipient_id' => $memberID,
|
||||
'mail_recipient_name' => $row['user_name'], // Should this use realname?
|
||||
'mail_recipient_email' => $row['user_email'],
|
||||
@ -704,7 +704,7 @@ class newsletter
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$sql ->select('newsletter', '*', 'newsletter_id='.intval($p_id));
|
||||
if($nl_row = $sql->fetch(MYSQL_ASSOC))
|
||||
if($nl_row = $sql->fetch())
|
||||
{
|
||||
$subscribers_list = array_flip(explode(chr(1), $nl_row['newsletter_subscribers']));
|
||||
unset($subscribers_list[$p_key]);
|
||||
|
@ -133,7 +133,7 @@ class pm_cron // include plugin-folder in the name.
|
||||
|
||||
if ($this->ourDB->select('generic', '*', "`gen_type` = 'pm_bulk' LIMIT 1"))
|
||||
{
|
||||
$pmRow = $this->ourDB->fetch(MYSQL_ASSOC);
|
||||
$pmRow = $this->ourDB->fetch();
|
||||
$this->logLine("\r\n\r\n".str_replace('--NUM--',$pmRow['gen_intdata'],LAN_EC_PM_06).date('D j M Y G:i:s'));
|
||||
|
||||
$this->ourDB->delete('generic', "`gen_type` = 'pm_bulk' AND `gen_id` = ".$pmRow['gen_id']);
|
||||
|
@ -403,7 +403,7 @@ class private_message
|
||||
$to = intval($to); // Precautionary
|
||||
if ($sql->select('private_msg_block', 'pm_block_from', 'pm_block_to = '.$to))
|
||||
{
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$ret[] = $row['pm_block_from'];
|
||||
}
|
||||
@ -426,7 +426,7 @@ class private_message
|
||||
$to = intval($to); // Precautionary
|
||||
if ($sql->gen('SELECT pm.*, u.user_name FROM `#private_msg_block` AS pm LEFT JOIN `#user` AS u ON `pm`.`pm_block_from` = `u`.`user_id` WHERE pm_block_to = '.$to))
|
||||
{
|
||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$ret[] = $row;
|
||||
}
|
||||
|
@ -625,7 +625,7 @@ function doMaint($opts, $pmPrefs)
|
||||
if ($res = $db2->gen("SELECT pm.pm_id FROM `#private_msg` AS pm LEFT JOIN `#user` AS u ON pm.`pm_from` = `#user`.`user_id`
|
||||
WHERE (pm.`pm_read_del = 1) AND `#user`.`user_id` IS NULL"))
|
||||
{
|
||||
while ($row = $db2->fetch(MYSQL_ASSOC))
|
||||
while ($row = $db2->fetch())
|
||||
{
|
||||
if ($pmHandler->del($row['pm_id']) !== FALSE)
|
||||
{
|
||||
@ -642,7 +642,7 @@ function doMaint($opts, $pmPrefs)
|
||||
if ($res = $db2->gen("SELECT pm.pm_id FROM `#private_msg` AS pm LEFT JOIN `#user` AS u ON pm.`pm_to` = `#user`.`user_id`
|
||||
WHERE (pm.`pm_sent_del = 1) AND `#user`.`user_id` IS NULL"))
|
||||
{
|
||||
while ($row = $db2->fetch(MYSQL_ASSOC))
|
||||
while ($row = $db2->fetch())
|
||||
{
|
||||
if ($pmHandler->del($row['pm_id']) !== FALSE)
|
||||
{
|
||||
@ -703,7 +703,7 @@ function doMaint($opts, $pmPrefs)
|
||||
$cnt = 0;
|
||||
if($db2->db_Select('private_msg', 'pm_id', $qry))
|
||||
{
|
||||
while ($row = $db2->db_Fetch(MYSQL_ASSOC))
|
||||
while ($row = $db2->db_Fetch())
|
||||
{
|
||||
if ($pmHandler->del($row['pm_id']) !== FALSE)
|
||||
{
|
||||
@ -731,7 +731,7 @@ function doMaint($opts, $pmPrefs)
|
||||
$fileArray = $fl->get_files(e_PLUGIN.'pm/attachments');
|
||||
if ($db2->select('private_msg', 'pm_id, pm_attachments', "pm_attachments != ''"))
|
||||
{
|
||||
while ($row = $db2->fetch(MYSQL_ASSOC))
|
||||
while ($row = $db2->fetch())
|
||||
{
|
||||
$attachList = explode(chr(0), $row['pm_attachments']);
|
||||
foreach ($attachList as $a)
|
||||
|
@ -339,7 +339,7 @@ class tinymce
|
||||
{
|
||||
$query = str_replace("{ID}",$id,$this->editQry);
|
||||
$sql->db_Select_gen($query);
|
||||
$row = $sql->db_Fetch(MYSQL_ASSOC);
|
||||
$row = $sql->db_Fetch();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -138,7 +138,7 @@ if (isset($_POST['GetOnWithIt']))
|
||||
}
|
||||
if (!$error && $pc_db->db_Select('user_backup','*'))
|
||||
{
|
||||
while ($row = $pc_db->db_Fetch(MYSQL_ASSOC))
|
||||
while ($row = $pc_db->db_Fetch())
|
||||
{
|
||||
$uid = $row['user_id'];
|
||||
unset($row['user_id']);
|
||||
|
@ -226,7 +226,7 @@ class e_install
|
||||
protected $pdo = false;
|
||||
|
||||
// public function __construct()
|
||||
function e_install()
|
||||
function __construct()
|
||||
{
|
||||
// notice removal, required from various core routines
|
||||
define('USERID', 1);
|
||||
@ -1461,7 +1461,7 @@ if($this->pdo == true)
|
||||
|
||||
define('PREVIEWTHEMENAME',""); // Notice Removal.
|
||||
|
||||
include_lan($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$this->previous_steps['language']."/lan_prefs.php");
|
||||
// include_lan($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$this->previous_steps['language']."/lan_prefs.php");
|
||||
include_lan($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$this->previous_steps['language']."/admin/lan_theme.php");
|
||||
|
||||
// [SecretR] should work now - fixed log errors (argument noLogs = true) change to false to enable log
|
||||
@ -1856,7 +1856,7 @@ if($this->pdo == true)
|
||||
|
||||
function dbqry($qry)
|
||||
{
|
||||
mysql_query($qry);
|
||||
// mysql_query($qry);
|
||||
$sql = e107::getDb();
|
||||
$sql->db_Query($qry);
|
||||
|
||||
|
@ -100,9 +100,9 @@ else
|
||||
else
|
||||
{
|
||||
$sql->db_Select("news_category", "category_id, category_name", "category_id='{$news_category}'");
|
||||
list($category_id, $category_name) = $sql->db_Fetch(MYSQL_NUM);
|
||||
list($category_id, $category_name) = $sql->db_Fetch('num');
|
||||
$sql->db_Select("user", "user_id, user_name", "user_id='{$news_author}'");
|
||||
list($a_id, $a_name) = $sql->db_Fetch(MYSQL_NUM);
|
||||
list($a_id, $a_name) = $sql->db_Fetch('num');
|
||||
}
|
||||
$news_datestamp = $con->convert_date($news_datestamp, "long");
|
||||
$print_text = "<span style=\"font-size: 13px; color: black; font-family: tahoma, verdana, arial, helvetica; text-decoration: none\">
|
||||
|
@ -190,7 +190,7 @@ else
|
||||
{
|
||||
$text .= "
|
||||
<select name='cat_id' class='tbox form-control'>";
|
||||
while (list($cat_id, $cat_name, $cat_icon) = $sql->db_Fetch(MYSQL_NUM))
|
||||
while (list($cat_id, $cat_name, $cat_icon) = $sql->db_Fetch('num'))
|
||||
{
|
||||
$sel = (varset($_POST['cat_id'],'') == $cat_id) ? "selected='selected'" : "";
|
||||
$text .= "<option value='{$cat_id}' {$sel}>".$tp->toHTML($cat_name, FALSE, "defs")."</option>";
|
||||
|
4
top.php
4
top.php
@ -86,7 +86,7 @@ if ($action == 'active')
|
||||
<th style='width:25%; text-align:center' class='forumheader'>".LAN_5."</th>
|
||||
</tr>\n";
|
||||
|
||||
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
if ($row['user_name'])
|
||||
{
|
||||
@ -167,7 +167,7 @@ if ($action == 'top')
|
||||
$sql2 = e107::getDb('sql2');
|
||||
if ($sql2->gen($qry))
|
||||
{
|
||||
while ($row = $sql2->db_Fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql2->fetch())
|
||||
{
|
||||
//$ldata = get_level($row['user_id'], $row['user_plugin_forum_posts'], $row['user_comments'], $row['user_chats'], $row['user_visits'], $row['user_join'], $row['user_admin'], $row['user_perms'], $pref);
|
||||
$ldata = $rank->getRanks($row, (USER && $forum->isModerator(USERID)));
|
||||
|
@ -206,7 +206,7 @@ elseif ($action == 'forums')
|
||||
$userposts_forum_table_string = '';
|
||||
while(true)
|
||||
{
|
||||
$row = $sql->db_Fetch(MYSQL_ASSOC);
|
||||
$row = $sql->fetch();
|
||||
if(empty($row)) break;
|
||||
|
||||
$datestamp = $gen->convert_date($row['post_datestamp'], 'short');
|
||||
|
@ -742,8 +742,8 @@ SELECT u.*, ue.* FROM #user AS u
|
||||
LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id
|
||||
WHERE u.user_id=".intval($uuid);
|
||||
|
||||
$sql->db_Select_gen($qry);
|
||||
$curVal=$sql->db_Fetch(MYSQL_ASSOC);
|
||||
$sql->gen($qry);
|
||||
$curVal=$sql->fetch();
|
||||
$curVal['user_class'] = varset($changedUserData['user_class'], $curVal['user_class']);
|
||||
$curVal['userclass_list'] = $userMethods->addCommonClasses($curVal, FALSE);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user