mirror of
https://github.com/e107inc/e107.git
synced 2025-08-25 15:31:41 +02:00
Code optimization and cleaning
This commit is contained in:
@@ -166,7 +166,7 @@ class alt_login
|
||||
$newUser['data'] = $db_vals;
|
||||
validatorClass::addFieldTypes($userMethods->userVettingInfo,$newUser);
|
||||
$newUser['WHERE'] = '`user_id`='.$row['user_id'];
|
||||
$aa_sql->db_Update('user',$newUser);
|
||||
$aa_sql->update('user',$newUser);
|
||||
if (AA_DEBUG1) $this->e107->admin_log->e_log_event(10,debug_backtrace(),"DEBUG","Alt auth login","User data update: ".print_r($newUser,TRUE),FALSE,LOG_TO_ROLLING);
|
||||
}
|
||||
foreach ($xFields as $k => $v)
|
||||
@@ -184,14 +184,14 @@ class alt_login
|
||||
$ue->addFieldTypes($xArray); // Add in the data types for storage
|
||||
$xArray['WHERE'] = '`user_extended_id`='.intval($row['user_id']);
|
||||
if (AA_DEBUG) $this->e107->admin_log->e_log_event(10,debug_backtrace(),"DEBUG","Alt auth login","User xtnd update: ".print_r($xFields,TRUE),FALSE,LOG_TO_ROLLING);
|
||||
$aa_sql->db_Update('user_extended',$xArray );
|
||||
$aa_sql->update('user_extended',$xArray );
|
||||
}
|
||||
else
|
||||
{ // Never been an extended user fields record for this user
|
||||
$xArray['data']['user_extended_id'] = $row['user_id'];
|
||||
$ue->addDefaultFields($xArray); // Add in the data types for storage, plus any default values
|
||||
if (AA_DEBUG) $this->e107->admin_log->e_log_event(10,debug_backtrace(),"DEBUG","Alt auth login","Write new extended record".print_r($xFields,TRUE),FALSE,LOG_TO_ROLLING);
|
||||
$aa_sql->db_Insert('user_extended',$xArray);
|
||||
$aa_sql->insert('user_extended',$xArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -545,7 +545,7 @@ $columnInfo = array(
|
||||
$foundSome = false;
|
||||
foreach($files as $file)
|
||||
{
|
||||
if (0 == $sql->db_Count('download', '(*)', " WHERE download_url='".$file['fname']."'")) {
|
||||
if (0 == $sql->count('download', '(*)', " WHERE download_url='".$file['fname']."'")) {
|
||||
if (!$foundSome) {
|
||||
// $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform");
|
||||
$text .= '<form method="post" action="'.e_SELF.'?'.e_QUERY.'" id="myform">
|
||||
@@ -816,7 +816,7 @@ $columnInfo = array(
|
||||
$files = $efile->get_files(e_DOWNLOAD);
|
||||
$foundSome = false;
|
||||
foreach($files as $file) {
|
||||
if (0 == $sql->db_Count('download', '(*)', " WHERE download_url='".$file['fname']."'")) {
|
||||
if (0 == $sql->count('download', '(*)', " WHERE download_url='".$file['fname']."'")) {
|
||||
if (!$foundSome) {
|
||||
// $text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform");
|
||||
$text .= '<form method="post" action="'.e_SELF.'?'.e_QUERY.'" id="myform">
|
||||
@@ -1877,7 +1877,7 @@ $columnInfo = array(
|
||||
$updateArray = array_merge($dlInfo,$dlMirrors);
|
||||
$updateArray['WHERE'] = 'download_id='.intval($id);
|
||||
|
||||
$mes->addAuto($sql->db_Update('download',$updateArray), 'update', DOWLAN_2." (<a href='".e_PLUGIN."download/download.php?view.".$id."'>".$_POST['download_name']."</a>)");
|
||||
$mes->addAuto($sql->update('download',$updateArray), 'update', DOWLAN_2." (<a href='".e_PLUGIN."download/download.php?view.".$id."'>".$_POST['download_name']."</a>)");
|
||||
|
||||
$dlInfo['download_id'] = $id;
|
||||
$this->downloadLog('DOWNL_06',$dlInfo,$dlMirrors);
|
||||
@@ -1909,7 +1909,7 @@ $columnInfo = array(
|
||||
|
||||
if ($_POST['remove_upload'])
|
||||
{
|
||||
$sql->db_Update("upload", "upload_active='1' WHERE upload_id='".$_POST['remove_id']."'");
|
||||
$sql->update("upload", "upload_active='1' WHERE upload_id='".$_POST['remove_id']."'");
|
||||
$mess = "<br/>".$_POST['download_name']." ".DOWLAN_104;
|
||||
$mess .= "<br/><br/><a href='".e_ADMIN."upload.php'>".DOWLAN_105."</a>";
|
||||
$this->show_message($mess);
|
||||
@@ -1956,7 +1956,7 @@ $columnInfo = array(
|
||||
|
||||
if ($delete == "mirror")
|
||||
{
|
||||
$mes->addAuto($sql -> db_Delete("download_mirror", "mirror_id=".$del_id), delete, DOWLAN_135);
|
||||
$mes->addAuto($sql ->delete("download_mirror", "mirror_id=".$del_id), delete, DOWLAN_135);
|
||||
e107::getLog()->add('DOWNL_14','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
@@ -2107,12 +2107,12 @@ $columnInfo = array(
|
||||
|
||||
if (isset($_POST['id']))
|
||||
{
|
||||
$mes->addAuto($sql -> db_Update("download_mirror", "mirror_name='{$name}', mirror_url='{$url}', mirror_image='".$tp->toDB($_POST['mirror_image'])."', mirror_location='{$location}', mirror_description='{$description}' WHERE mirror_id=".intval($_POST['id'])), 'update', DOWLAN_133);
|
||||
$mes->addAuto($sql ->update("download_mirror", "mirror_name='{$name}', mirror_url='{$url}', mirror_image='".$tp->toDB($_POST['mirror_image'])."', mirror_location='{$location}', mirror_description='{$description}' WHERE mirror_id=".intval($_POST['id'])), 'update', DOWLAN_133);
|
||||
e107::getLog()->add('DOWNL_13','ID: '.intval($_POST['id']).'[!br!]'.$logString,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
$mes->addAuto($sql -> db_Insert("download_mirror", "0, '{$name}', '{$url}', '".$tp->toDB($_POST['mirror_image'])."', '{$location}', '{$description}', 0"), 'insert', DOWLAN_134);
|
||||
$mes->addAuto($sql ->insert("download_mirror", "0, '{$name}', '{$url}', '".$tp->toDB($_POST['mirror_image'])."', '{$location}', '{$description}', 0"), 'insert', DOWLAN_134);
|
||||
e107::getLog()->add('DOWNL_12',$logString,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ if (isset($_POST['faq_submit']))
|
||||
{
|
||||
$faq_question = $tp->toDB($_POST['faq_question']);
|
||||
$data = $tp->toDB($_POST['data']);
|
||||
$count = ($sql->db_Count("faqs", "(*)", "WHERE faq_parent='".intval($_POST['faq_parent'])."' ") + 1);
|
||||
$count = ($sql->count("faqs", "(*)", "WHERE faq_parent='".intval($_POST['faq_parent'])."' ") + 1);
|
||||
|
||||
$sql->insert("faqs", " 0, '".$_POST['faq_parent']."', '$faq_question', '$data', '".filter_var($_POST['faq_comment'], FILTER_SANITIZE_STRING)."', '".time()."', '".USERID."', '".$count."' ");
|
||||
|
||||
|
@@ -550,11 +550,11 @@
|
||||
if($forum->prefs->get('sig_once'))
|
||||
{
|
||||
$_tmp = 'forum_sig_shown_' . $this->postInfo['post_user'];
|
||||
if(getcachedvars($_tmp))
|
||||
if(e107::getRegistry($_tmp))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
cachevars($_tmp, 1);
|
||||
e107::setRegistry($_tmp, 1);
|
||||
}
|
||||
|
||||
if($parm == 'clean')
|
||||
|
@@ -68,7 +68,7 @@ class pmbox_manager
|
||||
$pm_info[$which] = $this->pmDB->fetch();
|
||||
if ($which == 'inbox' && ($this->pmPrefs['animate'] == 1 || $this->pmPrefs['popup'] == 1))
|
||||
{
|
||||
if($new = $this->pmDB->db_Count('private_msg', '(*)', "WHERE pm_sent > '".USERLV."' AND pm_read = 0 AND pm_to = '".USERID."' AND pm_read_del != 1"))
|
||||
if($new = $this->pmDB->count('private_msg', '(*)', "WHERE pm_sent > '".USERLV."' AND pm_read = 0 AND pm_to = '".USERID."' AND pm_read_del != 1"))
|
||||
{
|
||||
$pm_info['inbox']['new'] = $new;
|
||||
}
|
||||
|
@@ -31,8 +31,8 @@ class pm_setup
|
||||
function uninstall_post()
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$sql->db_Delete('core', "e107_name = 'pm_prefs'");
|
||||
$sql->db_Delete('menus', "menu_name = 'private_msg_menu'");
|
||||
$sql->delete('core', "e107_name = 'pm_prefs'");
|
||||
$sql->delete('menus', "menu_name = 'private_msg_menu'");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -490,7 +490,7 @@ class tinymce
|
||||
if($id)
|
||||
{
|
||||
$insert_array['WHERE'] = $this->primary." = ".$id;
|
||||
$status = $sql->db_Update($this->table,$insert_array) ? E_MESSAGE_SUCCESS : E_MESSAGE_FAILED;
|
||||
$status = $sql->update($this->table,$insert_array) ? E_MESSAGE_SUCCESS : E_MESSAGE_FAILED;
|
||||
$message = LAN_UPDATED;
|
||||
|
||||
|
||||
@@ -499,7 +499,7 @@ class tinymce
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = $sql->db_Insert($this->table,$insert_array) ? E_MESSAGE_SUCCESS : E_MESSAGE_FAILED;
|
||||
$status = $sql->insert($this->table,$insert_array) ? E_MESSAGE_SUCCESS : E_MESSAGE_FAILED;
|
||||
$message = LAN_CREATED;
|
||||
}
|
||||
|
||||
@@ -518,7 +518,7 @@ class tinymce
|
||||
$sql = e107::getDb();
|
||||
|
||||
$query = $this->primary." = ".$id;
|
||||
$status = $sql->db_Delete($this->table,$query) ? E_MESSAGE_SUCCESS : E_MESSAGE_FAILED;
|
||||
$status = $sql->delete($this->table,$query) ? E_MESSAGE_SUCCESS : E_MESSAGE_FAILED;
|
||||
$message = LAN_DELETED;
|
||||
$emessage->add($message, $status);
|
||||
}
|
||||
|
Reference in New Issue
Block a user