mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 05:37:32 +02:00
Deprecated Function cleanup and PHP Notice removal.
This commit is contained in:
18
class2.php
18
class2.php
@@ -1042,7 +1042,7 @@ if(($pref['membersonly_enabled'] && !isset($_E107['allow_guest'])) || ($pref['ma
|
|||||||
|
|
||||||
if(!isset($_E107['no_prunetmp']))
|
if(!isset($_E107['no_prunetmp']))
|
||||||
{
|
{
|
||||||
$sql->db_Delete('tmp', 'tmp_time < '.(time() - 300)." AND tmp_ip!='data' AND tmp_ip!='submitted_link'");
|
$sql->delete('tmp', 'tmp_time < '.(time() - 300)." AND tmp_ip!='data' AND tmp_ip!='submitted_link'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1076,7 +1076,7 @@ if (($_SERVER['QUERY_STRING'] == 'logout')/* || (($pref['user_tracking'] == 'ses
|
|||||||
// TODO - should be done inside online handler, more core areas need it (session handler for example)
|
// TODO - should be done inside online handler, more core areas need it (session handler for example)
|
||||||
if (isset($pref['track_online']) && $pref['track_online'])
|
if (isset($pref['track_online']) && $pref['track_online'])
|
||||||
{
|
{
|
||||||
$sql->db_Update('online', "online_user_id = 0, online_pagecount=online_pagecount+1 WHERE online_user_id = '{$udata}'");
|
$sql->update('online', "online_user_id = 0, online_pagecount=online_pagecount+1 WHERE online_user_id = '{$udata}'");
|
||||||
}
|
}
|
||||||
|
|
||||||
// earlier event trigger with user data still available
|
// earlier event trigger with user data still available
|
||||||
@@ -1505,9 +1505,9 @@ function getperms($arg, $ap = ADMINPERMS)
|
|||||||
$sql = e107::getDb('psql');
|
$sql = e107::getDb('psql');
|
||||||
|
|
||||||
// FIXME - cache it, avoid sql query here
|
// FIXME - cache it, avoid sql query here
|
||||||
if ($sql->db_Select('plugin', 'plugin_id', "plugin_path = '".$matches[2]."' LIMIT 1 "))
|
if ($sql->select('plugin', 'plugin_id', "plugin_path = '".$matches[2]."' LIMIT 1 "))
|
||||||
{
|
{
|
||||||
$row = $sql->db_Fetch();
|
$row = $sql->fetch();
|
||||||
$arg = 'P'.$row['plugin_id'];
|
$arg = 'P'.$row['plugin_id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1603,7 +1603,7 @@ function save_prefs($table = 'core', $uid = USERID, $row_val = '')
|
|||||||
default:
|
default:
|
||||||
$_user_pref = $tp->toDB($user_pref, true, true, 'pReFs');
|
$_user_pref = $tp->toDB($user_pref, true, true, 'pReFs');
|
||||||
$tmp = $eArrayStorage->WriteArray($_user_pref);
|
$tmp = $eArrayStorage->WriteArray($_user_pref);
|
||||||
$sql->db_Update('user', "user_prefs='$tmp' WHERE user_id=".intval($uid));
|
$sql->update('user', "user_prefs='$tmp' WHERE user_id=".intval($uid));
|
||||||
return $tmp;
|
return $tmp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1654,8 +1654,8 @@ class floodprotect
|
|||||||
|
|
||||||
if (FLOODPROTECT == true)
|
if (FLOODPROTECT == true)
|
||||||
{
|
{
|
||||||
$sql->db_Select($table, '*', 'ORDER BY '.$orderfield.' DESC LIMIT 1', 'no_where');
|
$sql->select($table, '*', 'ORDER BY '.$orderfield.' DESC LIMIT 1', 'no_where');
|
||||||
$row=$sql->db_Fetch();
|
$row=$sql->fetch();
|
||||||
return ($row[$orderfield] > (time() - FLOODTIMEOUT) ? false : true);
|
return ($row[$orderfield] > (time() - FLOODTIMEOUT) ? false : true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2055,9 +2055,9 @@ function force_userupdate($currentUser)
|
|||||||
|
|
||||||
if (!e107::getPref('disable_emailcheck',TRUE) && !trim($currentUser['user_email'])) return TRUE;
|
if (!e107::getPref('disable_emailcheck',TRUE) && !trim($currentUser['user_email'])) return TRUE;
|
||||||
|
|
||||||
if(e107::getDb()->db_Select('user_extended_struct', 'user_extended_struct_applicable, user_extended_struct_write, user_extended_struct_name, user_extended_struct_type', 'user_extended_struct_required = 1 AND user_extended_struct_applicable != '.e_UC_NOBODY))
|
if(e107::getDb()->select('user_extended_struct', 'user_extended_struct_applicable, user_extended_struct_write, user_extended_struct_name, user_extended_struct_type', 'user_extended_struct_required = 1 AND user_extended_struct_applicable != '.e_UC_NOBODY))
|
||||||
{
|
{
|
||||||
while($row = e107::getDb()->db_Fetch())
|
while($row = e107::getDb()->fetch())
|
||||||
{
|
{
|
||||||
if (!check_class($row['user_extended_struct_applicable'])) { continue; } // Must be applicable to this user class
|
if (!check_class($row['user_extended_struct_applicable'])) { continue; } // Must be applicable to this user class
|
||||||
if (!check_class($row['user_extended_struct_write'])) { continue; } // And user must be able to change it
|
if (!check_class($row['user_extended_struct_write'])) { continue; } // And user must be able to change it
|
||||||
|
@@ -539,16 +539,16 @@ class admin_shortcodes
|
|||||||
if (e_QUERY == 'logall')
|
if (e_QUERY == 'logall')
|
||||||
{
|
{
|
||||||
$text .= "<div id='adminlog'>";
|
$text .= "<div id='adminlog'>";
|
||||||
$cnt = $sql -> db_Select('admin_log', '*', "ORDER BY `dblog_datestamp` DESC", 'no_where');
|
$cnt = $sql ->select('admin_log', '*', "ORDER BY `dblog_datestamp` DESC", 'no_where');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text .= "<div style='display: none;' id='adminlog'>";
|
$text .= "<div style='display: none;' id='adminlog'>";
|
||||||
$cnt = $sql -> db_Select('admin_log', '*', 'ORDER BY `dblog_datestamp` DESC LIMIT 0,10', 'no_where');
|
$cnt = $sql ->select('admin_log', '*', 'ORDER BY `dblog_datestamp` DESC LIMIT 0,10', 'no_where');
|
||||||
}
|
}
|
||||||
$text .= ($cnt) ? '<ul>' : '';
|
$text .= ($cnt) ? '<ul>' : '';
|
||||||
$gen = e107::getDateConvert();
|
$gen = e107::getDateConvert();
|
||||||
while ($row = $sql -> db_Fetch())
|
while ($row = $sql ->fetch())
|
||||||
{
|
{
|
||||||
$datestamp = $gen->convert_date($row['dblog_datestamp'], 'short');
|
$datestamp = $gen->convert_date($row['dblog_datestamp'], 'short');
|
||||||
$text .= "<li>{$datestamp} - {$row['dblog_title']}</li>";
|
$text .= "<li>{$datestamp} - {$row['dblog_title']}</li>";
|
||||||
@@ -832,7 +832,7 @@ class admin_shortcodes
|
|||||||
$xml->filter = array('@attributes' => FALSE, 'administration' => FALSE); // .. and they're all going to need the same filter
|
$xml->filter = array('@attributes' => FALSE, 'administration' => FALSE); // .. and they're all going to need the same filter
|
||||||
|
|
||||||
$nav_sql = new db;
|
$nav_sql = new db;
|
||||||
if ($nav_sql -> db_Select('plugin', '*', 'plugin_installflag=1'))
|
if ($nav_sql ->select('plugin', '*', 'plugin_installflag=1'))
|
||||||
{
|
{
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
$e107_var['plugm']['text'] = ADLAN_95;
|
$e107_var['plugm']['text'] = ADLAN_95;
|
||||||
@@ -844,7 +844,7 @@ class admin_shortcodes
|
|||||||
$tmp['plugm']['link'] = e_ADMIN.'plugin.php';
|
$tmp['plugm']['link'] = e_ADMIN.'plugin.php';
|
||||||
$tmp['plugm']['perm'] = 'P';
|
$tmp['plugm']['perm'] = 'P';
|
||||||
|
|
||||||
while($rowplug = $nav_sql -> db_Fetch())
|
while($rowplug = $nav_sql ->fetch())
|
||||||
{
|
{
|
||||||
$plugin_id = $rowplug['plugin_id'];
|
$plugin_id = $rowplug['plugin_id'];
|
||||||
$plugin_path = $rowplug['plugin_path'];
|
$plugin_path = $rowplug['plugin_path'];
|
||||||
@@ -897,9 +897,9 @@ class admin_shortcodes
|
|||||||
if (strstr(e_SELF, '/admin.php'))
|
if (strstr(e_SELF, '/admin.php'))
|
||||||
{
|
{
|
||||||
global $sql;
|
global $sql;
|
||||||
if ($sql -> db_Select('plugin', '*', 'plugin_installflag=1'))
|
if ($sql ->select('plugin', '*', 'plugin_installflag=1'))
|
||||||
{
|
{
|
||||||
while($rowplug = $sql -> db_Fetch())
|
while($rowplug = $sql->fetch())
|
||||||
{
|
{
|
||||||
extract($rowplug);
|
extract($rowplug);
|
||||||
if(varset($rowplug[1]))
|
if(varset($rowplug[1]))
|
||||||
|
@@ -30,7 +30,7 @@ function iconpicker_shortcode($parm)
|
|||||||
|
|
||||||
if($sql->gen($qry))
|
if($sql->gen($qry))
|
||||||
{
|
{
|
||||||
while($row = $sql->db_Fetch())
|
while($row = $sql->fetch())
|
||||||
{
|
{
|
||||||
list($tmp,$tmp2,$size) = explode("_",$row['media_category']);
|
list($tmp,$tmp2,$size) = explode("_",$row['media_category']);
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ function imageselector_shortcode($parm = '', $mod = '')
|
|||||||
// FIXME - media_type=image?
|
// FIXME - media_type=image?
|
||||||
if($sql->gen($qry))
|
if($sql->gen($qry))
|
||||||
{
|
{
|
||||||
while($row = $sql->db_Fetch())
|
while($row = $sql->fetch())
|
||||||
{
|
{
|
||||||
//$imagelist[$row['media_category']][$row['media_url']] = $row['media_name']. " (".$row['media_dimensions'].") ";
|
//$imagelist[$row['media_category']][$row['media_url']] = $row['media_name']. " (".$row['media_dimensions'].") ";
|
||||||
$imagelist[$row['media_category']][] = array('path' => $row['media_url'], 'fname' => $row['media_name']. " (".$row['media_dimensions'].") ");
|
$imagelist[$row['media_category']][] = array('path' => $row['media_url'], 'fname' => $row['media_name']. " (".$row['media_dimensions'].") ");
|
||||||
|
@@ -24,12 +24,12 @@ function sublinks_shortcode($parm)
|
|||||||
|
|
||||||
$text = "\n\n<!-- Sublinks Start -->\n\n";
|
$text = "\n\n<!-- Sublinks Start -->\n\n";
|
||||||
$text .= $style['prelink'];
|
$text .= $style['prelink'];
|
||||||
$sql->db_Select("links", "link_id","link_url= '{$page}' AND link_category = {$cat} LIMIT 1");
|
$sql->select("links", "link_id","link_url= '{$page}' AND link_category = {$cat} LIMIT 1");
|
||||||
$row = $sql->db_Fetch();
|
$row = $sql->fetch();
|
||||||
$parent = $row['link_id'];
|
$parent = $row['link_id'];
|
||||||
|
|
||||||
$link_total = $sql->db_Select("links", "*", "link_class IN (".USERCLASS_LIST.") AND link_parent={$parent} ORDER BY link_order ASC");
|
$link_total = $sql->select("links", "*", "link_class IN (".USERCLASS_LIST.") AND link_parent={$parent} ORDER BY link_order ASC");
|
||||||
while($linkInfo = $sql->db_Fetch())
|
while($linkInfo = $sql->fetch())
|
||||||
{
|
{
|
||||||
$text .= $sublinks->makeLink($linkInfo,TRUE, $style, false);
|
$text .= $sublinks->makeLink($linkInfo,TRUE, $style, false);
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ function usersearch_shortcode($parm)
|
|||||||
if($sql->gen($qry))
|
if($sql->gen($qry))
|
||||||
{
|
{
|
||||||
if($emailSrch) $info_field = 'user_email';
|
if($emailSrch) $info_field = 'user_email';
|
||||||
while($row = $sql->db_Fetch())
|
while($row = $sql->fetch())
|
||||||
{
|
{
|
||||||
$ret .= "<li id='{$row['user_id']}'>{$row[$search_field]}<span class='informal'> [{$row['user_id']}] ".$row[$info_field].$email." </span></li>";
|
$ret .= "<li id='{$row['user_id']}'>{$row[$search_field]}<span class='informal'> [{$row['user_id']}] ".$row[$info_field].$email." </span></li>";
|
||||||
}
|
}
|
||||||
|
@@ -94,9 +94,9 @@ class core_news_sef_full_url extends eUrlConfig
|
|||||||
|
|
||||||
$sql = e107::getDb('url');
|
$sql = e107::getDb('url');
|
||||||
$name = e107::getParser()->toDB($name);
|
$name = e107::getParser()->toDB($name);
|
||||||
if($sql->db_Select('news', 'news_id', "news_sef='{$name}'")) // TODO - it'll be news_sef (new) field
|
if($sql->select('news', 'news_id', "news_sef='{$name}'")) // TODO - it'll be news_sef (new) field
|
||||||
{
|
{
|
||||||
$name = $sql->db_Fetch();
|
$name = $sql->fetch();
|
||||||
$request->setRequestParam('name', $name['news_id']);
|
$request->setRequestParam('name', $name['news_id']);
|
||||||
}
|
}
|
||||||
else $request->setRequestParam('name', 0);
|
else $request->setRequestParam('name', 0);
|
||||||
@@ -122,9 +122,9 @@ class core_news_sef_full_url extends eUrlConfig
|
|||||||
|
|
||||||
$sql = e107::getDb('url');
|
$sql = e107::getDb('url');
|
||||||
$id = e107::getParser()->toDB($name);
|
$id = e107::getParser()->toDB($name);
|
||||||
if($sql->db_Select('news_category', 'category_id', "category_sef='{$name}'")) // TODO - it'll be category_sef (new) field
|
if($sql->select('news_category', 'category_id', "category_sef='{$name}'")) // TODO - it'll be category_sef (new) field
|
||||||
{
|
{
|
||||||
$name = $sql->db_Fetch();
|
$name = $sql->fetch();
|
||||||
$request->setRequestParam('name', $name['category_id']);
|
$request->setRequestParam('name', $name['category_id']);
|
||||||
}
|
}
|
||||||
else $request->setRequestParam('name', 0);
|
else $request->setRequestParam('name', 0);
|
||||||
|
@@ -290,9 +290,9 @@ class core_news_sef_noid_url extends eUrlConfig
|
|||||||
$sql = e107::getDb('url');
|
$sql = e107::getDb('url');
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$id = $tp->toDB($id);
|
$id = $tp->toDB($id);
|
||||||
if($sql->db_Select('news', 'news_id', "news_sef='{$id}'"))
|
if($sql->select('news', 'news_id', "news_sef='{$id}'"))
|
||||||
{
|
{
|
||||||
$id = $sql->db_Fetch();
|
$id = $sql->fetch();
|
||||||
return $id['news_id'];
|
return $id['news_id'];
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -304,9 +304,9 @@ class core_news_sef_noid_url extends eUrlConfig
|
|||||||
$sql = e107::getDb('url');
|
$sql = e107::getDb('url');
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$id = $tp->toDB($id);
|
$id = $tp->toDB($id);
|
||||||
if($sql->db_Select('news_category', 'category_id', "category_sef='{$id}'"))
|
if($sql->select('news_category', 'category_id', "category_sef='{$id}'"))
|
||||||
{
|
{
|
||||||
$id = $sql->db_Fetch();
|
$id = $sql->fetch();
|
||||||
return $id['category_id'];
|
return $id['category_id'];
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@@ -92,9 +92,9 @@ class core_user_rewrite_url extends eUrlConfig
|
|||||||
|
|
||||||
$sql = e107::getDb('url');
|
$sql = e107::getDb('url');
|
||||||
$name = e107::getParser()->toDB($name);
|
$name = e107::getParser()->toDB($name);
|
||||||
if($sql->db_Select('user', 'user_id', "user_name='{$name}'")) // XXX - new user_sef field? Discuss.
|
if($sql->select('user', 'user_id', "user_name='{$name}'")) // XXX - new user_sef field? Discuss.
|
||||||
{
|
{
|
||||||
$name = $sql->db_Fetch();
|
$name = $sql->fetch();
|
||||||
$request->setRequestParam('id', $name['user_id']);
|
$request->setRequestParam('id', $name['user_id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -336,14 +336,14 @@ class _system_cron
|
|||||||
$table = $tab[0];
|
$table = $tab[0];
|
||||||
$text = "";
|
$text = "";
|
||||||
|
|
||||||
$sql->db_Select_gen("SHOW CREATE TABLE `".$table."`");
|
$sql->gen("SHOW CREATE TABLE `".$table."`");
|
||||||
$row2 = $sql->db_Fetch();
|
$row2 = $sql->db_Fetch();
|
||||||
$text .= $row2['Create Table'];
|
$text .= $row2['Create Table'];
|
||||||
$text .= ";\n\n";
|
$text .= ";\n\n";
|
||||||
|
|
||||||
ob_end_clean(); // prevent memory exhaustian
|
ob_end_clean(); // prevent memory exhaustian
|
||||||
|
|
||||||
$count = $sql->db_Select_gen("SELECT * FROM `".$table."`");
|
$count = $sql->gen("SELECT * FROM `".$table."`");
|
||||||
$data_array = "";
|
$data_array = "";
|
||||||
|
|
||||||
while($row = $sql->db_Fetch())
|
while($row = $sql->db_Fetch())
|
||||||
|
@@ -44,9 +44,9 @@ class db_table_admin
|
|||||||
$prefix = MPREFIX;
|
$prefix = MPREFIX;
|
||||||
}
|
}
|
||||||
// echo "Get table structure for: {$table_name}, prefix: {$prefix}<br />";
|
// echo "Get table structure for: {$table_name}, prefix: {$prefix}<br />";
|
||||||
$sql->db_Select_gen('SET SQL_QUOTE_SHOW_CREATE = 1');
|
$sql->gen('SET SQL_QUOTE_SHOW_CREATE = 1');
|
||||||
$qry = 'SHOW CREATE TABLE `'.$prefix.$table_name."`";
|
$qry = 'SHOW CREATE TABLE `'.$prefix.$table_name."`";
|
||||||
if (!($z = $sql->db_Select_gen($qry)))
|
if (!($z = $sql->gen($qry)))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -621,7 +621,7 @@ class db_table_admin
|
|||||||
{
|
{
|
||||||
return 'Table doesn\'t exist';
|
return 'Table doesn\'t exist';
|
||||||
}
|
}
|
||||||
if ($sql->db_Select_gen($newStructure[0]))
|
if ($sql->gen($newStructure[0]))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -1271,7 +1271,7 @@ class banlistManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sql->db_Select_gen($qry))
|
if ($sql->gen($qry))
|
||||||
{
|
{
|
||||||
while ($row = $sql->db_Fetch())
|
while ($row = $sql->db_Fetch())
|
||||||
{
|
{
|
||||||
|
@@ -1615,7 +1615,7 @@ class e107MailManager
|
|||||||
$query .= " LIMIT {$start}, {$count}";
|
$query .= " LIMIT {$start}, {$count}";
|
||||||
}
|
}
|
||||||
//echo "{$start}, {$count} Mail query: {$query}<br />";
|
//echo "{$start}, {$count} Mail query: {$query}<br />";
|
||||||
$result = $this->db->db_Select_gen($query);
|
$result = $this->db->gen($query);
|
||||||
if ($result !== FALSE)
|
if ($result !== FALSE)
|
||||||
{
|
{
|
||||||
$this->queryCount[1] = $this->db->total_results; // Save number of records found
|
$this->queryCount[1] = $this->db->total_results; // Save number of records found
|
||||||
@@ -1684,7 +1684,7 @@ class e107MailManager
|
|||||||
$query .= " LIMIT {$start}, {$count}";
|
$query .= " LIMIT {$start}, {$count}";
|
||||||
}
|
}
|
||||||
// echo "{$start}, {$count} Target query: {$query}<br />";
|
// echo "{$start}, {$count} Target query: {$query}<br />";
|
||||||
$result = $this->db2->db_Select_gen($query);
|
$result = $this->db2->gen($query);
|
||||||
if ($result !== FALSE)
|
if ($result !== FALSE)
|
||||||
{
|
{
|
||||||
$this->queryCount[2] = $this->db2->total_results; // Save number of records found
|
$this->queryCount[2] = $this->db2->total_results; // Save number of records found
|
||||||
|
@@ -1934,7 +1934,7 @@ class mailoutAdminClass extends e107MailManager
|
|||||||
|
|
||||||
//Finally - check for inconsistent recipient and content status records -
|
//Finally - check for inconsistent recipient and content status records -
|
||||||
// basically verify counts
|
// basically verify counts
|
||||||
if(($res = $this->db2->db_Select_gen("SELECT COUNT(mr.`mail_status`) AS mr_count, mr.`mail_status`,
|
if(($res = $this->db2->gen("SELECT COUNT(mr.`mail_status`) AS mr_count, mr.`mail_status`,
|
||||||
mc.`mail_source_id`, mc.`mail_togo_count`, mc.`mail_sent_count`, mc.`mail_fail_count`, mc.`mail_bounce_count`, mc.`mail_source_id` FROM `#mail_recipients` AS mr
|
mc.`mail_source_id`, mc.`mail_togo_count`, mc.`mail_sent_count`, mc.`mail_fail_count`, mc.`mail_bounce_count`, mc.`mail_source_id` FROM `#mail_recipients` AS mr
|
||||||
LEFT JOIN `#mail_content` AS mc ON mr.`mail_detail_id` = mc.`mail_source_id`
|
LEFT JOIN `#mail_content` AS mc ON mr.`mail_detail_id` = mc.`mail_source_id`
|
||||||
WHERE mc.`mail_content_status` <= " . MAIL_STATUS_MAX_ACTIVE . "
|
WHERE mc.`mail_content_status` <= " . MAIL_STATUS_MAX_ACTIVE . "
|
||||||
|
@@ -216,7 +216,7 @@ class core_mailout
|
|||||||
|
|
||||||
e107::getMessage()->addDebug("Selector query: ".$qry);
|
e107::getMessage()->addDebug("Selector query: ".$qry);
|
||||||
|
|
||||||
if (!( $this->mail_count = $sql->db_Select_gen($qry))) return FALSE;
|
if (!( $this->mail_count = $sql->gen($qry))) return FALSE;
|
||||||
$this->mail_read = 0;
|
$this->mail_read = 0;
|
||||||
return $this->mail_count;
|
return $this->mail_count;
|
||||||
}
|
}
|
||||||
|
@@ -408,7 +408,7 @@ class e_media
|
|||||||
$query .= " AND ( ".implode(" OR ",$searchinc)." ) " ;
|
$query .= " AND ( ".implode(" OR ",$searchinc)." ) " ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return e107::getDb()->db_Select_gen($query);
|
return e107::getDb()->gen($query);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1676,7 +1676,7 @@ class e_model extends e_object
|
|||||||
/**
|
/**
|
||||||
* Set parameter array
|
* Set parameter array
|
||||||
* Core implemented:
|
* Core implemented:
|
||||||
* - db_query: string db query to be passed to load() ($sql->db_Select_gen())
|
* - db_query: string db query to be passed to load() ($sql->gen())
|
||||||
* - db_query
|
* - db_query
|
||||||
* - db_fields
|
* - db_fields
|
||||||
* - db_where
|
* - db_where
|
||||||
@@ -3237,7 +3237,7 @@ class e_tree_model extends e_front_model
|
|||||||
$sql = e107::getDb($this->getParam('model_class', 'e_model'));
|
$sql = e107::getDb($this->getParam('model_class', 'e_model'));
|
||||||
$this->_total = $sql->total_results = false;
|
$this->_total = $sql->total_results = false;
|
||||||
|
|
||||||
if($sql->db_Select_gen($this->getParam('db_query'), $this->getParam('db_debug') ? true : false))
|
if($sql->gen($this->getParam('db_query'), $this->getParam('db_debug') ? true : false))
|
||||||
{
|
{
|
||||||
$this->_total = is_integer($sql->total_results) ? $sql->total_results : false; //requires SQL_CALC_FOUND_ROWS in query - see db handler
|
$this->_total = is_integer($sql->total_results) ? $sql->total_results : false; //requires SQL_CALC_FOUND_ROWS in query - see db handler
|
||||||
while($tmp = $sql->db_Fetch())
|
while($tmp = $sql->db_Fetch())
|
||||||
|
@@ -1168,41 +1168,46 @@ class e_db_mysql
|
|||||||
switch ($type)
|
switch ($type)
|
||||||
{
|
{
|
||||||
case 'both':
|
case 'both':
|
||||||
case 3:
|
case 3: // MYSQL_BOTH:
|
||||||
$type = ($this->pdo) ? PDO::FETCH_BOTH: MYSQL_BOTH; // 3
|
$type = ($this->pdo) ? PDO::FETCH_BOTH: MYSQL_BOTH; // 3
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'num':
|
case 'num':
|
||||||
case 2:
|
case 2; // MYSQL_NUM: // 2
|
||||||
$type = ($this->pdo) ? PDO::FETCH_NUM : MYSQL_NUM;
|
$type = ($this->pdo) ? PDO::FETCH_NUM : MYSQL_NUM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'assoc':
|
case 'assoc':
|
||||||
case 1:
|
case 1; //: // 1
|
||||||
default:
|
default:
|
||||||
$type = ($this->pdo) ? PDO::FETCH_ASSOC : MYSQL_ASSOC;
|
$type = ($this->pdo) ? PDO::FETCH_ASSOC : MYSQL_ASSOC;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($this->pdo) // convert type to PDO.
|
else
|
||||||
{
|
{
|
||||||
switch ($type)
|
|
||||||
|
if($this->pdo) // convert type to PDO.
|
||||||
{
|
{
|
||||||
case 'both': // 3
|
switch ($type)
|
||||||
$type = PDO::FETCH_BOTH;
|
{
|
||||||
break;
|
case 'both': // 3
|
||||||
case 'num': // 2
|
$type = PDO::FETCH_BOTH;
|
||||||
$type = PDO::FETCH_NUM;
|
break;
|
||||||
break;
|
|
||||||
|
case 'num': // 2
|
||||||
|
$type = PDO::FETCH_NUM;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'assoc': // 1
|
case 'assoc': // 1
|
||||||
default:
|
default:
|
||||||
$type = PDO::FETCH_ASSOC;
|
$type = PDO::FETCH_ASSOC;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$b = microtime();
|
$b = microtime();
|
||||||
if($this->mySQLresult)
|
if($this->mySQLresult)
|
||||||
{
|
{
|
||||||
|
@@ -1796,7 +1796,7 @@ class e107plugin
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'mysql': // all should be lowercase
|
case 'mysql': // all should be lowercase
|
||||||
if (isset($dv['@attributes']['min_version']) && (version_compare($dv['@attributes']['min_version'], mysql_get_server_info(), '<=') === FALSE))
|
if (isset($dv['@attributes']['min_version']) && (version_compare($dv['@attributes']['min_version'], e107::getDb()->mySqlServerInfo(), '<=') === FALSE))
|
||||||
{
|
{
|
||||||
$error[] = EPL_ADLAN_75.$dv['@attributes']['min_version'];
|
$error[] = EPL_ADLAN_75.$dv['@attributes']['min_version'];
|
||||||
$canContinue = FALSE;
|
$canContinue = FALSE;
|
||||||
|
@@ -144,7 +144,7 @@ $total_topics = $sql->count("forum_thread", "(*)");
|
|||||||
$total_replies = $sql->count("forum_post", "(*)");
|
$total_replies = $sql->count("forum_post", "(*)");
|
||||||
$total_members = $sql->count("user");
|
$total_members = $sql->count("user");
|
||||||
$newest_member = $sql->select("user", "*", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1");
|
$newest_member = $sql->select("user", "*", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1");
|
||||||
list($nuser_id, $nuser_name) = $sql->fetch(); // FIXME $nuser_id & $user_name return empty even though print_a($newest_member); returns proper result.
|
list($nuser_id, $nuser_name) = $sql->fetch('num'); // FIXME $nuser_id & $user_name return empty even though print_a($newest_member); returns proper result.
|
||||||
|
|
||||||
if(!defined('e_TRACKING_DISABLED'))
|
if(!defined('e_TRACKING_DISABLED'))
|
||||||
{
|
{
|
||||||
|
@@ -229,7 +229,7 @@
|
|||||||
|
|
||||||
if($user_profile->identifier >0)
|
if($user_profile->identifier >0)
|
||||||
{
|
{
|
||||||
if (!$sql->db_Select("user", "*", "user_xup = '".$prov_id."' ")) // New User
|
if (!$sql->select("user", "*", "user_xup = '".$prov_id."' ")) // New User
|
||||||
{
|
{
|
||||||
$user_join = time();
|
$user_join = time();
|
||||||
$user_pass = md5($user_profile->identifier.$user_join);
|
$user_pass = md5($user_profile->identifier.$user_join);
|
||||||
@@ -245,7 +245,7 @@
|
|||||||
'user_xup' => $prov_id
|
'user_xup' => $prov_id
|
||||||
);
|
);
|
||||||
|
|
||||||
if($newid = $sql->db_Insert('user',$insert,true))
|
if($newid = $sql->insert('user',$insert,true))
|
||||||
{
|
{
|
||||||
e107::getEvent()->trigger('usersup', $insert);
|
e107::getEvent()->trigger('usersup', $insert);
|
||||||
if(!USERID)
|
if(!USERID)
|
||||||
|
@@ -1791,7 +1791,7 @@ if($this->pdo == true)
|
|||||||
|
|
||||||
if(!$link)
|
if(!$link)
|
||||||
{
|
{
|
||||||
return nl2br(LANINS_084."\n\n<b>".LANINS_083."\n</b><i>".mysql_error($link)."</i>");
|
return nl2br(LANINS_084."\n\n<b>".LANINS_083."\n</b><i>".e107::getDb()->getLastErrorText()."</i>");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->dbLink = $link; // Needed for mysql_close() to work round bug in PHP 5.3
|
$this->dbLink = $link; // Needed for mysql_close() to work round bug in PHP 5.3
|
||||||
|
@@ -194,7 +194,7 @@ elseif ($action == 'forums')
|
|||||||
ORDER BY p.post_datestamp DESC LIMIT {$from}, 10
|
ORDER BY p.post_datestamp DESC LIMIT {$from}, 10
|
||||||
";
|
";
|
||||||
|
|
||||||
if (!$sql->db_Select_gen($qry))
|
if (!$sql->gen($qry))
|
||||||
{
|
{
|
||||||
$ftext .= "<span class='mediumtext'>".UP_LAN_8.'</span>';
|
$ftext .= "<span class='mediumtext'>".UP_LAN_8.'</span>';
|
||||||
}
|
}
|
||||||
|
@@ -452,7 +452,7 @@ if ($dataToSave && !$promptPassword)
|
|||||||
validatorClass::addFieldTypes($userMethods->userVettingInfo,$changedData);
|
validatorClass::addFieldTypes($userMethods->userVettingInfo,$changedData);
|
||||||
|
|
||||||
// print_a($changedData);
|
// print_a($changedData);
|
||||||
if (FALSE === $sql->db_Update('user', $changedData))
|
if (FALSE === $sql->update('user', $changedData))
|
||||||
{
|
{
|
||||||
$message .= '<br />'.LAN_USET_43;
|
$message .= '<br />'.LAN_USET_43;
|
||||||
}
|
}
|
||||||
@@ -476,10 +476,10 @@ if ($dataToSave && !$promptPassword)
|
|||||||
if (false === $sql->retrieve('user_extended', 'user_extended_id', 'user_extended_id='.$inp))
|
if (false === $sql->retrieve('user_extended', 'user_extended_id', 'user_extended_id='.$inp))
|
||||||
{
|
{
|
||||||
// ***** Next line creates a record which presumably should be there anyway, so could generate an error if no test first
|
// ***** Next line creates a record which presumably should be there anyway, so could generate an error if no test first
|
||||||
$sql->db_Select_gen("INSERT INTO #user_extended (user_extended_id, user_hidden_fields) values ('".$inp."', '')");
|
$sql->gen("INSERT INTO #user_extended (user_extended_id, user_hidden_fields) values ('".$inp."', '')");
|
||||||
//print_a('New extended fields added: '.$inp.'<br />');
|
//print_a('New extended fields added: '.$inp.'<br />');
|
||||||
}
|
}
|
||||||
if (false === $sql->db_Update('user_extended', $changedEUFData))
|
if (false === $sql->update('user_extended', $changedEUFData))
|
||||||
{
|
{
|
||||||
$message .= '<br />Error updating EUF';
|
$message .= '<br />Error updating EUF';
|
||||||
}
|
}
|
||||||
@@ -582,7 +582,7 @@ if ($dataToSave && !$promptPassword)
|
|||||||
// If user has changed display name, update the record in the online table
|
// If user has changed display name, update the record in the online table
|
||||||
if (isset($changedUserData['user_name']) && !$_uid)
|
if (isset($changedUserData['user_name']) && !$_uid)
|
||||||
{
|
{
|
||||||
$sql->db_Update('online', "online_user_id = '".USERID.".".$changedUserData['user_name']."' WHERE online_user_id = '".USERID.".".USERNAME."'");
|
$sql->update('online', "online_user_id = '".USERID.".".$changedUserData['user_name']."' WHERE online_user_id = '".USERID.".".USERNAME."'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user