1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 04:38:27 +01:00

Issue #1356 - PHP7 Fixes.

This commit is contained in:
Cameron 2016-02-14 12:15:55 -08:00
parent 32636ec39d
commit 486f3d4961
54 changed files with 205 additions and 285 deletions

View File

@ -132,6 +132,7 @@ set_error_handler(array(&$error_handler, 'handle_error'));
// //
define('e107_INIT', true); define('e107_INIT', true);
// MOVED TO $e107->prepare_request() // MOVED TO $e107->prepare_request()
// setup some php options // setup some php options
//e107_ini_set('magic_quotes_runtime', 0); //e107_ini_set('magic_quotes_runtime', 0);

View File

@ -78,7 +78,7 @@ require_once(realpath(dirname(__FILE__)."/class2.php"));
$sql = e107::getDb(); $sql = e107::getDb();
if($sql->select("cron",'cron_function,cron_tab','cron_active =1')) 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); list($class,$function) = explode("::",$row['cron_function'],2);
$key = $class."__".$function; $key = $class."__".$function;

View File

@ -109,7 +109,7 @@ class cron_admin_ui extends e_admin_ui
} }
$sql->gen("SELECT cron_function,cron_active FROM #cron "); $sql->gen("SELECT cron_function,cron_active FROM #cron ");
while($row = $sql->fetch(MYSQL_ASSOC)) while($row = $sql->fetch())
{ {
$this->curCrons[] = $row['cron_function']; $this->curCrons[] = $row['cron_function'];
if($row['cron_active']==1) if($row['cron_active']==1)
@ -403,7 +403,7 @@ class cron_admin_ui extends e_admin_ui
$sql = e107::getDb(); $sql = e107::getDb();
if($sql->select("cron","cron_name,cron_function","cron_id = ".intval($cron_id))) 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']; $class_func = $row['cron_function'];
$cron_name = $row['cron_name']; $cron_name = $row['cron_name'];
} }

View File

@ -987,7 +987,7 @@ class system_tools
if($sql->gen($query)) if($sql->gen($query))
{ {
while ($row = $sql->fetch(MYSQL_NUM)) while ($row = $sql->fetch('num'))
{ {
$qry[] = $row[0]; $qry[] = $row[0];
} }
@ -1006,7 +1006,7 @@ class system_tools
$mes->addError("Query Failed: ".$query); $mes->addError("Query Failed: ".$query);
return; return;
} }
while ($row = mysql_fetch_array($result, MYSQL_NUM)) while ($row = mysql_fetch_array($result, 'num'))
{ {
$qry[] = $row[0]; $qry[] = $row[0];
} }

View File

@ -1308,7 +1308,7 @@ class news_form_ui extends e_admin_form_ui
{ {
$auth = ($curVal) ? intval($curVal) : USERID; $auth = ($curVal) ? intval($curVal) : USERID;
$sql->select("user", "user_name", "user_id={$auth} LIMIT 1"); $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 .= "<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>"; $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; $auth = ($_POST['news_author']) ? intval($_POST['news_author']) : USERID;
$sql->select("user", "user_name", "user_id={$auth} LIMIT 1"); $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 .= "<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>"; $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']); $canDelete = isset($_POST['newsdeletecomments']);
if ($result = e107::getDb()->db_Select_gen($qry)) 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!!! if ($canDelete && ($row['news_allow_comments'] != 0) && ($row['c_count'] > 0)) // N.B. sense of 'news_allow_comments' is 0 = allow!!!
{ // Delete comments { // Delete comments

View File

@ -1211,7 +1211,7 @@ function update_706_to_800($type='')
require_once(e_HANDLER.'mail_manager_class.php'); require_once(e_HANDLER.'mail_manager_class.php');
$mailHandler = new e107MailManager; $mailHandler = new e107MailManager;
$i = 0; $i = 0;
while ($row = $sql->db_Fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
$mailRecord = array( $mailRecord = array(
'mail_create_date' => $row['gen_datestamp'], 'mail_create_date' => $row['gen_datestamp'],

View File

@ -608,7 +608,7 @@ if(e_AJAX_REQUEST)
} }
elseif($sql->db_Select('userclass_classes', '*', "userclass_id='".$class_num."' ")) 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 //Response action - reset all group checkboxes
$jshelper->addResponseAction('reset-checked', array('group_classes_select' => '0')); $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).")"); 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}$')")) 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 { // Delete existing users from class
while ($row = $sql->db_Fetch(MYSQL_ASSOC)) while ($row = $sql->db_Fetch())
{ {
$uidList[$row['user_id']] = $row['user_class']; $uidList[$row['user_id']] = $row['user_class'];
} }

View File

@ -452,7 +452,7 @@ SC_BEGIN DOWNLOAD_CATEGORY_SELECT
// Its a structured display option - need a 2-step process to create a tree // Its a structured display option - need a 2-step process to create a tree
$catlist = array(); $catlist = array();
while ($row = $sql->db_Fetch(MYSQL_ASSOC)) while ($row = $sql->db_Fetch())
{ {
$tmp = $row['download_category_parent']; $tmp = $row['download_category_parent'];
if ($tmp == '0') if ($tmp == '0')

View File

@ -40,7 +40,7 @@ class core_user_url extends eUrlConfig
* - login/index (or just 'login') -> login.php * - login/index (or just 'login') -> login.php
* - register/index (or just 'register') -> signup.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'; if(!$params) return 'user.php';
@ -115,8 +115,8 @@ class core_user_url extends eUrlConfig
return $admin; 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 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 // this means News are not available via single entry point if this config is currently active

View File

@ -513,7 +513,8 @@ City, State, Country
<field name="media_cat_owner">_common</field> <field name="media_cat_owner">_common</field>
<field name="media_cat_category">_common_image</field> <field name="media_cat_category">_common_image</field>
<field name="media_cat_title">(Common Images)</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_class">253</field>
<field name="media_cat_image"></field> <field name="media_cat_image"></field>
<field name="media_cat_order">0</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_owner">_common</field>
<field name="media_cat_category">_common_file</field> <field name="media_cat_category">_common_file</field>
<field name="media_cat_title">(Common Files)</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_class">253</field>
<field name="media_cat_image"></field> <field name="media_cat_image"></field>
<field name="media_cat_order">0</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_owner">news</field>
<field name="media_cat_category">news</field> <field name="media_cat_category">news</field>
<field name="media_cat_title">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_class">253</field>
<field name="media_cat_image"></field> <field name="media_cat_image"></field>
<field name="media_cat_order">1</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_owner">page</field>
<field name="media_cat_category">page</field> <field name="media_cat_category">page</field>
<field name="media_cat_title">Custom Pages</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_class">253</field>
<field name="media_cat_image"></field> <field name="media_cat_image"></field>
<field name="media_cat_order">0</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_owner">download</field>
<field name="media_cat_category">download_image</field> <field name="media_cat_category">download_image</field>
<field name="media_cat_title">Download Images</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_diz"></field>
<field name="media_cat_class">253</field> <field name="media_cat_class">253</field>
<field name="media_cat_image"></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_owner">download</field>
<field name="media_cat_category">download_thumb</field> <field name="media_cat_category">download_thumb</field>
<field name="media_cat_title">Download Thumbnails</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_diz"></field>
<field name="media_cat_class">253</field> <field name="media_cat_class">253</field>
<field name="media_cat_image"></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_owner">download</field>
<field name="media_cat_category">download_file</field> <field name="media_cat_category">download_file</field>
<field name="media_cat_title">Download Files</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_diz"></field>
<field name="media_cat_class">253</field> <field name="media_cat_class">253</field>
<field name="media_cat_image"></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_owner">news</field>
<field name="media_cat_category">news_thumb</field> <field name="media_cat_category">news_thumb</field>
<field name="media_cat_title">News Thumbnails (Legacy)</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_class">253</field>
<field name="media_cat_image"></field> <field name="media_cat_image"></field>
<field name="media_cat_order">1</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_owner">_icon</field>
<field name="media_cat_category">_icon_16</field> <field name="media_cat_category">_icon_16</field>
<field name="media_cat_title">Icons 16px</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_class">253</field>
<field name="media_cat_image"></field> <field name="media_cat_image"></field>
<field name="media_cat_order">0</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_owner">_icon</field>
<field name="media_cat_category">_icon_32</field> <field name="media_cat_category">_icon_32</field>
<field name="media_cat_title">Icons 32px</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_class">253</field>
<field name="media_cat_image"></field> <field name="media_cat_image"></field>
<field name="media_cat_order">0</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_owner">_icon</field>
<field name="media_cat_category">_icon_48</field> <field name="media_cat_category">_icon_48</field>
<field name="media_cat_title">Icons 48px</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_class">253</field>
<field name="media_cat_image"></field> <field name="media_cat_image"></field>
<field name="media_cat_order">0</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_owner">_icon</field>
<field name="media_cat_category">_icon_64</field> <field name="media_cat_category">_icon_64</field>
<field name="media_cat_title">Icons 64px</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_class">253</field>
<field name="media_cat_image"></field> <field name="media_cat_image"></field>
<field name="media_cat_order">0</field> <field name="media_cat_order">0</field>
@ -1080,6 +1092,7 @@ City, State, Country
<field name="userclass_visibility">0</field> <field name="userclass_visibility">0</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">253</field> <field name="userclass_id">253</field>
@ -1091,6 +1104,7 @@ City, State, Country
<field name="userclass_visibility">253</field> <field name="userclass_visibility">253</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">246</field> <field name="userclass_id">246</field>
@ -1102,6 +1116,7 @@ City, State, Country
<field name="userclass_visibility">254</field> <field name="userclass_visibility">254</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">254</field> <field name="userclass_id">254</field>
@ -1113,6 +1128,7 @@ City, State, Country
<field name="userclass_visibility">253</field> <field name="userclass_visibility">253</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">248</field> <field name="userclass_id">248</field>
@ -1124,6 +1140,7 @@ City, State, Country
<field name="userclass_visibility">253</field> <field name="userclass_visibility">253</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">249</field> <field name="userclass_id">249</field>
@ -1135,6 +1152,7 @@ City, State, Country
<field name="userclass_visibility">253</field> <field name="userclass_visibility">253</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">1</field> <field name="userclass_id">1</field>
@ -1146,6 +1164,7 @@ City, State, Country
<field name="userclass_visibility">0</field> <field name="userclass_visibility">0</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">247</field> <field name="userclass_id">247</field>
@ -1157,6 +1176,7 @@ City, State, Country
<field name="userclass_visibility">254</field> <field name="userclass_visibility">254</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">250</field> <field name="userclass_id">250</field>
@ -1168,6 +1188,7 @@ City, State, Country
<field name="userclass_visibility">253</field> <field name="userclass_visibility">253</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">0</field> <field name="userclass_id">0</field>
@ -1179,6 +1200,7 @@ City, State, Country
<field name="userclass_visibility">0</field> <field name="userclass_visibility">0</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">252</field> <field name="userclass_id">252</field>
@ -1190,6 +1212,7 @@ City, State, Country
<field name="userclass_visibility">0</field> <field name="userclass_visibility">0</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">255</field> <field name="userclass_id">255</field>
@ -1201,6 +1224,7 @@ City, State, Country
<field name="userclass_visibility">0</field> <field name="userclass_visibility">0</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
<item> <item>
<field name="userclass_id">251</field> <field name="userclass_id">251</field>
@ -1212,6 +1236,7 @@ City, State, Country
<field name="userclass_visibility">0</field> <field name="userclass_visibility">0</field>
<field name="userclass_type">0</field> <field name="userclass_type">0</field>
<field name="userclass_icon"></field> <field name="userclass_icon"></field>
<field name="userclass_perms"></field>
</item> </item>
</dbTable> </dbTable>
</database> </database>

View File

@ -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'); $event_title = $tp->toDB($event_title, true, false, 'no_html');
//--------------------------------------- //---------------------------------------

View File

@ -171,7 +171,7 @@ class e107_db_debug {
$t['caller'] = "$sCallingFile($sCallingLine)"; $t['caller'] = "$sCallingFile($sCallingLine)";
$t['query'] = $query; $t['query'] = $query;
$t['ok'] = $sQryRes ? TRUE : FALSE; $t['ok'] = $sQryRes ? TRUE : FALSE;
$t['error'] = $sQryRes ? '' : mysql_error(); $t['error'] = $sQryRes ? '' : $sql->getLastErrorText(); // mysql_error();
$t['nFields'] = $nFields; $t['nFields'] = $nFields;
$t['time'] = $mytime; $t['time'] = $mytime;

View File

@ -50,7 +50,7 @@ class db_table_admin
{ {
return FALSE; 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 $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); $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) if ($count === FALSE)

View File

@ -919,7 +919,7 @@ class db_verify
if($z) if($z)
{ {
// $row = mysql_fetch_row($z); // $row = mysql_fetch_row($z);
$row = $sql->fetch(MYSQL_NUM); $row = $sql->fetch('num');
//return $row[1]; //return $row[1];
return stripslashes($row[1]).';'; // backticks needed. return stripslashes($row[1]).';'; // backticks needed.
// return str_replace("`", "", stripslashes($row[1])).';'; // return str_replace("`", "", stripslashes($row[1])).';';

View File

@ -122,7 +122,7 @@ class e107_debug {
// removed: inline debug breaks pages! // 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'])) if (preg_match('/debug(=?)(.*?),?(\+|stick|-|unstick|$)/', e_MENU, $debug_param) || isset($_COOKIE['e107_debug_level']))
{ {

View File

@ -4407,7 +4407,7 @@ class e_emotefilter {
var $replace; var $replace;
var $emotes; var $emotes;
function e_emotefilter() /* constructor */ function __construct() /* constructor */
{ {
$pref = e107::getPref(); $pref = e107::getPref();
@ -4495,7 +4495,7 @@ class e_profanityFilter
{ {
var $profanityList; var $profanityList;
function e_profanityFilter() function __construct()
{ {
global $pref; global $pref;

View File

@ -972,7 +972,7 @@ class eIPHandler
// See if address already in the banlist // See if address already in the banlist
if ($sql->select('banlist', '`banlist_bantype`', "`banlist_ip`='{$ban_ip}'")) 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) if ($banType >= eIPHandler::BAN_TYPE_WHITELIST)
{ // Got a whitelist entry for this { // Got a whitelist entry for this
@ -1134,7 +1134,7 @@ class eIPHandler
$gotIP = FALSE; $gotIP = FALSE;
$gotBrowser = FALSE; $gotBrowser = FALSE;
$bestRow = FALSE; $bestRow = FALSE;
while (FALSE !== ($row = $ourDB->fetch(MYSQL_ASSOC))) while (FALSE !== ($row = $ourDB->fetch()))
{ {
if ($row['user_token'] == $browser) if ($row['user_token'] == $browser)
{ {
@ -1273,7 +1273,7 @@ class banlistManager
if ($sql->db_Select_gen($qry)) 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']); $row['banlist_ip'] = $this->trimWildcard($row['banlist_ip']);
if ($row['banlist_ip'] == '') continue; // Ignore empty IP addresses if ($row['banlist_ip'] == '') continue; // Ignore empty IP addresses

View File

@ -138,7 +138,7 @@ class e_jshelper
foreach ($field_array as $field => $value) foreach ($field_array as $field => $value)
{ {
//associative arrays only - no numeric keys! //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 //when passing large data from the DB
if (is_numeric($field) || empty($field)) continue; if (is_numeric($field) || empty($field)) continue;

View File

@ -357,7 +357,7 @@ class userlogin
} }
// User is in DB here // 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->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 $this->lookEmail = $this->lookEmail && ($username == $this->userData['user_email']); // Know whether login name or email address used now

View File

@ -623,7 +623,7 @@ class e107MailManager
{ {
return false; return false;
} }
if ($result = $this->db->fetch(MYSQL_ASSOC)) if ($result = $this->db->fetch())
{ {
$this->queryActive--; $this->queryActive--;
return $this->dbToBoth($result); return $this->dbToBoth($result);
@ -1444,7 +1444,7 @@ class e107MailManager
$errors[] = 'Not found in DB: '.$vals[1].'/'.$vals[2]; $errors[] = 'Not found in DB: '.$vals[1].'/'.$vals[2];
} }
$row = $this->db->fetch(MYSQL_ASSOC); $row = $this->db->fetch();
$row = $this->dbToBoth($row); $row = $this->dbToBoth($row);
@ -1715,7 +1715,7 @@ class e107MailManager
*/ */
public function getNextTargetStatus() public function getNextTargetStatus()
{ {
$result = $this->db2->db_Fetch(MYSQL_ASSOC); $result = $this->db2->db_Fetch();
if (is_array($result)) { return $this->dbToTarget($result); } if (is_array($result)) { return $this->dbToTarget($result); }
return FALSE; return FALSE;
} }

View File

@ -467,7 +467,7 @@ class mailoutAdminClass extends e107MailManager
// Make sure DB object created // Make sure DB object created
if($this->db2->select('user', 'user_name, user_loginname', 'user_id=' . intval($uid))) 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'] . ')'; $this->userCache[$uid] = $row['user_name'] . ' (' . $row['user_loginname'] . ')';
} }
else else
@ -1907,7 +1907,7 @@ class mailoutAdminClass extends e107MailManager
{ {
$items = array(); $items = array();
// Store record number of any content record that needs to be changed // 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']; $items[] = $row['mail_source_id'];
if($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 // This forces one more loop, so we can clean up for last record read
$changeCount = 0; $changeCount = 0;
$saveRow = array(); $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'])) if(($lastMail > 0 && $row === FALSE) || ($lastMail != $row['mail_source_id']))
{ {

View File

@ -237,7 +237,7 @@ class core_mailout
{ {
$sql = e107::getDb(); $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'], $ret = array('mail_recipient_id' => $row['user_id'],
'mail_recipient_name' => $row['user_name'], // Should this use realname? 'mail_recipient_name' => $row['user_name'], // Should this use realname?
'mail_recipient_email' => $row['user_email'], 'mail_recipient_email' => $row['user_email'],

View File

@ -360,7 +360,7 @@ class e_media
$qry .= "ORDER BY media_cat_order"; $qry .= "ORDER BY media_cat_order";
e107::getDb()->gen($qry); e107::getDb()->gen($qry);
while($row = e107::getDb()->fetch(MYSQL_ASSOC)) while($row = e107::getDb()->fetch())
{ {
$id = $row['media_cat_category']; $id = $row['media_cat_category'];
$ret[$id] = $row; $ret[$id] = $row;
@ -494,7 +494,7 @@ class e_media
$query .= " LIMIT ".$from." ,".$amount; $query .= " LIMIT ".$from." ,".$amount;
} }
e107::getDb()->gen($query); e107::getDb()->gen($query);
while($row = e107::getDb()->fetch(MYSQL_ASSOC)) while($row = e107::getDb()->fetch())
{ {
$id = $row['media_id']; $id = $row['media_id'];
$ret[$id] = $row; $ret[$id] = $row;

View File

@ -493,7 +493,7 @@ class e_menuManager {
$location_count--; $location_count--;
} }
$sql->select("menus", "*", "menu_path NOT REGEXP('[0-9]+') "); $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) if (stristr($menustr, $menu_name) === FALSE)
{ {
@ -1433,7 +1433,7 @@ class e_menuManager {
$cl = ($this->dragDrop) ? "'portlet" : "regularMenu"; $cl = ($this->dragDrop) ? "'portlet" : "regularMenu";
$menuText .= "\n<div class='column' id='area-".$menu."'>\n\n"; $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 .= "\n\n\n <!-- Menu Start ".$row['menu_name']. "-->\n";
$menuText .= "<div class='{$cl}' id='block-".$row['menu_id']."-".$menu."'>\n"; $menuText .= "<div class='{$cl}' id='block-".$row['menu_id']."-".$menu."'>\n";

View File

@ -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 $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 class e_db_mysql
{ {
// TODO switch to protected vars where needed // TODO switch to protected vars where needed
@ -105,7 +107,8 @@ class e_db_mysql
{ {
global $pref, $db_defaultPrefix; global $pref, $db_defaultPrefix;
if(defined('e_PDO') && e_PDO === true) if(defined('e_PDO') && e_PDO === true)
{ {
$this->pdo = true; $this->pdo = true;
@ -1142,6 +1145,7 @@ class e_db_mysql
/** /**
* @param string $type assoc|num|both
* @return array MySQL row * @return array MySQL row
* @desc Fetch an array containing row data (see PHP's mysql_fetch_array() docs)<br /> * @desc Fetch an array containing row data (see PHP's mysql_fetch_array() docs)<br />
* @example * @example
@ -1152,31 +1156,57 @@ class e_db_mysql
* *
* @access public * @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 case 'both':
$type = PDO::FETCH_BOTH; case MYSQL_BOTH:
break; $type = MYSQL_BOTH; // 3
break;
case MYSQL_NUM: // 2
$type = PDO::FETCH_NUM; case 'num':
break; case MYSQL_NUM: // 2
$type = MYSQL_NUM;
case MYSQL_ASSOC: // 1 break;
default:
$type = PDO::FETCH_ASSOC; case 'assoc':
break; 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(); $b = microtime();
if($this->mySQLresult) if($this->mySQLresult)
@ -1197,7 +1227,7 @@ class e_db_mysql
* fetch() alias * fetch() alias
* @deprecated * @deprecated
*/ */
function db_Fetch($type = MYSQL_ASSOC) function db_Fetch($type = null)
{ {
return $this->fetch($type); return $this->fetch($type);
} }
@ -1862,12 +1892,7 @@ class e_db_mysql
*/ */
function escape($data, $strip = true) function escape($data, $strip = true)
{ {
if($this->pdo)
{
return $data;
}
if ($strip) if ($strip)
{ {
$data = strip_if_magic($data); $data = strip_if_magic($data);
@ -1879,7 +1904,11 @@ class e_db_mysql
$this->mySQLaccess = $db_ConnectionID; $this->mySQLaccess = $db_ConnectionID;
} }
if($this->pdo)
{
return $data;
// return $this->mySQLaccess->quote($data);
}
return mysql_real_escape_string($data,$this->mySQLaccess); return mysql_real_escape_string($data,$this->mySQLaccess);
} }
@ -1983,7 +2012,7 @@ class e_db_mysql
$table = array(); $table = array();
if($res = $this->db_Query("SHOW TABLES LIKE '".$this->mySQLPrefix."lan_".strtolower($language)."%' ")) 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]); $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."%' ")) if($res = $this->db_Query("SHOW TABLES LIKE '".$this->mySQLPrefix."%' "))
{ {
$length = strlen($this->mySQLPrefix); $length = strlen($this->mySQLPrefix);
while($rows = $this->fetch(MYSQL_NUM)) while($rows = $this->fetch('num'))
{ {
$table[] = substr($rows[0],$length); $table[] = substr($rows[0],$length);
} }
@ -2137,7 +2166,7 @@ class e_db_mysql
$qry = "SHOW CREATE TABLE {$old}"; $qry = "SHOW CREATE TABLE {$old}";
if ($this->gen($qry)) if ($this->gen($qry))
{ {
$row = $this->fetch(MYSQL_NUM); $row = $this->fetch('num');
$qry = $row[1]; $qry = $row[1];
// $qry = str_replace($old, $new, $qry); // $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 $qry = preg_replace("#CREATE\sTABLE\s`{0,1}".$old."`{0,1}\s#", "CREATE TABLE `{$new}` ", $qry, 1); // More selective search

View File

@ -179,7 +179,7 @@ class notify
if (false !== ($count = $sql->gen($qry))) if (false !== ($count = $sql->gen($qry)))
{ {
// Now add email addresses to the list // Now add email addresses to the list
while ($row = $sql->fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
if ($row['user_email'] != $emailFilter) if ($row['user_email'] != $emailFilter)
{ {

View File

@ -22,146 +22,10 @@ if (!defined('e107_INIT'))
* *
* @package e107 * @package e107
* @subpackage e107_handlers * @subpackage e107_handlers
* @version $Id$ * @copyright Copyright (C) 2008-2016 e107 Inc (e107.org)
* @copyright Copyright (C) 2008-2010 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')) if (!function_exists('strptime'))

View File

@ -199,7 +199,7 @@ class e107plugin
if ($sql->select("plugin", "plugin_id", "plugin_path = '".(string) $path."' LIMIT 1")) 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']); 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 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']] = $row;
$pluginDBList[$row['plugin_path']]['status'] = 'read'; $pluginDBList[$row['plugin_path']]['status'] = 'read';

View File

@ -1671,7 +1671,7 @@ class themeHandler
// echo $plug; // echo $plug;
if($sql->db_Select("plugin", "plugin_id", " plugin_path = '".$plug."' LIMIT 1 ")) 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']."]"; $name = "installplugin[".$row['plugin_id']."]";
$text .= $this->frm->admin_button($name, ADLAN_121." ".$plug."", 'delete'); $text .= $this->frm->admin_button($name, ADLAN_121." ".$plug."", 'delete');
} }

View File

@ -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")) 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) if ($row['user_extended_struct_type'] == 0)
{ // Its a category { // Its a category
@ -379,7 +379,7 @@ class e107_user_extended
$more = ($cat) ? " AND user_extended_struct_parent = ".intval($cat)." " : ""; $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")) 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; $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")) 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; $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")) 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']; $ret[] = 'user_'.$row['user_extended_struct_name'];
} }

View File

@ -865,7 +865,7 @@ Following fields auto-filled in code as required:
} }
else else
{ {
$row = $db->db_Fetch(MYSQL_ASSOC); $row = $db->db_Fetch();
if ($uid && ($uid != $row['user_id'])) if ($uid && ($uid != $row['user_id']))
{ {
$error = 'UID mismatch: '.$uid.'/'.$row['user_id']; $error = 'UID mismatch: '.$uid.'/'.$row['user_id'];

View File

@ -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 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']] = $row;
$this->class_tree[$row['userclass_id']]['class_children'] = array(); // Create the child array in case needed $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}'"; $qry = "SELECT user_id,{$fieldList} FROM `#user` WHERE user_class REGEXP '{$class_regex}' ORDER BY '{$orderBy}'";
if ($this->sql_r->db_Select_gen($qry)) 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; $ret[$row['user_id']] = $row;
} }

View File

@ -1175,6 +1175,7 @@ class xmlClass
$fieldval = (isset($f['@value'])) ? $f['@value'] : ""; $fieldval = (isset($f['@value'])) ? $f['@value'] : "";
$insert_array[$fieldkey] = $fieldval; $insert_array[$fieldkey] = $fieldval;
} }
if(($mode == "replace") && $sql->replace($table, $insert_array)!==FALSE) if(($mode == "replace") && $sql->replace($table, $insert_array)!==FALSE)
{ {

View File

@ -155,7 +155,7 @@ class alt_login
} }
if($aa_sql -> db_Select_gen($qry)) if($aa_sql -> db_Select_gen($qry))
{ // Existing user - get current data, see if any changes { // 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) foreach ($db_vals as $k => $v)
{ {
if ($row[$k] == $v) unset($db_vals[$k]); if ($row[$k] == $v) unset($db_vals[$k]);

View File

@ -922,7 +922,7 @@ class download
<option value=''>{$blankText}</option>\n"; <option value=''>{$blankText}</option>\n";
// Its a structured display option - need a 2-step process to create a tree // Its a structured display option - need a 2-step process to create a tree
$catlist = array(); $catlist = array();
while ($dlrow = $sql->fetch(MYSQL_ASSOC)) while ($dlrow = $sql->fetch())
{ {
$tmp = $dlrow['download_category_parent']; $tmp = $dlrow['download_category_parent'];
if ($tmp == '0') if ($tmp == '0')

View File

@ -693,7 +693,7 @@ function forum_track()
$data = array(); $data = array();
if($sql->gen($qry)) if($sql->gen($qry))
{ {
while($row = $sql->fetch(MYSQL_ASSOC)) while($row = $sql->fetch())
{ {
$row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl'); $row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl');

View File

@ -2007,7 +2007,7 @@ class forumAdmin
<th colspan='2'>".LAN_FORUM_1001."</th> <th colspan='2'>".LAN_FORUM_1001."</th>
<th>".LAN_OPTIONS."</th> <th>".LAN_OPTIONS."</th>
</tr>"; </tr>";
while ($row = $sql->fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
$parentList[] = $row; $parentList[] = $row;
} }
@ -2049,7 +2049,7 @@ class forumAdmin
else else
{ {
$forumList = array(); $forumList = array();
while ($row = $sql->fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
$forumList[] = $row; $forumList[] = $row;
} }
@ -2123,7 +2123,7 @@ class forumAdmin
{ {
if ($sql->select('forum', '*', "forum_id=$id")) if ($sql->select('forum', '*', "forum_id=$id"))
{ {
$row = $sql->fetch(MYSQL_ASSOC); $row = $sql->fetch();
} }
} }
else else
@ -2188,7 +2188,7 @@ class forumAdmin
{ {
if ($sql->select('forum', '*', "forum_id=$id")) if ($sql->select('forum', '*', "forum_id=$id"))
{ {
$fInfo = $sql->fetch(MYSQL_ASSOC); $fInfo = $sql->fetch();
} }
} }
else else
@ -2215,7 +2215,7 @@ class forumAdmin
$sql->select('forum', '*', 'forum_parent=0'); $sql->select('forum', '*', 'forum_parent=0');
$text .= "<select name='forum_parent' class='tbox'>\n"; $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'" : ''); $sel = ($fid == vartrue($fInfo['forum_parent']) ? "selected='selected'" : '');
$text .= "<option value='{$fid}' {$sel}>{$fname}</option>\n"; $text .= "<option value='{$fid}' {$sel}>{$fname}</option>\n";

View File

@ -867,7 +867,7 @@ class e107forum
} }
if($sql->gen($qry)) if($sql->gen($qry))
{ {
$tmp = $sql->fetch(MYSQL_ASSOC); $tmp = $sql->fetch();
if($tmp) if($tmp)
{ {
if(trim($tmp['thread_options']) != '') if(trim($tmp['thread_options']) != '')
@ -923,7 +923,7 @@ class e107forum
if($sql->gen($qry)) if($sql->gen($qry))
{ {
$ret = array(); $ret = array();
while($row = $sql->fetch(MYSQL_ASSOC)) while($row = $sql->fetch())
{ {
$row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl'); $row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl');
$ret[] = $row; $ret[] = $row;
@ -983,7 +983,7 @@ class e107forum
if($sql->gen($qry)) if($sql->gen($qry))
{ {
$ret = array(); $ret = array();
while($row = $sql->fetch(MYSQL_ASSOC)) while($row = $sql->fetch())
{ {
$ret[$row['post_user']] = $row['post_count']; $ret[$row['post_user']] = $row['post_count'];
} }
@ -1029,7 +1029,7 @@ class e107forum
$postList = array(); $postList = array();
while($row = $sql->Fetch(MYSQL_ASSOC)) while($row = $sql->Fetch())
{ {
$postList[] = $row['post_id']; $postList[] = $row['post_id'];
} }
@ -1049,7 +1049,7 @@ class e107forum
return true; return true;
} }
$tmp = $sql->fetch(MYSQL_ASSOC); $tmp = $sql->fetch();
$attachment_array = e107::unserialize($tmp['post_attachments']); $attachment_array = e107::unserialize($tmp['post_attachments']);
$files = $attachment_array['file']; $files = $attachment_array['file'];
@ -1187,7 +1187,7 @@ class e107forum
{ {
if ($sql->select('forum', 'forum_id', 'forum_parent != 0')) if ($sql->select('forum', 'forum_id', 'forum_parent != 0'))
{ {
while ($row = $sql->fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
$parentList[] = $row['forum_id']; $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 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); set_time_limit(60);
$this->forumUpdateLastpost('thread', $row['thread_id']); $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')) 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_info = $row['thread_datestamp'].'.'.$row['thread_id'];
$lp_user = $row['thread_lastuser']; $lp_user = $row['thread_lastuser'];
} }
@ -1258,7 +1258,7 @@ class e107forum
if ($sql->select('forum_thread', 'thread_id', $qry)) if ($sql->select('forum_thread', 'thread_id', $qry))
{ {
while ($row = $sql->fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
$newIdList[] = $row['thread_id']; $newIdList[] = $row['thread_id'];
} }
@ -1294,7 +1294,7 @@ class e107forum
{ {
if (e107::getDb()->select('forum', '*', 'forum_parent=0 ORDER BY forum_order ASC')) 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; $ret[] = $row;
} }
return $ret; return $ret;
@ -1314,7 +1314,7 @@ class e107forum
if($uclass == e_UC_ADMIN || trim($uclass) == '') if($uclass == e_UC_ADMIN || trim($uclass) == '')
{ {
$sql->select('user', 'user_id, user_name','user_admin = 1 ORDER BY user_name ASC'); $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']; $this->modArray[$row['user_id']] = $row['user_name'];
} }
@ -1385,7 +1385,7 @@ class e107forum
"; ";
if ($sql->gen($qry)) if ($sql->gen($qry))
{ {
while ($row = $sql->fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
if($type == 'all') if($type == 'all')
{ {
@ -1414,7 +1414,7 @@ class e107forum
"; ";
if ($sql->gen($qry)) if ($sql->gen($qry))
{ {
while ($row = $sql->fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
if($forum_id == '') if($forum_id == '')
{ {
@ -1462,7 +1462,7 @@ class e107forum
WHERE ft.thread_lastpost > '.USERLV.' '.$viewed; WHERE ft.thread_lastpost > '.USERLV.' '.$viewed;
if($sql->gen($_newqry)) if($sql->gen($_newqry))
{ {
while($row = $sql->fetch(MYSQL_ASSOC)) while($row = $sql->fetch())
{ {
$ret[] = $row['thread_forum_id']; $ret[] = $row['thread_forum_id'];
if($row['forum_sub']) if($row['forum_sub'])
@ -1653,7 +1653,7 @@ class e107forum
"; ";
if ($sql->gen($qry)) if ($sql->gen($qry))
{ {
return $sql->fetch(MYSQL_ASSOC); return $sql->fetch();
} }
return FALSE; return FALSE;
} }
@ -1706,7 +1706,7 @@ class e107forum
$ret = array(); $ret = array();
if ($sql->gen($qry)) if ($sql->gen($qry))
{ {
while ($row = $sql->fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
// $row['thread_sef'] = eHelper::title2sef($row['thread_name']); // $row['thread_sef'] = eHelper::title2sef($row['thread_name']);
$ret[] = $row; $ret[] = $row;
@ -1929,7 +1929,7 @@ class e107forum
if($sql->gen($qry)) if($sql->gen($qry))
{ {
$ret = array(); $ret = array();
while($row = $sql->fetch(MYSQL_ASSOC)) while($row = $sql->fetch())
{ {
$ret[$row['post_user']] = $row['cnt']; $ret[$row['post_user']] = $row['cnt'];
} }
@ -2110,7 +2110,7 @@ class e107forum
if($sql->select('forum_post', 'post_id', 'post_thread = '.$threadId)) if($sql->select('forum_post', 'post_id', 'post_thread = '.$threadId))
{ {
$postList = array(); $postList = array();
while($row = $sql->fetch(MYSQL_ASSOC)) while($row = $sql->fetch())
{ {
$postList[] = $row['post_id']; $postList[] = $row['post_id'];
} }
@ -2165,7 +2165,7 @@ class e107forum
} }
$row = $sql->fetch(MYSQL_ASSOC); $row = $sql->fetch();
//delete attachments if they exist //delete attachments if they exist
if($row['post_attachments']) if($row['post_attachments'])

View File

@ -615,7 +615,7 @@ class forumStats
<th style='width:25%; text-align:center' class='forumheader'>".LAN_5."</th> <th style='width:25%; text-align:center' class='forumheader'>".LAN_5."</th>
</tr>\n"; </tr>\n";
while ($row = $sql->fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
if ($row['user_name']) if ($row['user_name'])
{ {

View File

@ -373,7 +373,7 @@ function step4()
require_once (e_HANDLER . 'user_extended_class.php'); require_once (e_HANDLER . 'user_extended_class.php');
$ue = new e107_user_extended; $ue = new e107_user_extended;
while ($row = $db -> fetch(MYSQL_ASSOC)) while ($row = $db -> fetch())
{ {
$result['usercount']++; $result['usercount']++;
$userId = (int)$row['user_id']; $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')) 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']; $parentList[] = $row['forum_id'];
} }
@ -766,7 +766,7 @@ function step9()
"; ";
if ($sql -> gen($qry)) if ($sql -> gen($qry))
{ {
while ($row = $sql -> fetch(MYSQL_ASSOC)) while ($row = $sql -> fetch())
{ {
$threadList[] = $row['thread_id']; $threadList[] = $row['thread_id'];
} }
@ -774,7 +774,7 @@ function step9()
{ {
if ($sql -> select('forum_thread', 'thread_options', 'thread_id = ' . $threadId, 'default')) if ($sql -> select('forum_thread', 'thread_options', 'thread_id = ' . $threadId, 'default'))
{ {
$row = $sql -> fetch(MYSQL_ASSOC); $row = $sql -> fetch();
if ($row['thread_options']) if ($row['thread_options'])
{ {
$opts = unserialize($row['thread_options']); $opts = unserialize($row['thread_options']);
@ -880,7 +880,7 @@ function step10_ajax()//TODO
if ($sql->gen($qry)) if ($sql->gen($qry))
{ {
while ($row = $sql->fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
$postList[] = $row; $postList[] = $row;
} }
@ -1354,7 +1354,7 @@ class forumUpgrade
/* /*
if ($sql -> select('generic', '*', "gen_type = 'forumUpgrade'")) if ($sql -> select('generic', '*', "gen_type = 'forumUpgrade'"))
{ {
$row = $sql -> fetch(MYSQL_ASSOC); $row = $sql -> fetch();
$this -> updateInfo = unserialize($row['gen_chardata']); $this -> updateInfo = unserialize($row['gen_chardata']);
} }
else else

View File

@ -94,7 +94,7 @@ class phpbb3_import extends base_import_class
if($this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}attachments`")) 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']; $id = $row['post_msg_id'];
$key = $row['physical_filename']; $key = $row['physical_filename'];

View File

@ -93,7 +93,7 @@ class newsfeedClass
if ($sql->select("newsfeed", $fieldList, '`newsfeed_active` > 0')) // Read in all the newsfeed info on the first go 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']; $nfID = $row['newsfeed_id'];

View File

@ -424,14 +424,14 @@ class newsletter
{ {
return FALSE; return FALSE;
} }
$newsletterInfo = $sql->fetch(MYSQL_ASSOC); $newsletterInfo = $sql->fetch();
// Get parent details - has header/footer and subscriber list // Get parent details - has header/footer and subscriber list
if(!$sql->select('newsletter', '*', "newsletter_id='".$newsletterInfo['newsletter_parent']."' ")) if(!$sql->select('newsletter', '*', "newsletter_id='".$newsletterInfo['newsletter_parent']."' "))
{ {
return FALSE; return FALSE;
} }
$newsletterParentInfo = $sql->fetch(MYSQL_ASSOC); $newsletterParentInfo = $sql->fetch();
$memberArray = explode(chr(1), $newsletterParentInfo['newsletter_subscribers']); $memberArray = explode(chr(1), $newsletterParentInfo['newsletter_subscribers']);
require(e_HANDLER.'mail_manager_class.php'); 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)) 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, $uTarget = array('mail_recipient_id' => $memberID,
'mail_recipient_name' => $row['user_name'], // Should this use realname? 'mail_recipient_name' => $row['user_name'], // Should this use realname?
'mail_recipient_email' => $row['user_email'], 'mail_recipient_email' => $row['user_email'],
@ -704,7 +704,7 @@ class newsletter
{ {
$sql = e107::getDb(); $sql = e107::getDb();
$sql ->select('newsletter', '*', 'newsletter_id='.intval($p_id)); $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'])); $subscribers_list = array_flip(explode(chr(1), $nl_row['newsletter_subscribers']));
unset($subscribers_list[$p_key]); unset($subscribers_list[$p_key]);

View File

@ -133,7 +133,7 @@ class pm_cron // include plugin-folder in the name.
if ($this->ourDB->select('generic', '*', "`gen_type` = 'pm_bulk' LIMIT 1")) 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->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']); $this->ourDB->delete('generic', "`gen_type` = 'pm_bulk' AND `gen_id` = ".$pmRow['gen_id']);

View File

@ -403,7 +403,7 @@ class private_message
$to = intval($to); // Precautionary $to = intval($to); // Precautionary
if ($sql->select('private_msg_block', 'pm_block_from', 'pm_block_to = '.$to)) 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']; $ret[] = $row['pm_block_from'];
} }
@ -426,7 +426,7 @@ class private_message
$to = intval($to); // Precautionary $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)) 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; $ret[] = $row;
} }

View File

@ -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` 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")) 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) 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` 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")) 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) if ($pmHandler->del($row['pm_id']) !== FALSE)
{ {
@ -703,7 +703,7 @@ function doMaint($opts, $pmPrefs)
$cnt = 0; $cnt = 0;
if($db2->db_Select('private_msg', 'pm_id', $qry)) 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) if ($pmHandler->del($row['pm_id']) !== FALSE)
{ {
@ -731,7 +731,7 @@ function doMaint($opts, $pmPrefs)
$fileArray = $fl->get_files(e_PLUGIN.'pm/attachments'); $fileArray = $fl->get_files(e_PLUGIN.'pm/attachments');
if ($db2->select('private_msg', 'pm_id, pm_attachments', "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']); $attachList = explode(chr(0), $row['pm_attachments']);
foreach ($attachList as $a) foreach ($attachList as $a)

View File

@ -339,7 +339,7 @@ class tinymce
{ {
$query = str_replace("{ID}",$id,$this->editQry); $query = str_replace("{ID}",$id,$this->editQry);
$sql->db_Select_gen($query); $sql->db_Select_gen($query);
$row = $sql->db_Fetch(MYSQL_ASSOC); $row = $sql->db_Fetch();
} }
else else
{ {

View File

@ -138,7 +138,7 @@ if (isset($_POST['GetOnWithIt']))
} }
if (!$error && $pc_db->db_Select('user_backup','*')) 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']; $uid = $row['user_id'];
unset($row['user_id']); unset($row['user_id']);

View File

@ -226,7 +226,7 @@ class e_install
protected $pdo = false; protected $pdo = false;
// public function __construct() // public function __construct()
function e_install() function __construct()
{ {
// notice removal, required from various core routines // notice removal, required from various core routines
define('USERID', 1); define('USERID', 1);
@ -1461,7 +1461,7 @@ if($this->pdo == true)
define('PREVIEWTHEMENAME',""); // Notice Removal. 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"); 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 // [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) function dbqry($qry)
{ {
mysql_query($qry); // mysql_query($qry);
$sql = e107::getDb(); $sql = e107::getDb();
$sql->db_Query($qry); $sql->db_Query($qry);

View File

@ -100,9 +100,9 @@ else
else else
{ {
$sql->db_Select("news_category", "category_id, category_name", "category_id='{$news_category}'"); $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}'"); $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"); $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\"> $print_text = "<span style=\"font-size: 13px; color: black; font-family: tahoma, verdana, arial, helvetica; text-decoration: none\">

View File

@ -190,7 +190,7 @@ else
{ {
$text .= " $text .= "
<select name='cat_id' class='tbox form-control'>"; <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'" : ""; $sel = (varset($_POST['cat_id'],'') == $cat_id) ? "selected='selected'" : "";
$text .= "<option value='{$cat_id}' {$sel}>".$tp->toHTML($cat_name, FALSE, "defs")."</option>"; $text .= "<option value='{$cat_id}' {$sel}>".$tp->toHTML($cat_name, FALSE, "defs")."</option>";

View File

@ -86,7 +86,7 @@ if ($action == 'active')
<th style='width:25%; text-align:center' class='forumheader'>".LAN_5."</th> <th style='width:25%; text-align:center' class='forumheader'>".LAN_5."</th>
</tr>\n"; </tr>\n";
while ($row = $sql->db_Fetch(MYSQL_ASSOC)) while ($row = $sql->fetch())
{ {
if ($row['user_name']) if ($row['user_name'])
{ {
@ -167,7 +167,7 @@ if ($action == 'top')
$sql2 = e107::getDb('sql2'); $sql2 = e107::getDb('sql2');
if ($sql2->gen($qry)) 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 = 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))); $ldata = $rank->getRanks($row, (USER && $forum->isModerator(USERID)));

View File

@ -206,7 +206,7 @@ elseif ($action == 'forums')
$userposts_forum_table_string = ''; $userposts_forum_table_string = '';
while(true) while(true)
{ {
$row = $sql->db_Fetch(MYSQL_ASSOC); $row = $sql->fetch();
if(empty($row)) break; if(empty($row)) break;
$datestamp = $gen->convert_date($row['post_datestamp'], 'short'); $datestamp = $gen->convert_date($row['post_datestamp'], 'short');

View File

@ -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 LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id
WHERE u.user_id=".intval($uuid); WHERE u.user_id=".intval($uuid);
$sql->db_Select_gen($qry); $sql->gen($qry);
$curVal=$sql->db_Fetch(MYSQL_ASSOC); $curVal=$sql->fetch();
$curVal['user_class'] = varset($changedUserData['user_class'], $curVal['user_class']); $curVal['user_class'] = varset($changedUserData['user_class'], $curVal['user_class']);
$curVal['userclass_list'] = $userMethods->addCommonClasses($curVal, FALSE); $curVal['userclass_list'] = $userMethods->addCommonClasses($curVal, FALSE);