1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-16 20:28:28 +01:00

Code cleanup and optimization

This commit is contained in:
Cameron 2020-12-14 16:21:48 -08:00
parent c258b856f2
commit 44e260b121
81 changed files with 747 additions and 722 deletions

View File

@ -1717,7 +1717,7 @@ if(isset($page_title[$action]))
}
// Now put up the events
$delete_button = FALSE;
while($row = $sql->db_Fetch())
while($row = $sql->fetch())
{
$text .= '<tr>';
foreach($col_fields[$action] as $cf)

View File

@ -64,8 +64,8 @@ if (isset($_POST['edit_admin']) || $action == "edit")
{
$edid = array_keys($_POST['edit_admin']);
$theid = intval(($sub_action < 0) ? $edid[0] : $sub_action);
if ((!$sql->db_Select("user", "*", "user_id=".$theid))
|| !($row = $sql->db_Fetch()))
if ((!$sql->select("user", "*", "user_id=".$theid))
|| !($row = $sql->fetch()))
{
$mes->addDebug("Couldn't find user ID: {$theid}, {$sub_action}, {$edid[0]}"); // Debug code - shouldn't be executed
}
@ -76,8 +76,8 @@ if (isset($_POST['del_admin']) && count($_POST['del_admin']))
{
$delid = array_keys($_POST['del_admin']);
$aID = intval($delid[0]);
$sql->db_Select("user", "*", "user_id= ".$aID);
$row = $sql->db_Fetch();
$sql->select("user", "*", "user_id= ".$aID);
$row = $sql->fetch();
if ($row['user_id'] == 1)
{ // Can't delete main admin
@ -92,7 +92,7 @@ if (isset($_POST['del_admin']) && count($_POST['del_admin']))
exit;
}
$mes->addAuto($sql -> db_Update("user", "user_admin=0, user_perms='' WHERE user_id= ".$aID), 'update', ADMSLAN_61, LAN_DELETED_FAILED, false);
$mes->addAuto($sql->update("user", "user_admin=0, user_perms='' WHERE user_id= ".$aID), 'update', ADMSLAN_61, LAN_DELETED_FAILED, false);
$logMsg = str_replace(array('[x]', '[y]'),array($aID, $row['user_name']),ADMSLAN_73);
e107::getLog()->add('ADMIN_02',$logMsg,E_LOG_INFORMATIVE,'');
}

View File

@ -186,7 +186,7 @@ else
if (in_array(varset($pref['user_audit_class'], ''), $class_list))
{
e107::getAdminLog()->user_audit(USER_AUDIT_LOGIN, 'Login via admin page', $row['user_id'], $row['user_name']);
e107::getAdminLog()->user_audit(USER_AUDIT_LOGIN, ['Login via admin page'], $row['user_id'], $row['user_name']);
}
$edata_li = array("user_id"=>$row['user_id'], "user_name"=>$row['user_name'], 'class_list'=>implode(',', $class_list), 'user_admin'=> $row['user_admin']);
@ -412,7 +412,8 @@ class auth
* @param string $authname, entered name
* @param string $authpass, entered pass
* @param object $authresponse [optional]
* @return boolean if fail, else result array
* @return array if fail, 'authfail' will contain a message.
*
*/
public function authcheck($authname, $authpass, $authresponse = '')
{

View File

@ -1138,7 +1138,7 @@ if ($writeBanFile)
if ($action == 'edit' || $action == 'whedit')
{
$sql->db_Select('banlist', '*', "banlist_ip='{$sub_action}'");
$row = $sql->db_Fetch();
$row = $sql->fetch();
extract($row); //FIXME - kill extract()
}
else
@ -1726,7 +1726,7 @@ switch ($action)
$text .= "</tr>
</thead>
<tbody>";
while($row = $sql->db_Fetch())
while($row = $sql->fetch())
{
//extract($row);//FIXME - kill extract()
$row['banlist_reason'] = str_replace('LAN_LOGIN_18', BANLAN_11, $row['banlist_reason']);
@ -1863,7 +1863,7 @@ function process_csv($filename, $override_imports, $override_expiry, $separator
// echo "Read CSV: {$filename} separator: {$separator}, quote: {$quote} override imports: {$override_imports} override expiry: {$override_expiry}<br />";
// Renumber imported bans
if ($override_imports)
$sql->db_Update('banlist', "`banlist_bantype`=".eIPHandler::BAN_TYPE_TEMPORARY." WHERE `banlist_bantype` = ".eIPHandler::BAN_TYPE_IMPORTED);
$sql->update('banlist', "`banlist_bantype`=".eIPHandler::BAN_TYPE_TEMPORARY." WHERE `banlist_bantype` = ".eIPHandler::BAN_TYPE_IMPORTED);
$temp = file($filename);
$line_num = 0;
foreach ($temp as $line)
@ -1932,7 +1932,7 @@ function process_csv($filename, $override_imports, $override_expiry, $separator
}
// Success here - may need to delete old imported bans
if ($override_imports)
$sql->db_Delete('banlist', "`banlist_bantype` = ".eIPHandler::BAN_TYPE_TEMPORARY);
$sql->delete('banlist', "`banlist_bantype` = ".eIPHandler::BAN_TYPE_TEMPORARY);
@unlink($filename); // Delete file once done
$mes->addSuccess(str_replace('[y]', $line_num, BANLAN_51).$filename);
return str_replace('[y]', $line_num, BANLAN_51).$filename;

View File

@ -79,7 +79,7 @@ function do_export($filename, $type_list='',$format_array=array(), $sep = ',', $
$qry = "SELECT * FROM `#banlist` ";
if ($type_list != '') $qry .= " WHERE`banlist_bantype` IN ({$type_list})";
if (!$sql->gen($qry)) return 'No data: '.$qry;
while ($row = $sql->db_Fetch())
while ($row = $sql->fetch())
{
$line = '';
$spacer = '';

View File

@ -507,7 +507,7 @@ class media_form_ui extends e_admin_form_ui
if($this->resizeImage($path,$img_import_w,$img_import_h))
{
$info = $fl->get_file_info($path);
$info = $fl->getFileInfo($path);
$mes->addSuccess(LAN_IMA_004.": ".basename($path));
$mes->addSuccess(print_a($info,true));
$dim = intval($info['img-width'])." x ".intval($info['img-height']);
@ -3045,7 +3045,7 @@ class media_admin_ui extends e_admin_ui
$f = e107::getFile()->get_file_info($oldpath,TRUE);
$mes->addDebug("checkDupe(): newpath=".$newpath."<br />oldpath=".$oldpath."<br />".print_r($newpath,TRUE));
if(file_exists($newpath) || e107::getDb()->db_Select("core_media","*","media_url = '".$tp->createConstants($newpath,'rel')."' LIMIT 1") )
if(file_exists($newpath) || e107::getDb()->select("core_media","*","media_url = '".$tp->createConstants($newpath,'rel')."' LIMIT 1") )
{
$mes->addWarning($newpath." already exists.");
$file = $f['pathinfo']['filename']."_.".$f['pathinfo']['extension'];
@ -3594,7 +3594,7 @@ if (isset($_POST['submit_show_deleteall']))
{
$image_name = basename($image_name);
$image_todb = $tp->toDB($image_name);
if (!$sql->db_Count('user', '(*)', "WHERE user_image='-upload-{$image_todb}' OR user_sess='{$image_todb}'")) {
if (!$sql->count('user', '(*)', "WHERE user_image='-upload-{$image_todb}' OR user_sess='{$image_todb}'")) {
unlink(e_AVATAR_UPLOAD.$image_name);
$imgList .= '[!br!]'.$image_name;
$count++;
@ -3626,7 +3626,7 @@ if (isset($_POST['submit_avdelete_multi']))
$multiaction = $tp->filter($_POST['multiaction'], 'int');
//sql queries significant reduced
if(!empty($multiaction) && $sql->db_Select("user", 'user_id, user_name, user_image', "user_id IN (".implode(',', $multiaction).")"))
if(!empty($multiaction) && $sql->select("user", 'user_id, user_name, user_image', "user_id IN (".implode(',', $multiaction).")"))
{
$search_users = $sql->db_getList('ALL', FALSE, FALSE, 'user_id');
foreach($multiaction as $uid)
@ -3648,7 +3648,7 @@ if (isset($_POST['submit_avdelete_multi']))
//sql queries significant reduced
if(!empty($uids))
{
$sql->db_Update("user", "user_image='' WHERE user_id IN (".implode(',', $uids).")");
$sql->update("user", "user_image='' WHERE user_id IN (".implode(',', $uids).")");
}
$mes->addSuccess(IMALAN_51.'<strong>'.implode(', ', $tmp).'</strong> '.IMALAN_28);
@ -3703,13 +3703,13 @@ if (isset($_POST['check_avatar_sizes']))
//
// Loop through avatar field for every user
//
$iUserCount = $sql->db_Count("user");
$iUserCount = $sql->count("user");
$found = false;
$allowedWidth = intval($pref['im_width']);
$allowedHeight = intval($pref['im_width']);
if ($sql->db_Select("user", "*", "user_image!=''")) {
if ($sql->select("user", "*", "user_image!=''")) {
while ($row = $sql->db_Fetch())
while ($row = $sql->fetch())
{
//Check size
$avname=avatar($row['user_image']);

View File

@ -692,7 +692,7 @@ class adminstyle_infopanel
if (e107::getDb()->gen($menu_qry))
{
while ($row = e107::getDb()->db_Fetch())
while ($row = e107::getDb()->fetch())
{
// Custom menu (core).
if(is_numeric($row['menu_path']))

View File

@ -661,9 +661,9 @@ class links_admin_form_ui extends e_admin_form_ui
{
if(null === $this->current_parent)
{
if(e107::getDb()->db_Select('links', 'link_name', 'link_id='.$current))
if(e107::getDb()->select('links', 'link_name', 'link_id='.$current))
{
$tmp = e107::getDb()->db_Fetch();
$tmp = e107::getDb()->fetch();
$this->current_parent = $tmp['link_name'];
}
}

View File

@ -1337,7 +1337,7 @@ class news_admin_ui extends e_admin_ui
$_POST['cat_id'] = $row['news_category'];
$_POST['news_start'] = $row['news_start'];
$_POST['news_end'] = $row['news_end'];
$_POST['comment_total'] = e107::getDb()->db_Count("comments", "(*)", " WHERE comment_item_id={$row['news_id']} AND comment_type='0'");
$_POST['comment_total'] = e107::getDb()->count("comments", "(*)", " WHERE comment_item_id={$row['news_id']} AND comment_type='0'");
$_POST['news_render_type'] = $row['news_render_type'];
$_POST['news_thumbnail'] = $row['news_thumbnail'];
$_POST['news_meta_keywords'] = $row['news_meta_keywords'];

View File

@ -136,9 +136,9 @@ if (isset($_POST['update_handler']))
$search_prefs[$handler_type][$query[2]]['pre_title_alt'] = $tp -> toDB($_POST['pre_title_alt']);
// $tmp = addslashes(serialize($search_prefs));
$tmp = e107::getArrayStorage()->writeArray($search_prefs, true);
$tmp = e107::serialize($search_prefs, true);
$check = $sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'");
$check = $sql ->update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'");
if($check)
{
$mes->addSuccess(LAN_UPDATED);

View File

@ -1006,11 +1006,11 @@ function update_706_to_800($type='')
// Leave this one here.. just in case..
//delete record for online_extended_menu (now only using one online menu)
if($sql->db_Select('menus', '*', "menu_path='online_extended_menu' || menu_path='online_extended_menu/'"))
if($sql->select('menus', '*', "menu_path='online_extended_menu' || menu_path='online_extended_menu/'"))
{
if ($just_check) return update_needed("The Menu table needs to have some paths corrected in its data.");
$row=$sql->db_Fetch();
$row=$sql->fetch();
//if online_extended is activated, we need to activate the new 'online' menu, and delete this record
if($row['menu_location']!=0)
@ -1028,7 +1028,7 @@ function update_706_to_800($type='')
}
//change menu_path for online_menu (if it still exists)
if($sql->db_Select('menus', 'menu_path', "menu_path='online_menu' || menu_path='online_menu/'"))
if($sql->select('menus', 'menu_path', "menu_path='online_menu' || menu_path='online_menu/'"))
{
if ($just_check) return update_needed('change menu_path for online menu');
@ -1961,7 +1961,7 @@ function update_70x_to_706($type='')
if ($sql -> db_Query("SHOW INDEX FROM ".MPREFIX."tmp"))
{
$row = $sql -> db_Fetch();
$row = $sql ->fetch();
if (!in_array('tmp_ip', $row))
{
if ($just_check) return update_needed();
@ -2027,9 +2027,9 @@ function copy_user_timezone()
e107::getMessage()->addDebug("Line:".__LINE__);
// Created the field - now copy existing data
if ($sql->db_Select('user','user_id, user_timezone'))
if ($sql->select('user','user_id, user_timezone'))
{
while ($row = $sql->db_Fetch())
while ($row = $sql->fetch())
{
$sql2->update('user_extended',"`user_timezone`='{$row['user_timezone']}' WHERE `user_extended_id`={$row['user_id']}");
}
@ -2075,7 +2075,7 @@ function addIndexToTable($target, $indexSpec, $just_check, &$updateMessages, $op
if ($sql->gen("SHOW INDEX FROM ".MPREFIX.$target))
{
$found = FALSE;
while ($row = $sql -> db_Fetch())
while ($row = $sql ->fetch())
{ // One index per field
if (in_array($indexSpec, $row))
{

View File

@ -523,8 +523,8 @@ if (e_QUERY)
if ($action == "dis" && isset($_POST['updelete']['upload_'.$id]) )
{
$res = $sql -> db_Select("upload", "*", "upload_id='".intval($id)."'");
$row = $sql -> db_Fetch();
$res = $sql ->select("upload", "*", "upload_id='".intval($id)."'");
$row = $sql ->fetch();
if (preg_match("#Binary (.*?)/#", $row['upload_file'], $match))
{
$sql -> db_Delete("rbinary", "binary_id='".$tp -> toDB($match[1])."'");
@ -535,7 +535,7 @@ if ($action == "dis" && isset($_POST['updelete']['upload_'.$id]) )
}
if (preg_match("#Binary (.*?)/#", $row['upload_ss'], $match))
{
$sql -> db_Delete("rbinary", "binary_id='".$tp -> toDB($match[1])."'");
$sql ->delete("rbinary", "binary_id='".$tp -> toDB($match[1])."'");
}
else if ($row['upload_ss'] && file_exists(e_FILE."public/".$row['upload_ss']))
{

View File

@ -1951,7 +1951,7 @@ class users_admin_ui extends e_admin_ui
}
// TODO - move to e_userinfo.php
$obj = new convert;
$sql->db_Select("chatbox", "*", "cb_ip='$ipd' LIMIT 0,20");
$sql->select("chatbox", "*", "cb_ip='$ipd' LIMIT 0,20");
$host = $e107->get_host_name($ipd);
$text = USFLAN_3." <b>".$ipd."</b> [ ".USFLAN_4.": $host ]<br />
<i><a href=\"banlist.php?".$ipd."\">".USFLAN_5."</a></i>
@ -1974,7 +1974,7 @@ class users_admin_ui extends e_admin_ui
$text .= "<hr />";
$sql->db_Select("comments", "*", "comment_ip='$ipd' LIMIT 0,20");
$sql->select("comments", "*", "comment_ip='$ipd' LIMIT 0,20");
while (list($comment_id, $comment_item_id, $comment_author, $comment_author_email, $comment_datestamp, $comment_comment, $comment_blocked, $comment_ip) = $sql->fetch())
{
$datestamp = $obj->convert_date($comment_datestamp, "short");

View File

@ -1634,6 +1634,7 @@ Inverse 10 <span class="badge badge-inverse">10</span>
/**
* Old Admin Navigation Routine.
*/
/*
function sc_admin_navigationOld($parm=null)
{
@ -1902,7 +1903,7 @@ Inverse 10 <span class="badge badge-inverse">10</span>
return e107::getNav()->admin('', $active, $menu_vars, $$tmpl, FALSE, FALSE);
//return e_admin_men/u('', e_PAGE, $menu_vars, $$tmpl, FALSE, FALSE);
}
*/
/**
* New Admin Navigation Routine. v2.1.5

View File

@ -317,14 +317,11 @@ class user_shortcodes extends e_shortcode
case 'location':
return ($boot) ? $tp->toGlyph('fa-map-marker') : '';
break;
case 'msn':
case 'icq':
return ($boot) ? $tp->toGlyph('fa-comment') : '';
break;
case 'msn':
return ($boot) ? $tp->toGlyph('fa-comment') : '';
break;
break;
default:
case 'realname':

View File

@ -126,7 +126,7 @@ $nbr_cols = (defined("NEWSCAT_COLS")) ? NEWSCAT_COLS : $nbr_cols;
return '';
}
$cats = array();
while ($row = $sql2->db_Fetch())
while ($row = $sql2->fetch())
{
if($row['ccount'] > 0) $cats[$row['category_id']] = $row;
}

View File

@ -117,9 +117,9 @@ if ($parms[1] == 'value')
case EUF_DB_FIELD : // check for db_lookup type
$tmp = explode(',',$ueStruct['user_'.$parms[0]]['user_extended_struct_values']);
$sql_ue = new db; // Use our own DB object to avoid conflicts
if($sql_ue->db_Select($tmp[0],"{$tmp[1]}, {$tmp[2]}","{$tmp[1]} = '{$uVal}'"))
if($sql_ue->select($tmp[0],"{$tmp[1]}, {$tmp[2]}","{$tmp[1]} = '{$uVal}'"))
{
$row = $sql_ue->db_Fetch();
$row = $sql_ue->fetch();
$ret_data = $row[$tmp[2]];
}
else

View File

@ -415,7 +415,7 @@ class e_admin_log
* @param array $event_data is an array of data fields whose keys and values are logged (usually user data, but doesn't have to be - can add messages here)
* @param int $id
* @param string $u_name
* both $id and $u_name are left blank except for admin edits and user login, where they specify the id and login name of the 'target' user
* both $id and $u_name are left blank except for admin edits and user login, where they specify the id and login name of the 'target' user
*
* @return bool
*/

View File

@ -577,21 +577,15 @@ class e_chart
$js .= 'var myLine = new Chart(document.getElementById("'.$id.'").getContext("2d")).Bar(ChartData, ChartOptions);';
break;
case 'radar':
//TODO
break;
case 'polar':
case 'pie':
case 'radar':
//TODO
break;
case 'doughnut':
$js .= 'var myDoughnut = new Chart(document.getElementById("'.$id.'").getContext("2d")).Doughnut(ChartData, ChartOptions);';
break;
case 'pie':
//TODO
break;
default:
case 'line':

View File

@ -1464,7 +1464,7 @@ class comment
}
}
cachevars('e_comment', $data);
e107::setRegistry('e_comment', $data);
return $data;
}
}

View File

@ -152,10 +152,9 @@ function print_a($var, $return = FALSE)
echo '<pre>'.htmlspecialchars(print_r($var, TRUE), ENT_QUOTES, 'utf-8').'</pre>';
return TRUE;
}
else
{
return '<pre>'.htmlspecialchars(print_r($var, true), ENT_QUOTES, 'utf-8').'</pre>';
}
return '<pre>'.htmlspecialchars(print_r($var, true), ENT_QUOTES, 'utf-8').'</pre>';
}
function e_print($expr = null)
@ -186,14 +185,13 @@ function e_dump($expr = null)
*/
function strip_if_magic($data)
{
if (MAGIC_QUOTES_GPC == true)
if (MAGIC_QUOTES_GPC === true)
{
return array_stripslashes($data);
}
else
{
return $data;
}
return $data;
}
/**
@ -272,9 +270,8 @@ function echo_gzipped_page()
if($encoding)
{
$contents = ob_get_contents();
ob_end_clean();
header('Content-Encoding: '.$encoding);
$contents = ob_get_clean();
header('Content-Encoding: '.$encoding);
print("\x1f\x8b\x08\x00\x00\x00\x00\x00");
$size = strlen($contents);
$contents = gzcompress($contents, 9);
@ -282,11 +279,10 @@ function echo_gzipped_page()
print($contents);
exit();
}
else
{
ob_end_flush();
exit();
}
ob_end_flush();
exit();
}
@ -336,7 +332,7 @@ if (!function_exists('r_emote'))
$value2 = substr($value, 0, strpos($value, " "));
$value = ($value2 ? $value2 : $value);
$value = ($value == '&|') ? ':((' : $value;
$value = ($value === '&|') ? ':((' : $value;
$value = " ".$value." ";
// $str .= "\n<a class='addEmote' data-emote=\"".$value."\" href=\"javascript:addtext('$value',true)\"><img src='$key' alt='' /></a> ";
@ -388,12 +384,12 @@ if (!function_exists('multiarray_sort'))
if(!$natsort)
{
($order=='asc')? asort($sort_values) : arsort($sort_values);
($order==='asc')? asort($sort_values) : arsort($sort_values);
}
elseif(isset($sort_values))
{
$case ? natsort($sort_values) : natcasesort($sort_values);
if($order != 'asc') $sort_values = array_reverse($sort_values, true);
if($order !== 'asc') $sort_values = array_reverse($sort_values, true);
}
@ -445,8 +441,9 @@ class e_array {
return false;
}
// Saftety mechanism for 0.7 -> 0.8 transition.
if(substr($ArrayData,0,2)=='a:' || substr($ArrayData,0,2)=='s:') // php serialize.
// Saftety mechanism for 0.7 -> 0.8 transition.
$first2Chars = substr($ArrayData,0,2);
if($first2Chars === 'a:' || $first2Chars === 's:') // php serialize.
{
$dat = unserialize($ArrayData);
$ArrayData = $this->WriteArray($dat,FALSE);
@ -457,7 +454,7 @@ class e_array {
// e107::getDebug()->log("Json data found");
if(json_last_error() != JSON_ERROR_NONE && e_DEBUG === true && !e107::isCli())
if(e_DEBUG === true && json_last_error() != JSON_ERROR_NONE && !e107::isCli())
{
echo "<div class='alert alert-danger'><h4>e107::unserialize() Parser Error (json)</h4></div>";
echo "<pre>";
@ -478,12 +475,12 @@ class e_array {
$ArrayData = (string) substr($ArrayData,8);
}
if(strtolower(substr($ArrayData,0,5)) != 'array')
if(strtolower(substr($ArrayData,0,5)) !== 'array')
{
return false;
}
if(strpos($ArrayData,"0 => \'")!=false)
if(strpos($ArrayData,"0 => \'")!==false)
{
$ArrayData = stripslashes($ArrayData);
}
@ -495,7 +492,7 @@ class e_array {
$ArrayData = str_replace('=&gt;','=>',$ArrayData); //FIX for PDO encoding of strings. .
if(trim($ArrayData) == 'Array') // Something went wrong with storage.
if(trim($ArrayData) === 'Array') // Something went wrong with storage.
{
$debug = debug_backtrace(false);
e107::getMessage()->addDebug("Bad Array Storage found: ". print_a($debug,true));
@ -586,7 +583,7 @@ class e_array {
$Array = var_export($ArrayData, true);
if ($mode == true)
if ($mode === true)
{
$Array = addslashes($Array);
}

View File

@ -1136,7 +1136,7 @@ class db_verify
function getSqlLanguages()
{
$sql = e107::getDb();
$list = $sql->db_TableList('lan');
$list = $sql->tables('lan');
$array = array();

View File

@ -3296,7 +3296,7 @@ class e107
$cstring = 'corelan/'.e_LANGUAGE.'_'.$fname.($admin ? '_admin' : '_front');
if(self::getRegistry($cstring)) return null;
$fname = ($admin ? 'admin/' : '').'lan_'.preg_replace('/[^\w]/', '', trim($fname, '/')).'.php';
$fname = ($admin ? 'admin/' : '').'lan_'.preg_replace('/[\W]/', '', trim($fname, '/')).'.php';
$path = e_LANGUAGEDIR.e_LANGUAGE.'/'.$fname;
self::setRegistry($cstring, true);
@ -3337,7 +3337,7 @@ class e107
$cstring = 'pluglan/'.e_LANGUAGE.'_'.$plugin.'_'.$fname.($flat ? '_1' : '_0');
if(self::getRegistry($cstring)) return null;
$plugin = preg_replace('/[^\w]/', '', $plugin);
$plugin = preg_replace('/[\W]/', '', $plugin);
if($fname === 'global') // fix ambiguity
{
@ -4927,7 +4927,7 @@ class e107
/**
* Retrieve & cache host name
* @deprecated but needed by some old plugins/menus.
* @deprecated Use getIPHandler()->get_host_name() instead. Still needed by some old plugins/menus.
* @todo Find old calls and replace with code within.
* @param string $ip_address
* @return string host name

File diff suppressed because it is too large Load Diff

View File

@ -124,9 +124,9 @@ class e_upgrade
{
$pref = e107::getPref();
$sql = e107::getDB();
if($sql -> db_Select_Gen("SELECT * FROM #plugin WHERE plugin_installflag = 1 AND plugin_releaseUrl !=''"))
if($sql ->gen("SELECT * FROM #plugin WHERE plugin_installflag = 1 AND plugin_releaseUrl !=''"))
{
while($row = $sql-> db_Fetch())
while($row = $sql->fetch())
{
$options = array('curFolder' => $row['plugin_path'], 'curVersion' => $row['plugin_version'], 'releaseUrl' => $row['plugin_releaseUrl']);
$this->setOptions($options);

View File

@ -3647,29 +3647,22 @@ var_dump($select_options);*/
case 'create':
case 'import':
case 'submit':
case 'execute':
case 'success':
$class = 'btn-success';
break;
case 'checkall':
$class = 'btn-default';
break;
case 'cancel':
$class = 'btn-default';
break;
case 'delete':
case 'danger':
$class = 'btn-danger';
break;
case 'execute':
$class = 'btn-success';
break;
case 'other':
case 'login':
case 'batch e-hide-if-js':
case 'filter e-hide-if-js':
case 'batch':
case 'filter':
case 'primary':
$class = 'btn-primary';
break;
@ -3679,17 +3672,9 @@ var_dump($select_options);*/
$class = 'btn-warning';
break;
case 'batch':
case 'batch e-hide-if-js':
$class = 'btn-primary';
break;
case 'filter':
case 'filter e-hide-if-js':
$class = 'btn-primary';
break;
case 'default':
case 'checkall':
case 'cancel':
default:
$class = 'btn-default';
break;

View File

@ -1369,7 +1369,7 @@ class banlistManager
if ($sql->gen($qry))
{
while ($row = $sql->db_Fetch())
while ($row = $sql->fetch())
{
$row['banlist_ip'] = $this->trimWildcard($row['banlist_ip']);
if ($row['banlist_ip'] == '') continue; // Ignore empty IP addresses
@ -1655,7 +1655,7 @@ class banlistManager
if ($row = $ourDb->fetch())
{
// @todo check next line
$writeDb->db_Update('banlist',
$writeDb->update('banlist',
'`banlist_banexpires` = '.intval($row['banlist_banexpires'] + $pref['ban_durations'][$row['banlist_banreason']]));
$numRet++;
}

View File

@ -692,11 +692,8 @@ class e_jsmanager
case 'front':
return ($this->isInAdmin()) ? true : false;
break;
case 'none':
return true;
break;
default:
return true;
break;

View File

@ -1672,7 +1672,7 @@ class e107MailManager
*/
public function getNextEmailStatus()
{
$result = $this->db->db_Fetch();
$result = $this->db->fetch();
if (is_array($result)) { return $this->dbToMail($result); }
return FALSE;
}
@ -1742,7 +1742,7 @@ class e107MailManager
*/
public function getNextTargetStatus()
{
$result = $this->db2->db_Fetch();
$result = $this->db2->fetch();
if (is_array($result)) { return $this->dbToTarget($result); }
return FALSE;
}

View File

@ -227,7 +227,7 @@ class core_mailout
{
$sql = e107::getDb();
if (!($row = $sql->db_Fetch())) return FALSE;
if (!($row = $sql->fetch())) return FALSE;
$ret = array('mail_recipient_id' => $row['user_id'],
'mail_recipient_name' => $row['user_name'], // Should this use realname?
'mail_recipient_email' => $row['user_email'],

View File

@ -905,7 +905,7 @@ class e_media
$sql = e107::getDb();
// $mes->addDebug("checkDupe(): newpath=".$newpath."<br />oldpath=".$oldpath."<br />".print_r($upload,TRUE));
if(file_exists($newpath) && ($f = e107::getFile()->get_file_info($oldpath,TRUE)))
if(file_exists($newpath) && ($f = e107::getFile()->getFileInfo($oldpath,TRUE)))
{
$this->log($newpath." already exists and will be renamed during import.");
$mes->addWarning($newpath." already exists and was renamed during import.");
@ -1262,10 +1262,8 @@ class e_media
return FALSE;
}
$info = e107::getFile()->get_file_info($path);
$info = e107::getFile()->getFileInfo($path);
$this->log("File info for $path : ".print_r($info,true));
return array(

View File

@ -61,7 +61,7 @@ class e_menu
* Constructor
*
*/
function __construct()
public function __construct()
{
}
@ -80,13 +80,13 @@ class e_menu
}
// print_a($eMenuArea);
if(varset($_SERVER['E_DEV_MENU']) == 'true') // New in v2.x Experimental
if(varset($_SERVER['E_DEV_MENU']) === 'true') // New in v2.x Experimental
{
$layouts = e107::getPref('menu_layouts');
if(!is_array($layouts))
{
$converted = $this->convertMenuTable();
e107::getConfig('core')->set('menu_layouts', $converted)->save();
e107::getConfig()->set('menu_layouts', $converted)->save();
}
$eMenuArea = $this->getData(THEME_LAYOUT);
@ -145,7 +145,7 @@ class e_menu
{
$layout = vartrue($row['menu_layout'],'default');
$location = $row['menu_location'];
$data[$layout][$location][] = array('name'=>$row['menu_name'],'class'=> intval($row['menu_class']),'path'=>$row['menu_path'],'pages'=>$row['menu_pages'],'parms'=>$row['menu_parms']);
$data[$layout][$location][] = array('name'=>$row['menu_name'],'class'=> (int)$row['menu_class'],'path'=>$row['menu_path'],'pages'=>$row['menu_pages'],'parms'=>$row['menu_parms']);
}
return $data;
@ -203,6 +203,8 @@ class e_menu
{
return array();
}
$ret = array();
foreach($mpref[$layout] as $area=>$v)
{
@ -210,7 +212,7 @@ class e_menu
foreach($v as $val)
{
$class = intval($val['class']);
$class = (int)$val['class'];
if(!check_class($class))
{
@ -255,7 +257,7 @@ class e_menu
public function setParms($plugin, $menu, $parms=array(), $location = 'all')
{
$qry = 'menu_parms="'.e107::serialize($parms).'" WHERE menu_parms="" AND menu_path="'.$plugin.'/" AND menu_name="'.$menu.'" ';
$qry .= ($location != 'all') ? 'menu_location='.intval($location) : '';
$qry .= ($location !== 'all') ? 'menu_location='. (int)$location : '';
return e107::getDb()->update('menus', $qry);
}
@ -414,7 +416,7 @@ class e_menu
* Returns true if a menu is currently active.
* @param string $menuname (without the '_menu.php' )
*/
function isLoaded($menuname)
public function isLoaded($menuname)
{
if(empty($menuname))
{
@ -440,12 +442,7 @@ class e_menu
protected function isFrontPage()
{
if(e_REQUEST_SELF == SITEURL)
{
return true;
}
return false;
return e_REQUEST_SELF == SITEURL;
}
@ -481,7 +478,7 @@ class e_menu
foreach($pagelist as $p)
{
if($p == 'FRONTPAGE' && $this->isFrontPage())
if($p === 'FRONTPAGE' && $this->isFrontPage())
{
$show_menu = true;
break;
@ -508,7 +505,7 @@ class e_menu
$show_menu = true;
foreach($pagelist as $p)
{
if($p == 'FRONTPAGE' && $this->isFrontPage())
if($p === 'FRONTPAGE' && $this->isFrontPage())
{
$show_menu = false;
break;
@ -516,7 +513,7 @@ class e_menu
$p = $tp->replaceConstants($p, 'full');
if(substr($p, -1)=='!')
if(substr($p, -1) === '!')
{
$p = substr($p, 0, -1);
if(substr($check_url, strlen($p)*-1) == $p)
@ -558,7 +555,7 @@ class e_menu
$buffer_output = (E107_DBG_INCLUDES) ? false : true; // Turn off when trouble-shooting includes. Default - return all output.
if(isset($tmp[1])&&$tmp[1]=='echo')
if(isset($tmp[1])&&$tmp[1] === 'echo')
{
$buffer_output = false;
}
@ -580,9 +577,7 @@ class e_menu
e107::getRender()->eMenuArea = null;
if($buffer_output)
{
$ret = ob_get_contents();
ob_end_clean();
return $ret;
return ob_get_clean();
}
}
@ -631,7 +626,7 @@ class e_menu
if(is_numeric($mpath) || ($mname === false)) // Custom Page/Menu
{
$query = ($mname === false) ? "menu_name = '".$mpath."' " : "page_id=".intval($mpath)." "; // load by ID or load by menu-name (menu_name)
$query = ($mname === false) ? "menu_name = '".$mpath."' " : "page_id=". (int)$mpath ." "; // load by ID or load by menu-name (menu_name)
$sql->select("page", "*", $query);
$page = $sql->fetch();
@ -659,7 +654,7 @@ class e_menu
// echo "TEMPLATE= ($mpath)".$page['menu_template'];
$ns->setUniqueId('cmenu-'.$page['menu_name']);
$caption .= e107::getForm()->instantEditButton(e_ADMIN_ABS."cpage.php?mode=menu&action=edit&tab=2&id=".intval($page['page_id']),'J');
$caption .= e107::getForm()->instantEditButton(e_ADMIN_ABS."cpage.php?mode=menu&action=edit&tab=2&id=". (int)$page['page_id'],'J');
$ns->tablerender($caption, $text, 'cmenu-'.$page['menu_template']);
}
@ -705,9 +700,7 @@ class e_menu
if($return)
{
$ret = ob_get_contents();
ob_end_clean();
return $ret;
return ob_get_clean();
}
unset($pref);

View File

@ -336,29 +336,29 @@ class e_menuManager {
if (isset($location) && isset($position) && $menu_act == "bot")
{
$menu_count = $sql->count("menus", "(*)", " WHERE menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ");
$sql->db_Update("menus", "menu_order=".($menu_count+1)." WHERE menu_order='{$position}' AND menu_location='{$location}' AND menu_layout = '$this->dbLayout' ");
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='{$location}' AND menu_order > {$position} AND menu_layout = '".$this->dbLayout."' ");
$sql->update("menus", "menu_order=".($menu_count+1)." WHERE menu_order='{$position}' AND menu_location='{$location}' AND menu_layout = '$this->dbLayout' ");
$sql->update("menus", "menu_order=menu_order-1 WHERE menu_location='{$location}' AND menu_order > {$position} AND menu_layout = '".$this->dbLayout."' ");
e107::getLog()->add('MENU_06',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
}
if (isset($location) && isset($position) && $menu_act == "top")
{
$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_location='{$location}' AND menu_order < {$position} AND menu_layout = '".$this->dbLayout."' ",$this->debug);
$sql->db_Update("menus", "menu_order=1 WHERE menu_id='{$this->menuId}' ");
$sql->update("menus", "menu_order=menu_order+1 WHERE menu_location='{$location}' AND menu_order < {$position} AND menu_layout = '".$this->dbLayout."' ",$this->debug);
$sql->update("menus", "menu_order=1 WHERE menu_id='{$this->menuId}' ");
e107::getLog()->add('MENU_05',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
}
if (isset($location) && isset($position) && $menu_act == "dec")
{
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_order='".($position+1)."' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ",$this->debug);
$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_id='{$this->menuId}' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ");
$sql->update("menus", "menu_order=menu_order-1 WHERE menu_order='".($position+1)."' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ",$this->debug);
$sql->update("menus", "menu_order=menu_order+1 WHERE menu_id='{$this->menuId}' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ");
e107::getLog()->add('MENU_08',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
}
if (isset($location) && isset($position) && $menu_act == "inc")
{
$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_order='".($position-1)."' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ",$this->debug);
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_id='{$this->menuId}' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ");
$sql->update("menus", "menu_order=menu_order+1 WHERE menu_order='".($position-1)."' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ",$this->debug);
$sql->update("menus", "menu_order=menu_order-1 WHERE menu_id='{$this->menuId}' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ");
e107::getLog()->add('MENU_07',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
}
@ -389,7 +389,7 @@ class e_menuManager {
return false;
}
$sql->db_Update("menus", "menu_location='0' WHERE menu_layout = '" . $this->dbLayout . "' "); // Clear All existing.
$sql->update("menus", "menu_location='0' WHERE menu_layout = '" . $this->dbLayout . "' "); // Clear All existing.
foreach($menuAreas as $val)
{
@ -397,7 +397,7 @@ class e_menuManager {
{
$row = $sql->fetch();
if(!$sql->db_Update('menus', "menu_order='" . (int) $val['menu_order'] . "', menu_location = " . (int) $val['menu_location'] . ", menu_class= " . $val['menu_class'] . " WHERE menu_name='" . $tp->filter($val['menu_name']) . "' AND menu_layout = '" . $this->dbLayout . "' LIMIT 1 "))
if(!$sql->update('menus', "menu_order='" . (int) $val['menu_order'] . "', menu_location = " . (int) $val['menu_location'] . ", menu_class= " . $val['menu_class'] . " WHERE menu_name='" . $tp->filter($val['menu_name']) . "' AND menu_layout = '" . $this->dbLayout . "' LIMIT 1 "))
{
$insert = array(
'menu_id' => 0,
@ -554,7 +554,7 @@ class e_menuManager {
$c = 1;
while($row = $sql->fetch())
{
$sql2->db_Update("menus", "menu_order={$c} WHERE menu_id=" . $row['menu_id']);
$sql2->update("menus", "menu_order={$c} WHERE menu_id=" . $row['menu_id']);
$c++;
}
}
@ -1097,7 +1097,7 @@ class e_menuManager {
if($sql2->select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = 0 AND menu_layout ='".$this->dbLayout."' LIMIT 1"))
{
//menu_location=0 already exists, we can just delete this record
if(!$sql2->db_Delete('menus', 'menu_id='.$this->menuId))
if(!$sql2->delete('menus', 'menu_id='.$this->menuId))
{
$message = "Deletion Failed";
$error = true;

View File

@ -3068,7 +3068,7 @@ class e_admin_model extends e_front_model
}
$sql = e107::getDb();
$table = $this->getModelTable();
$res = $sql->db_Insert($table, $this->toSqlQuery('replace'));
$res = $sql->insert($table, $this->toSqlQuery('replace'));
$this->_db_qry = $sql->getLastQuery();
if(!$res)
{

View File

@ -608,7 +608,7 @@ class e_db_mysql implements e_db
{
global $db_mySQLQueryCount;
$table = $this->db_IsLang($table);
$table = $this->hasLanguage($table);
$this->mySQLcurTable = $table;
@ -679,7 +679,7 @@ class e_db_mysql implements e_db
*/
function insert($tableName, $arg, $debug = FALSE, $log_type = '', $log_remark = '')
{
$table = $this->db_IsLang($tableName);
$table = $this->hasLanguage($tableName);
$this->mySQLcurTable = $table;
$REPLACE = false; // kill any PHP notices
$DUPEKEY_UPDATE = false;
@ -873,7 +873,7 @@ class e_db_mysql implements e_db
/**
* hasLanguage() alias
* @deprecated
* @deprecated Use hasLanguage($table,$multiple)
*/
function db_IsLang($table, $multiple=false)
{
@ -987,7 +987,7 @@ class e_db_mysql implements e_db
*/
function update($tableName, $arg, $debug = FALSE, $log_type = '', $log_remark = '')
{
$table = $this->db_IsLang($tableName);
$table = $this->hasLanguage($tableName);
$this->mySQLcurTable = $table;
$this->provide_mySQLaccess();
@ -1121,7 +1121,7 @@ class e_db_mysql implements e_db
*/
function db_UpdateArray($table, $vars, $arg='', $debug = FALSE, $log_type = '', $log_remark = '')
{
$table = $this->db_IsLang($table);
$table = $this->hasLanguage($table);
$this->mySQLcurTable = $table;
$this->provide_mySQLaccess();
@ -1240,7 +1240,7 @@ class e_db_mysql implements e_db
*/
function count($table, $fields = '(*)', $arg = '', $debug = FALSE, $log_type = '', $log_remark = '')
{
$table = $this->db_IsLang($table);
$table = $this->hasLanguage($table);
if ($fields == 'generic')
{
@ -1330,7 +1330,7 @@ class e_db_mysql implements e_db
*/
function delete($table, $arg = '', $debug = FALSE, $log_type = '', $log_remark = '')
{
$table = $this->db_IsLang($table);
$table = $this->hasLanguage($table);
$this->mySQLcurTable = $table;
$this->provide_mySQLaccess();
@ -1465,7 +1465,7 @@ class e_db_mysql implements e_db
function ml_check($matches)
{
$table = $this->db_IsLang($matches[1]);
$table = $this->hasLanguage($matches[1]);
if($this->tabset == false)
{
$this->mySQLcurTable = $table;
@ -1788,7 +1788,7 @@ class e_db_mysql implements e_db
// Loop thru relevant language tables and replace each tablename within the query.
if($tablist = $this->db_IsLang($table, true))
if($tablist = $this->hasLanguage($table, true))
{
foreach($tablist as $key=>$tab)
{
@ -2164,7 +2164,7 @@ class e_db_mysql implements e_db
/**
* Legacy Alias of tables
* @deprecated
* @deprecated Use $sql->tables($mode) instead.
* @param string $mode
* @return array
*/

View File

@ -76,7 +76,7 @@ class news {
$message = LAN_ERROR_48;
$emessage->add(LAN_ERROR_48, E_MESSAGE_ERROR, $smessages);
}
elseif($sql->db_Count('news', '(news_id)', ($news['news_sef'] ? 'news_id<>'.intval($news['news_id']).' AND ' : '')."news_sef='".$tp->toDB($news['news_sef'])."'"))
elseif($sql->count('news', '(news_id)', ($news['news_sef'] ? 'news_id<>'.intval($news['news_id']).' AND ' : '')."news_sef='".$tp->toDB($news['news_sef'])."'"))
{
$error = true;
$message = LAN_ERROR_49;
@ -166,7 +166,7 @@ class news {
$data['WHERE'] = 'news_id='.intval($news['news_id']);
//$vals = "news_datestamp = '".intval($news['news_datestamp'])."', ".$author_insert." news_title='".$news['news_title']."', news_body='".$news['news_body']."', news_extended='".$news['news_extended']."', news_category='".intval($news['cat_id'])."', news_allow_comments='".intval($news['news_allow_comments'])."', news_start='".intval($news['news_start'])."', news_end='".intval($news['news_end'])."', news_class='".$tp->toDB($news['news_class'])."', news_render_type='".intval($news['news_rendertype'])."' , news_summary='".$news['news_summary']."', news_thumbnail='".$tp->toDB($news['news_thumbnail'])."', news_sticky='".intval($news['news_sticky'])."' WHERE news_id='".intval($news['news_id'])."' ";
if ($sql->db_Update('news', $data))
if ($sql->update('news', $data))
{
@ -213,7 +213,7 @@ class news {
else
{
// Adding item
$data['data']['news_id'] = $sql->db_Insert('news', $data);
$data['data']['news_id'] = $sql->insert('news', $data);
$news['news_id'] = $data['data']['news_id'];
//$news['news_id'] = $sql ->db_Insert('news', "0, '".$news['news_title']."', '".$news['news_body']."', '".$news['news_extended']."', ".intval($news['news_datestamp']).", ".intval($news['news_author']).", '".intval($news['cat_id'])."', '".intval($news['news_allow_comments'])."', '".intval($news['news_start'])."', '".intval($news['news_end'])."', '".$tp->toDB($news['news_class'])."', '".intval($news['news_rendertype'])."', '0' , '".$news['news_summary']."', '".$tp->toDB($news['news_thumbnail'])."', '".intval($news['news_sticky'])."' ")
if ($data['data']['news_id'])
@ -320,8 +320,8 @@ class news {
$param['image_sticky'] = IMAGE_sticky;
}
cachevars('current_news_item', $news);
cachevars('current_news_param', $param);
e107::setRegistry('current_news_item', $news);
e107::setRegistry('current_news_param', $param);
if ($news['news_render_type'] == 1 && $mode != "extend")
{

View File

@ -375,7 +375,7 @@ class e_online
define('MEMBERS_ONLINE', $members_online);
define('GUESTS_ONLINE', $total_online - $members_online);
$dbg->logTime('Go online (db count) Line:'.__LINE__);
define('ON_PAGE', $sql->db_Count('online', '(*)', "WHERE `online_location` = '{$page}' "));
define('ON_PAGE', $sql->count('online', '(*)', "WHERE `online_location` = '{$page}' "));
define('MEMBER_LIST', $member_list);
//update most ever online

View File

@ -2301,7 +2301,7 @@ class e107plugin
if (($path && $sql->select('links', 'link_id,link_order', "link_url = '{$path}'")) || $sql->select('links', 'link_id,link_order', "link_name = '{$link_name}'"))
{
$row = $sql->fetch();
$sql->db_Update('links', "link_order = link_order - 1 WHERE link_order > {$row['link_order']}");
$sql->update('links', "link_order = link_order - 1 WHERE link_order > {$row['link_order']}");
return $sql->delete('links', "link_id = {$row['link_id']}");
}
}

View File

@ -1166,9 +1166,9 @@ class prefs
// Data not in cache - retrieve from DB
$get_sql = new db; // required so sql loops don't break using $tp->toHTML().
if($get_sql->db_Select('core', '*', "`e107_name` = '{$Name}'", 'default'))
if($get_sql->select('core', '*', "`e107_name` = '{$Name}'", 'default'))
{
$row = $get_sql->db_Fetch();
$row = $get_sql->fetch();
$this->prefVals['core'][$Name] = $row['e107_value'];
return $this->prefVals['core'][$Name];
}
@ -1225,17 +1225,18 @@ class prefs
}
$val = addslashes($val);
switch ($table ) {
switch ($table )
{
case 'core':
if(!$sql->db_Update($table, "e107_value='$val' WHERE e107_name='$name'"))
if(!$sql->update($table, "e107_value='$val' WHERE e107_name='$name'"))
{
$sql->db_Insert($table, "'{$name}', '{$val}'");
$sql->insert($table, "'{$name}', '{$val}'");
}
$this->prefVals[$table][$name] = $val;
unset($this->prefArrays[$table][$name]);
break;
case 'user':
$sql->db_Update($table, "user_prefs='$val' WHERE user_id=$uid");
$sql->update($table, "user_prefs='$val' WHERE user_id=$uid");
break;
}
}

View File

@ -19,7 +19,7 @@ if (!defined('e107_INIT')) { exit; }
$query = $tp -> toDB($query);
$results = $sql->db_Select("event", "*", "event_stake REGEXP('".$query."') OR event_ward REGEXP('".$query."') OR event_organisation REGEXP('".$query."') OR event_title REGEXP('".$query."')
OR event_location REGEXP('".$query."') OR event_details REGEXP('".$query."') OR event_thread REGEXP('".$query."') ");
while (list($event_id, $event_stake, $event_ward, $event_organisation, $event_start, $event_end, $event_allday, , , $event_title, $event_location, $event_details, $event_author, $event_contact, $event_category, $event_url ) = $sql->db_Fetch()) {
while (list($event_id, $event_stake, $event_ward, $event_organisation, $event_start, $event_end, $event_allday, , , $event_title, $event_location, $event_details, $event_author, $event_contact, $event_category, $event_url ) = $sql->fetch()) {
$sql2->db_select("event_cat", "event_cat_name, event_cat_icon", "event_cat_id='".$event_category."' ");
list($event_cat_name, $event_cat_icon ) = $sql2->db_Fetch();

View File

@ -310,7 +310,7 @@ class e_search
} else {
$x = 0;
while ($row = $sql -> db_Fetch())
while ($row = $sql ->fetch())
{
$display_row[] = $row;
$x++;

View File

@ -1150,8 +1150,8 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
$plug_id = array();
$plugin_array = array();
e107::getDb()->db_Select("plugin", "*", "plugin_installflag = 1"); // Grab plugin IDs.
while ($row = e107::getDb()->db_Fetch())
e107::getDb()->select("plugin", "*", "plugin_installflag = 1"); // Grab plugin IDs.
while ($row = e107::getDb()->fetch())
{
$pth = $row['plugin_path'];
$plug_id[$pth] = $row['plugin_id'];

View File

@ -2887,9 +2887,9 @@ class themeHandler
else
{
// echo $plug;
if($sql->db_Select("plugin", "plugin_id", " plugin_path = '".$plug."' LIMIT 1 "))
if($sql->select("plugin", "plugin_id", " plugin_path = '".$plug."' LIMIT 1 "))
{
$row = $sql->db_Fetch();
$row = $sql->fetch();
$name = "installplugin[".$row['plugin_id']."]";
$text .= $this->frm->admin_button($name, ADLAN_121." ".$plug."", 'delete');
}

View File

@ -304,7 +304,7 @@ function process_uploaded_files($uploaddir, $fileinfo = FALSE, $options = NULL)
{
// File upload broken - temp file renamed.
// FIXME - method starting with 'get' shouldn't do system file changes.
$uploaded[$c] = e107::getFile()->get_file_info($uploadfile, true, false);
$uploaded[$c] = e107::getFile()->getFileInfo($uploadfile, true, false);
$uploaded[$c]['name'] = $name;
$uploaded[$c]['rawname'] = $raw_name;

View File

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

View File

@ -2148,9 +2148,9 @@ class e_user_extended_model extends e_admin_model
$value = $this->get($field);
list($table, $field_id, $field_name, $field_order) = explode(',', $this->_struct_index[$field]['db'], 4);
$this->_struct_index[$field]['db_value'] = $value;
if($value && $table && $field_id && $field_name && e107::getDb()->db_Select($table, $field_name, "{$field_id}='{$value}'"))
if($value && $table && $field_id && $field_name && e107::getDb()->select($table, $field_name, "{$field_id}='{$value}'"))
{
$res = e107::getDb()->db_Fetch();
$res = e107::getDb()->fetch();
$this->_struct_index[$field]['db_value'] = $res[$field_name];
}
@ -2428,7 +2428,7 @@ class e_user_extended_model extends e_admin_model
}
$this->_buildManageRules();
// insert new record
if(!e107::getDb()->db_Count('user_extended', '(user_extended_id)', "user_extended_id=".$this->getId()))
if(!e107::getDb()->count('user_extended', '(user_extended_id)', "user_extended_id=".$this->getId()))
{
return $this->insert(true, $session);
}

View File

@ -1751,7 +1751,7 @@ class user_class_admin extends user_class
$classrec['userclass_accum'] = implode(',',$temp);
}
}
if ($this->sql_r->db_Insert('userclass_classes',$this->copy_rec($classrec, TRUE)) === FALSE)
if ($this->sql_r->insert('userclass_classes',$this->copy_rec($classrec, TRUE)) === FALSE)
{
return FALSE;
}
@ -1801,7 +1801,7 @@ class user_class_admin extends user_class
$spacer = ", ";
}
}
if ($this->sql_r->db_Update('userclass_classes', $qry." WHERE `userclass_id`='{$classrec['userclass_id']}'") === FALSE)
if ($this->sql_r->update('userclass_classes', $qry." WHERE `userclass_id`='{$classrec['userclass_id']}'") === FALSE)
{
return FALSE;
}
@ -1873,7 +1873,7 @@ class user_class_admin extends user_class
{
if (self::queryCanDeleteClass($classID) === FALSE) return FALSE;
if ($this->sql_r->db_Delete('userclass_classes', "`userclass_id`='{$classID}'") === FALSE) return FALSE;
if ($this->sql_r->delete('userclass_classes', "`userclass_id`='{$classID}'") === FALSE) return FALSE;
$this->clearCache();
$this->readTree(TRUE); // Re-read the class tree
return TRUE;

View File

@ -19,6 +19,7 @@ class parseXml extends xmlClass // BC with v1.x
{
private $xmlData = array();
private $counterArray = array();
function __construct()
{
@ -85,7 +86,7 @@ class parseXml extends xmlClass // BC with v1.x
foreach($array as $data)
{
if(strlen($data == 4096))
if(strlen($data) == 4096)
{
$log->addDebug("The XML cannot be parsed as it is badly formed.")->save('XML');
return FALSE;
@ -297,8 +298,8 @@ class xmlClass
/**
* Constructor - set defaults
*
*/
function __constructor()
*//*
function __construct()
{
$this->reset();
@ -306,7 +307,7 @@ class xmlClass
{
$this->filePathConvKeys = array_keys($this->filePathConversions);
}
}
}*/
/**
* Reset object
@ -504,7 +505,7 @@ class xmlClass
* XXX New parser in testing phase - see e_marketplace::parse()
* @param SimpleXMLElement $xml
* @param string $rec_parent used for recursive calls only
* @return array
* @return array|string
*/
function xml2array($xml, $rec_parent = '')
{
@ -534,7 +535,7 @@ class xmlClass
$tags = array_keys($tags);
foreach ($tags as $tag)
{
if($tag == '@attributes')
if($tag === '@attributes')
{
$tmp = (array) $xml->attributes();
$ret['@attributes'] = $tmp['@attributes'];
@ -870,7 +871,7 @@ class xmlClass
if(is_array($val))
{
$val = e107::serialize($val,false);
$val = e107::serialize($val);
if($val === null)
{
@ -931,7 +932,7 @@ class xmlClass
ksort($theprefs);
foreach($theprefs as $key=>$val)
{
if($type == 'core' && $this->modifiedPrefsOnly == true && (($val == $default[$key]) || in_array($key,$excludes) || substr($key,0,2) == 'e_'))
if($type === 'core' && $this->modifiedPrefsOnly == true && (($val == $default[$key]) || in_array($key,$excludes) || strpos($key, 'e_') === 0))
{
continue;
}
@ -1009,11 +1010,11 @@ class xmlClass
$eQry = (!empty($options['query'])) ? $options['query'] : null;
e107::getDb()->select($eTable, "*", $eQry);
$text .= "\t<dbTable name=\"".$eTable."\">\n";
$count = 1;
// $count = 1;
while($row = e107::getDb()->fetch())
{
if($this->convertFilePaths == true && $eTable == 'core_media' && substr($row['media_url'],0,8) != '{e_MEDIA')
if($this->convertFilePaths == true && $eTable === 'core_media' && strpos($row['media_url'], '{e_MEDIA') !== 0)
{
continue;
}
@ -1026,7 +1027,7 @@ class xmlClass
}
$text .= "\t\t</item>\n";
$count++;
// $count++;
}
$text .= "\t</dbTable>\n";
@ -1282,7 +1283,7 @@ class xmlClass
$insert_array[$fieldkey] = $fieldval;
}
if(($mode == "replace") && $sql->replace($table, $insert_array)!==FALSE)
if(($mode === "replace") && $sql->replace($table, $insert_array)!==FALSE)
{
$ret['success'][] = $table;
}

View File

@ -60,7 +60,7 @@ class alt_auth_base
$sql->db_Select('alt_auth', '*', "auth_type = '".$prefix."' ");
$parm = array();
while($row = $sql->db_Fetch())
while($row = $sql->fetch())
{
$parm[$row['auth_parmname']] = base64_decode(base64_decode($row['auth_parmval']));
}

View File

@ -83,7 +83,7 @@ class auth_login extends alt_auth_base
// Now look at their password - we always need to verify it, even if its a core E107 format.
// Higher levels will always convert an authorised password to E107 format and save it for us.
if (!$row = $sql->db_Fetch())
if (!$row = $sql->fetch())
{
$this->makeErrorText('Error reading DB');
return AUTH_NOCONNECT; // Debateable return code - really a DB error. But consistent with other handler

View File

@ -43,7 +43,7 @@ class auth_login extends alt_auth_base
/**
* Read configuration, initialise connection to LDAP database
*
* @return AUTH_xxxx result code
* @return integer AUTH_xxxx result code
*/
public function __construct()
{

View File

@ -44,7 +44,7 @@ class auth_login extends alt_auth_base
/**
* Read configuration, initialise connection to LDAP database
*
* @return AUTH_xxxx result code
* @return int AUTH_xxxx result code
*/
function __construct()
{

View File

@ -61,8 +61,8 @@ if (!isset($req_year)) $req_year = $cur_year;
// --------------------------------
// look for the first and last year
// --------------------------------
$bcSql->db_Select_gen("SELECT news_id, news_datestamp from #news ORDER BY news_datestamp LIMIT 0,1");
$first_post = $bcSql->db_Fetch();
$bcSql->gen("SELECT news_id, news_datestamp from #news ORDER BY news_datestamp LIMIT 0,1");
$first_post = $bcSql->fetch();
$start_year = date("Y", $first_post['news_datestamp']);
$end_year = $cur_year;
@ -85,7 +85,7 @@ for($i = $start_year; $i <= $end_year; $i++)
$year_selector .= " selected='selected'";
if ($bcSql->db_Select("news", "news_id, news_datestamp, news_class", "news_datestamp > {$start} AND news_datestamp < {$end}"))
{
while ($news = $bcSql->db_Fetch())
while ($news = $bcSql->fetch())
{
if (check_class($news['news_class']))
{

View File

@ -100,7 +100,7 @@ if (isset($_POST['update_catorder']))
{
if (is_numeric($_POST['catorder'][$key]))
{
$sql -> db_Update("download_category", "download_category_order='".intval($order)."' WHERE download_category_id='".intval($key)."'");
$sql ->update("download_category", "download_category_order='".intval($order)."' WHERE download_category_id='".intval($key)."'");
}
}
e107::getLog()->add('DOWNL_08',implode(',',array_keys($_POST['catorder'])),E_LOG_INFORMATIVE,'');
@ -206,7 +206,7 @@ if (isset($_POST['updatelimits']))
if (!$_POST['count_num'][$idLim] && !$_POST['count_days'][$idLim] && !$_POST['bw_num'][$idLim] && !$_POST['bw_days'][$idLim])
{
//All entries empty - Remove record
if ($sql->db_Delete('generic',"gen_id = {$idLim}"))
if ($sql->delete('generic',"gen_id = {$idLim}"))
{
$message .= $idLim." - ".DOWLAN_119."<br/>";
e107::getLog()->add('DOWNL_11','ID: '.$idLim,E_LOG_INFORMATIVE,'');

View File

@ -111,7 +111,7 @@ class download_setup
{
if($needed == TRUE){ return "Incorrect download image paths"; } // Signal that an update is required.
if($sql->db_Update("download","download_image = CONCAT('{e_FILE}downloadimages/',download_image) WHERE download_image !='' "))
if($sql->update("download","download_image = CONCAT('{e_FILE}downloadimages/',download_image) WHERE download_image !='' "))
{
$mes->addSuccess("Updated Download-Image paths");
}
@ -120,7 +120,7 @@ class download_setup
$mes->addError("Failed to update Download-Image paths");
}
if($sql->db_Update("download"," download_thumb = CONCAT('{e_FILE}downloadthumbs/',download_thumb) WHERE download_thumb !='' "))
if($sql->update("download"," download_thumb = CONCAT('{e_FILE}downloadthumbs/',download_thumb) WHERE download_thumb !='' "))
{
$mes->addSuccess("Updated Download-Thumbnail paths");
}
@ -136,7 +136,7 @@ class download_setup
// Signal that an update is required.
if($needed == TRUE){ return "Downloads-Category icon paths need updating"; } // Must have a value if an update is needed. Text used for debug purposes.
if($sql->db_Update("download_category","download_category_icon = CONCAT('{e_IMAGE}icons/',download_category_icon) WHERE download_category_icon !='' "))
if($sql->update("download_category","download_category_icon = CONCAT('{e_IMAGE}icons/',download_category_icon) WHERE download_category_icon !='' "))
{
$mes->addSuccess("Updated Download-Image paths");
}

View File

@ -46,7 +46,7 @@ class list_download
WHERE dc.download_category_class REGEXP '".e_CLASS_REGEXP."' AND d.download_class REGEXP '".e_CLASS_REGEXP."' AND d.download_active != '0' ".$qry."
ORDER BY download_datestamp DESC LIMIT 0,".intval($this->parent->settings['amount'])." ";
$downloads = $this->parent->e107->sql->db_Select_gen($qry);
$downloads = $this->parent->e107->sql->gen($qry);
if($downloads == 0)
{
$list_data = LIST_DOWNLOAD_2;
@ -54,7 +54,7 @@ class list_download
else
{
$list_data = array();
while($row = $this->parent->e107->sql->db_Fetch())
while($row = $this->parent->e107->sql->fetch())
{
$record = array();
$rowheading = $this->parent->parse_heading($row['download_name']);

View File

@ -96,7 +96,7 @@ class plugin_faqs_list_controller extends eControllerFront
$text = $tp->parseTemplate($FAQ_START, true, $sc);
while ($rw = $sql->db_Fetch())
while ($rw = $sql->fetch())
{
$sc->setVars($rw);

View File

@ -30,7 +30,7 @@ class faqs_setup
(3, 1, 'What is a plugin?', 'A plugin is an additional program that integrates with the e107 core system.\r\n\r\nActually plugins are enhancements to the existing system. Some other CMS systems call it extensions, components or modules.\r\n\r\nAlready some core plugins are included in the full install package of e107.\r\n\r\nYou can activate them using Admin > Plugin Manager, and click on Install for the ones you want. They will appear in your Admin Area for configuration.\r\n\r\nThere are all kinds of plugins: small and large, core plugins and third party plugins. There are plugins for all kinds of purposes. ', 0, 123123123, 1, 2);
";
$status = ($sql->db_Select_gen($query)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
$status = ($sql->gen($query)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
$mes->add(LAN_DEFAULT_TABLE_DATA.": faqs", $status);
@ -39,7 +39,7 @@ class faqs_setup
(2, 'Misc', 'Other FAQs', 0, 0, 1, '', '', '');
";
$status = ($sql->db_Select_gen($query2)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
$status = ($sql->gen($query2)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
$mes->add(LAN_DEFAULT_TABLE_DATA.": faqs_info", $status);
}

View File

@ -128,9 +128,9 @@ class plugin_featurebox_category extends e_model
{
if($force || null === $this->_loaded_data)
{
if(e107::getDb()->db_Select('featurebox_category', '*', 'fb_category_class IN ('.USERCLASS_LIST.') AND fb_category_template=\''.e107::getParser()->toDB($template).'\''))
if(e107::getDb()->select('featurebox_category', '*', 'fb_category_class IN ('.USERCLASS_LIST.') AND fb_category_template=\''.e107::getParser()->toDB($template).'\''))
{
$this->setData(e107::getDb()->db_Fetch());
$this->setData(e107::getDb()->fetch());
$this->_loaded_data = true;
}
}

View File

@ -1584,7 +1584,7 @@ class e107forum
}
else
{
$this->modArray = e107::getUserClass()->get_users_in_class($uclass, 'user_name', true);
$this->modArray = e107::getUserClass()->getUsersInClass($uclass, 'user_name', true);
}

View File

@ -153,7 +153,7 @@
/**
* @example {TOPIC_DATESTAMP: format=relative}
* @param string $parm['format'] short|long|forum|relative
* @return HTML
* @return string HTML
*/
function sc_topic_datestamp($parm=null)
{

View File

@ -45,7 +45,7 @@ class coppermine_import extends base_import_class
switch ($task)
{
case 'users' :
$result = $this->ourDB->db_Select_gen("SELECT * FROM {$this->DBPrefix}users WHERE `user_active`='YES' ");
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}users WHERE `user_active`='YES' ");
if ($result === FALSE) return FALSE;
break;
default :

View File

@ -130,7 +130,7 @@ class drupal_import extends base_import_class
$result = $this->_setupQueryUsers();
$this->copyUserInfo = !$blank_user;
break;
/*
case 'news':
break;
@ -138,7 +138,7 @@ class drupal_import extends base_import_class
break;
case 'links':
break;
break;*/
default:
break;

View File

@ -41,23 +41,20 @@ class ikonboard_import extends base_import_class
switch ($task)
{
case 'users' :
$result = $this->ourDB->db_Select_gen("SELECT * FROM {$this->DBPrefix}member_profiles");
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}member_profiles");
if ($result === FALSE) return FALSE;
break;
case 'forumdefs' :
return FALSE;
case 'forumposts' :
return FALSE;
case 'polls' :
return FALSE;
case 'news' :
return FALSE;
default :
return FALSE;
case 'forumdefs':
case 'forumposts':
case 'polls':
case 'news':
default :
return false;
}
$this->copyUserInfo = !$blank_user;
$this->currentTask = $task;
return TRUE;
return true;
}

View File

@ -45,7 +45,7 @@ class joomla_import extends base_import_class
switch ($task)
{
case 'users' :
$result = $this->ourDB->db_Select_gen("SELECT * FROM {$this->DBPrefix}users");
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}users");
if ($result === FALSE) return FALSE;
break;
default :

View File

@ -41,7 +41,7 @@ class mambo_import extends base_import_class
switch ($task)
{
case 'users' :
$result = $this->ourDB->db_Select_gen("SELECT * FROM {$this->DBPrefix}users");
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}users");
if ($result === FALSE) return FALSE;
break;
default :

View File

@ -111,17 +111,14 @@ class phpbb3_import extends base_import_class
if ($result === FALSE) return FALSE;
break;
case 'polls' :
case 'news':
case 'polls' :
return FALSE;
break;
case 'news' :
return FALSE;
break;
default :
default :
return FALSE;
}

View File

@ -55,14 +55,14 @@ class list_news
WHERE ".$qry." AND n.news_class REGEXP '".e_CLASS_REGEXP."'
ORDER BY n.news_datestamp DESC LIMIT 0,".intval($this->parent->settings['amount']);
if(!$this->parent->e107->sql->db_Select_gen($qry))
if(!$this->parent->e107->sql->gen($qry))
{
$list_data = LIST_NEWS_2;
}
else
{
$list_data = array();
while($row=$this->parent->e107->sql->db_Fetch())
while($row=$this->parent->e107->sql->fetch())
{
$row['news_title'] = $this->parse_news_title($row['news_title']);
$rowheading = $this->parent->parse_heading($row['news_title']);

View File

@ -710,7 +710,7 @@ class siteStats
/* get main stat info from database */
if($sql->select('logstats', 'log_data', "log_id='pageTotal'"))
{
$row = $sql -> db_Fetch();
$row = $sql ->fetch();
$this -> dbPageInfo = unserialize($row['log_data']);
}
else
@ -1176,7 +1176,7 @@ class siteStats
if ($entries = $sql->select("logstats", "*", $pars['query']))
{
$row = $sql -> db_Fetch();
$row = $sql -> fetch();
$statOs = unserialize($row['log_data']);
}
else
@ -1309,7 +1309,7 @@ class siteStats
if ($entries = $sql->select('logstats', 'log_data', $pars['query']))
{
$row = $sql -> db_Fetch();
$row = $sql -> fetch();
$statDom = unserialize($row['log_data']);
}
else
@ -1399,7 +1399,7 @@ class siteStats
if ($entries = $sql->db_Select('logstats', 'log_data', $pars['query']))
{
$row = $sql -> db_Fetch();
$row = $sql -> fetch();
$statScreen = unserialize($row['log_data']);
}
else
@ -1503,7 +1503,7 @@ class siteStats
if ($entries = $sql->select('logstats', 'log_data', $pars['query']))
{
$row = $sql -> db_Fetch();
$row = $sql -> fetch();
$statRefer = unserialize($row['log_data']);
}
else
@ -1600,7 +1600,7 @@ class siteStats
if ($entries = $sql->select("logstats", "*", $pars['query']))
{
$row = $sql -> db_Fetch();
$row = $sql -> fetch();
$statQuery = unserialize($row['log_data']);
}
else
@ -2058,7 +2058,7 @@ class siteStats
$sql = e107::getDB();
if ($sql->select("logstats", "*", "log_id='pageTotal'"))
{
$row = $sql -> db_Fetch();
$row = $sql -> fetch();
$dbPageInfo = unserialize($row[2]);
unset($dbPageInfo[$toremove]);
$dbPageDone = serialize($dbPageInfo);

View File

@ -191,11 +191,8 @@ function export_stats($export_type, $export_date, $export_filter, $first_date,
case 3 : $filename .= $export_type.'_year_'.date('Ym',$first_date).'_'.date('Ym',$last_date);
$values_per_row = 12;
break;
case 4 :
// $filename .= $export_type.'_alltime';
$filename .= $export_type;
break;
case 5 :
case 5:
case 4 :
// $filename .= $export_type.'_alltime';
$filename .= $export_type;
break;
@ -203,7 +200,7 @@ function export_stats($export_type, $export_date, $export_filter, $first_date,
$filename .= '.csv';
if (defined('CSV_DEBUG')) $export_text .= "export stats to {$filename}<br />";
while($row = $sql -> db_Fetch())
while($row = $sql ->fetch())
{ // Process one DB entry
$date_id = substr($row['log_id'],strrpos($row['log_id'],'-')+1); // Numeric value of date being processed (not always valid)
if (!is_numeric($date_id)) $date_id = 0;

View File

@ -192,9 +192,9 @@ class login_menu_class
WHERE t.thread_datestamp > ".USERLV." and f.forum_class IN (".USERCLASS_LIST.") AND NOT (f.forum_class REGEXP ".$nobody_regexp.")
";
if($sql->db_Select_gen($qry))
if($sql->gen($qry))
{
$row = $sql->db_Fetch();
$row = $sql->fetch();
$lbox_stats['forum'][0]['stat_new'] = $row['count'];
}
}

View File

@ -483,7 +483,7 @@ class newsletter
{
if($sql->select('user', 'user_name,user_email,user_loginname,user_lastvisit', 'user_id='.$memberID))
{
$row = $sql->db_Fetch();
$row = $sql->fetch();
$uTarget = array('mail_recipient_id' => $memberID,
'mail_recipient_name' => $row['user_name'], // Should this use realname?
'mail_recipient_email' => $row['user_email'],
@ -638,7 +638,7 @@ class newsletter
<td>".LAN_OPTIONS."</td>
</tr>";
if($nl_row = $nl_sql-> db_Fetch())
if($nl_row = $nl_sql->fetch())
{
$subscribers_list = explode(chr(1), trim($nl_row['newsletter_subscribers']));
sort($subscriber_list);

View File

@ -663,9 +663,9 @@ class private_msg_ui extends e_admin_ui
{
$qry = implode(' OR ', $del_qry);
$cnt = 0;
if($db2->db_Select('private_msg', 'pm_id', $qry))
if($db2->select('private_msg', 'pm_id', $qry))
{
while ($row = $db2->db_Fetch())
while ($row = $db2->fetch())
{
if ($pmHandler->del($row['pm_id']) !== FALSE)
{

View File

@ -388,9 +388,9 @@ function show_limits($pm_prefs)
if (!isset($pm_prefs['pm_limits'])) { $pm_prefs['pm_limits'] = 0; }
if($sql->db_Select('generic', "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as inbox_count, gen_ip as outbox_count, gen_intdata as inbox_size, gen_chardata as outbox_size", "gen_type = 'pm_limit'"))
if($sql->select('generic', "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as inbox_count, gen_ip as outbox_count, gen_intdata as inbox_size, gen_chardata as outbox_size", "gen_type = 'pm_limit'"))
{
while($row = $sql->db_Fetch())
while($row = $sql->fetch())
{
$limitList[$row['limit_classnum']] = $row;
}
@ -480,9 +480,9 @@ function add_limit($pm_prefs)
$sql = e107::getDb();
$frm = e107::getForm();
if($sql->db_Select('generic', "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as inbox_count, gen_ip as outbox_count, gen_intdata as inbox_size, gen_chardata as outbox_size", "gen_type = 'pm_limit'"))
if($sql->select('generic', "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as inbox_count, gen_ip as outbox_count, gen_intdata as inbox_size, gen_chardata as outbox_size", "gen_type = 'pm_limit'"))
{
while($row = $sql->db_Fetch())
while($row = $sql->fetch())
{
$limitList[$row['limit_classnum']] = $row;
}
@ -679,7 +679,7 @@ function doMaint($opts, $pmPrefs)
WHERE `#user`.`user_id` IS NULL"))
{
$start = max($start + 1, time());
$results[E_MESSAGE_ERROR][$start] = str_replace(array('[y]', '[z]'), array($this->sql->getLastErrorNum, $this->sql->getLastErrorText), ADLAN_PM_70);
$results[E_MESSAGE_ERROR][$start] = str_replace(array('[y]', '[z]'), array($db2->sql->getLastErrorNum, $db2->sql->getLastErrorText), ADLAN_PM_70);
}
else
{
@ -690,7 +690,7 @@ function doMaint($opts, $pmPrefs)
WHERE `#user`.`user_id` IS NULL"))
{
$start = max($start + 1, time());
$results[E_MESSAGE_ERROR][$start] = str_replace(array('[y]', '[z]'), array($this->sql->getLastErrorNum, $this->sql->getLastErrorText), ADLAN_PM_70);
$results[E_MESSAGE_ERROR][$start] = str_replace(array('[y]', '[z]'), array($db2->sql->getLastErrorNum, $db2->sql->getLastErrorText), ADLAN_PM_70);
}
else
{
@ -719,9 +719,9 @@ function doMaint($opts, $pmPrefs)
{
$qry = implode(' OR ', $del_qry);
$cnt = 0;
if($db2->db_Select('private_msg', 'pm_id', $qry))
if($db2->select('private_msg', 'pm_id', $qry))
{
while ($row = $db2->db_Fetch())
while ($row = $db2->fetch())
{
if ($pmHandler->del($row['pm_id']) !== FALSE)
{

View File

@ -282,7 +282,9 @@ class rssCreate
$path = e_PLUGIN."forum/e_rss.php";
break;
case 8:
case 11:
if(!$this -> topicid)
{
return FALSE;
@ -291,13 +293,6 @@ class rssCreate
break;
// case 10 was bugtracker
case 11:
if(!$this -> topicid)
{
return FALSE;
}
$path = e_PLUGIN."forum/e_rss.php";
break;
case 'download':
case 12:

View File

@ -224,7 +224,7 @@ class tinymce
"<tbody>";
if(!$sql->db_Select_gen($this->listQry))
if(!$sql->gen($this->listQry))
{
$text .= "\n<tr><td colspan='".count($this->fields)."' class='center middle'>".CUSLAN_42."</td></tr>\n";
}
@ -300,7 +300,7 @@ class tinymce
/**
* Render Form Element (edit page)
*
* @param array $key
* @param string $key
* @param array $row
* @return string method's value or HTML input
*/
@ -339,8 +339,8 @@ class tinymce
if($id)
{
$query = str_replace("{ID}",$id,$this->editQry);
$sql->db_Select_gen($query);
$row = $sql->db_Fetch();
$sql->gen($query);
$row = $sql->fetch();
}
else
{

View File

@ -0,0 +1,95 @@
<?php
/**
* e107 website system
*
* Copyright (C) 2008-2020 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
class e_bbcodeTest extends \Codeception\Test\Unit
{
/** @var e_bbcode */
protected $bb;
protected function _before()
{
try
{
$this->bb = $this->make('e_bbcode');
}
catch(Exception $e)
{
$this->assertTrue(false, $e->getMessage());
}
}
/*
public function testSetClass()
{
}
public function testResizeWidth()
{
}
public function testGetContent()
{
}
public function testHtmltoBBcode()
{
}
public function testImgToBBcode()
{
}
public function testResizeHeight()
{
}
public function testRenderButtons()
{
}
public function testProcessTag()
{
}
public function testParseBBCodes()
{
}
public function testClearClass()
{
}
public function testGetClass()
{
}
public function testGetMode()
{
}
*/
}

View File

@ -27,6 +27,9 @@
$this->tp->__construct();
}
/*
public function testHtmlAbuseFilter()
{

View File

@ -30,7 +30,7 @@ function tablestyle($caption, $text, $mode='')
switch($style)
{
/*
case 'home':
echo $caption;
echo $text;
@ -44,7 +44,7 @@ function tablestyle($caption, $text, $mode='')
case 'full':
echo $caption;
echo $text;
break;
break;*/
default:
echo $caption;

View File

@ -153,9 +153,9 @@ if (isset($_POST['emailsubmit']))
{
$emailurl = strip_tags($_POST['referer']);
$message = '';
if($sql->db_Select('news', 'news_title, news_body, news_extended', 'news_id='.((int)$parms)))
if($sql->select('news', 'news_title, news_body, news_extended', 'news_id='.((int)$parms)))
{
$row = $sql->db_Fetch();
$row = $sql->fetch();
$message = "<h3 class='email_heading'>".$row['news_title']."</h3><br />".$row['news_body']."<br />".$row['news_extended']."<br /><br /><a href='{e_BASE}news.php?extend.".$parms."'>{e_BASE}news.php?extend.".$parms."</a><br />";
$message = $tp->toEmail($message);
}

View File

@ -122,7 +122,7 @@ if ($action == 'active')
$text .= "</table>\n</div>";
$ftotal = $sql->db_Count('forum_thread', '(*)', 'WHERE `thread_parent` = 0');
$ftotal = $sql->count('forum_thread', '(*)', 'WHERE `thread_parent` = 0');
$parms = "{$ftotal},{$view},{$from},".e_SELF.'?[FROM].active.forum.'.$view;
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
$ns->tablerender(LAN_7, $text, 'nfp');