1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

Code cleanup / globals removal etc.

This commit is contained in:
Cameron
2015-02-15 16:07:27 -08:00
parent 83ea70f881
commit 9a21cad851
39 changed files with 198 additions and 154 deletions

View File

@@ -656,7 +656,10 @@ unset($die);
//
$sql->db_Mark_Time('Start: Misc resources. Online user tracking, cache');
//DEPRECATED, BC, call the method only when needed, $e107->ecache caught by __get()
/**
* @deprecated BC, call the method only when needed, $e107->ecache caught by __get()
*/
$e107cache = e107::getCache(); //TODO - find & replace $e107cache, $e107->ecache
//DEPRECATED, BC, call the method only when needed, $e107->override caught by __get()
@@ -665,10 +668,10 @@ $override = e107::getSingleton('override', true); //TODO - find & replace $overr
//DEPRECATED, BC, call the method only when needed, $e107->user_class caught by __get()
$e_userclass = e107::getUserClass(); //TODO - find & replace $e_userclass, $e107->user_class
//TODO - move the check to e107::notify()? What's the idea behind $pref['notify']?
if(isset($pref['notify']) && $pref['notify'] == true)
if(!empty($pref['notify']))
{
e107_require_once(e_HANDLER.'notify_class.php');
e107::getNotify()->registerEvents();
}
//
@@ -679,7 +682,10 @@ init_session(); // Set up a lot of the user-related constants
//DEPRECATED but necessary. BC Fix.
/**
* @deprecated but necessary. BC Fix.
* @return string
*/
function getip()
{
return e107::getIPHandler()->ipDecode(USERIP);
@@ -873,7 +879,7 @@ if (!class_exists('e107table', false))
/**
* @param $caption string caption text
* @param $text body text
* @param $text string
* @param $mode unique identifier
* @param $return boolean : return the html instead of echo it.
* @return null
@@ -1469,11 +1475,9 @@ function getperms($arg, $ap = ADMINPERMS)
}
/**
* @DEPRECATED
* @deprecated
* Get the user data from user and user_extended tables
* SO MUCH DEPRECATED! Use e107::user($uid);
*
*
* @return array
*/
function get_user_data($uid, $extra = '')
@@ -1546,12 +1550,23 @@ function save_prefs($table = 'core', $uid = USERID, $row_val = '')
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
//DEPRECATED - use e107::setRegistry()
/**
* @deprecated use e107::setRegistry()
* @param $id
* @param $var
*/
function cachevars($id, $var)
{
e107::setRegistry('core/cachedvars/'.$id, $var);
}
//DEPRECATED - use e107::getRegistry()
/**
* @deprecated use e107::getRegistry()
* @param $id
* @return mixed
*/
function getcachedvars($id)
{
return e107::getRegistry('core/cachedvars/'.$id, false);
@@ -1902,7 +1917,7 @@ function class_list($uid = '')
/**
* Will be deprecated, probably by e107::includeLan();
*
* @deprecated by e107::lan();
* @param string $path
* @param boolean $force [optional] Please use the default
* @return void
@@ -1939,6 +1954,12 @@ function include_lan_admin($path)
// $pref['noLanguageSubs'] can be set TRUE to prevent searching for the English files if the files for the current site language don't exist.
//DEPRECATED - use e107::loadLanFiles();
/**
* @deprecated - use e107::loadLanFiles();
* @param $unitName
* @param string $type
* @return bool|string
*/
function loadLanFiles($unitName, $type='runtime')
{
$info = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2);
@@ -2302,7 +2323,13 @@ function e107_ini_set($var, $value)
}
// Return true if specified plugin installed, false if not
//DEPRECATED - use e107::isInstalled();
//DEPRECATED
/**
* @deprecated - use e107::isInstalled();
* @param $plugname
* @return bool
*/
function plugInstalled($plugname)
{
return e107::isInstalled($plugname);

View File

@@ -222,11 +222,11 @@ if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit']))
$cobj->enter_comment($clean_authorname, $clean_comment, $table, $id, $pid, $clean_subject);
if ($table == "news")
{
$e107cache->clear("news");
e107::getCache()->clear("news");
}
else
{
$e107cache->clear("comment.php?{$table}.{$id}");
e107::getCache()->clear("comment.php?{$table}.{$id}");
}
if($editpid)
@@ -241,14 +241,14 @@ if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit']))
if (isset($_POST['replysubmit']))
{ // Reply to nested comment being posted
if ($table == "news" && !$sql->db_Select("news", "news_allow_comments", "news_id='{$nid}' "))
if ($table == "news" && !$sql->select("news", "news_allow_comments", "news_id='{$nid}' "))
{
header('location: '.e_BASE.'index.php');
exit;
}
else
{
$row = $sql->db_Fetch();
$row = $sql->fetch();
if (!$row['news_id'])
{
$pid = (isset($_POST['pid']) ? $_POST['pid'] : 0);
@@ -259,7 +259,7 @@ if (isset($_POST['replysubmit']))
$clean_subject = $_POST['subject'];
$cobj->enter_comment($clean_authorname, $clean_comment, $table, $nid, $pid, $clean_subject);
$e107cache->clear("comment.php?{$table}.{$id}");
e107::getCache()->clear("comment.php?{$table}.{$id}");
}
$redirectFlag = $nid;
}
@@ -389,7 +389,7 @@ elseif ($action == 'comment')
{ // Default code if not reply
// Check cache
if ($cache = $e107cache->retrieve("comment.php?{$table}.{$id}"))
if ($cache = e107::getCache()->retrieve("comment.php?{$table}.{$id}"))
{
require_once(HEADERF);
echo $cache;
@@ -596,7 +596,7 @@ if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == 'n
if ($comment_ob_start)
{
$cache = ob_get_contents();
$e107cache->set("comment.php?{$table}.{$field}", $cache);
e107::getCache()->set("comment.php?{$table}.{$field}", $cache);
ob_end_flush(); // dump the buffer we started
}

View File

@@ -11,7 +11,7 @@
*/
require_once("class2.php");
define('e_HANDLER', "e107_handlers/");
// security image may be disabled by removing the appropriate shortcodes from the template.
require_once(e_HANDLER."secure_img_handler.php");
$sec_img = new secure_image;

View File

@@ -357,9 +357,9 @@ while ($files[$c])
{
$img = "def";
}
$size = $e107->parseMemorySize(filesize(e_BASE.$path."/".$files[$c]));
$size = eHelper::parseMemorySize(filesize(e_BASE.$path."/".$files[$c]));
$gen = new convert;
$filedate = $gen -> convert_date(filemtime(e_BASE.$path."/".$files[$c]), "forum");
$filedate = e107::getDate()->convert_date(filemtime(e_BASE.$path."/".$files[$c]), "forum");
$text .= "
<tr>

View File

@@ -1317,7 +1317,7 @@ require_once("auth.php");
if($_POST)
{
$e107cache->clear_sys("menus_");
e107::getCache()->clear_sys("menus_");
}

View File

@@ -54,7 +54,7 @@ if (isset($_POST['update_settings']))
$userMethods->makeUserCookie(array('user_id' => USERID,'user_password' => $userData['data']['user_password']), FALSE); // Can't handle autologin ATM
$mes->addSuccess(UDALAN_3." ".ADMINNAME);
$e_event->trigger('adpword'); //@deprecated
e107::getEvent()->trigger('adpword'); //@deprecated
$eventData = array('user_id'=> USERID, 'user_pwchange'=> $userData['data']['user_pwchange']);
e107::getEvent()->trigger('admin_password_update',$eventData );

View File

@@ -222,7 +222,7 @@ class _system_cron
$ipManager->banRetriggerAction();
if (CRON_RETRIGGER_DEBUG)
{
$e107->admin_log->e_log_event(10,debug_backtrace(),'DEBUG','CRON Ban Retrigger','Retrigger processing completed',FALSE,LOG_TO_ROLLING);
e107::getLog()->e_log_event(10,debug_backtrace(),'DEBUG','CRON Ban Retrigger','Retrigger processing completed',FALSE,LOG_TO_ROLLING);
}
}

View File

@@ -362,7 +362,6 @@ abstract class e_marketplace_adapter_abstract
else
{
$mes->addSuccess( "<a href='".$remotefile."'>Download Manually</a>"); // flush(); usleep(50000);
$mes->addDebug(print_a($unarc, true)); flush();
}
return false;
@@ -690,7 +689,10 @@ class e_marketplace_adapter_xmlrpc extends e_marketplace_adapter_abstract
foreach ($xml as $name => $node)
{
$_res = $this->parse($node, $name);
if(is_string($_res)) $_res = trim($res);
if(is_string($_res))
{
$_res = trim($_res);
}
$ret[$name][] = $this->parse($node, $name);
}
@@ -737,7 +739,7 @@ class e_marketplace_adapter_xmlrpc extends e_marketplace_adapter_abstract
{
if($tag === 'params')
{
foreach ($data['param'] as $param)
foreach ($data['param'] as $i => $param)
{
$result[$tag][$param['@attributes']['name']] = $param['@value'];
unset($result[$tag]['param'][$i]);

View File

@@ -27,7 +27,8 @@ class e107_event
'user_xup_login' => 'User social login',
'user_xup_signup' => 'User social signup',
'user_ban_flood' => NS_LAN_2,
'user_ban_failed_login' => 'IP banned for multiple failed login attempts'
'user_ban_failed_login' => 'IP banned for multiple failed login attempts',
'user_profile_display' => "User views profile"
),

View File

@@ -135,6 +135,8 @@ class e_db_mysql
if(defined('e_LANGUAGE')) $this->mySQLlanguage = e107::getLanguage()->e_language;
}
/**
* Connects to mySQL server and selects database - generally not required if your table is in the main DB.<br />
* <br />

View File

@@ -26,9 +26,9 @@ class sitelinks
$sql = e107::getDb('sqlSiteLinks');
$ins = ($cat > 0) ? "link_category = ".intval($cat)." AND " : "";
$query = "SELECT * FROM #links WHERE ".$ins." link_class IN (".USERCLASS_LIST.") ORDER BY link_order ASC";
if($sql->db_Select_gen($query))
if($sql->gen($query))
{
while ($row = $sql->db_Fetch())
while ($row = $sql->fetch())
{
if($row['link_sefurl'])
{

View File

@@ -389,7 +389,7 @@ class alt_auth_admin extends alt_auth_base
$log_result = $_login->login($val_name, $_POST['passtovalidate'], $pass_vars, ($val_name == ''));
}
$text .= "<tr><td$log>".LAN_ALT_48;
$text .= "<tr><td>".LAN_ALT_48;
if ($val_name)
{
$text .= "<br />".LAN_ALT_49.$val_name.'<br />'.LAN_ALT_50;

View File

@@ -221,9 +221,10 @@ class alt_login
$xFields['user_extended_id'] = $newID;
$xArray = array();
$xArray['data'] = $xFields;
$ue->addDefaultFields($xArray); // Add in the data types for storage, plus any default values
$result = $aa_sql->db_Insert('user_extended',$xArray);
if (AA_DEBUG) $this->e107->admin_log->e_log_event(10,debug_backtrace(),'DEBUG','Alt auth login',"Add extended: UID={$newID} result={$result}",FALSE,LOG_TO_ROLLING);
e107::getUserExt()->addDefaultFields($xArray); // Add in the data types for storage, plus any default values
$result = $aa_sql->insert('user_extended',$xArray);
if (AA_DEBUG) e107::getLog()->e_log_event(10,debug_backtrace(),'DEBUG','Alt auth login',"Add extended: UID={$newID} result={$result}",FALSE,LOG_TO_ROLLING);
}
}
else

View File

@@ -443,7 +443,7 @@ class banner_form_ui extends e_admin_form_ui
case 'filter':
case 'batch':
return $array;
return null;
break;
}
}

View File

@@ -49,21 +49,21 @@ if (isset($_POST['prune']))
$chatbox_prune = intval($_POST['chatbox_prune']);
$prunetime = time() - $chatbox_prune;
$sql->db_Delete("chatbox", "cb_datestamp < '{$prunetime}' ");
$sql->delete("chatbox", "cb_datestamp < '{$prunetime}' ");
e107::getLog()->add('CHBLAN_02', $chatbox_prune.', '.$prunetime, E_LOG_INFORMATIVE, '');
$e107cache->clear("nq_chatbox");
e107::getCache()->clear("nq_chatbox");
$mes->addSuccess(LAN_AL_CHBLAN_02);
}
if (isset($_POST['recalculate']))
{
$sql->db_Update("user", "user_chats = 0");
$sql->update("user", "user_chats = 0");
$qry = "SELECT u.user_id AS uid, count(c.cb_nick) AS count FROM #chatbox AS c
LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick,'.',1) = u.user_id
WHERE u.user_id > 0
GROUP BY uid";
if ($sql -> db_Select_gen($qry))
if ($sql->gen($qry))
{
$ret = array();
while($row = $sql -> db_Fetch())
@@ -74,8 +74,9 @@ if (isset($_POST['recalculate']))
foreach($list as $uid => $cnt)
{
$sql->db_Update("user", "user_chats = '{$cnt}' WHERE user_id = '{$uid}'");
$sql->update("user", "user_chats = '{$cnt}' WHERE user_id = '{$uid}'");
}
e107::getLog()->add('CHBLAN_03','', E_LOG_INFORMATIVE, '');
$mes->addSuccess(CHBLAN_33);
}

View File

@@ -64,7 +64,7 @@ if($_POST['moderate'] && CB_MOD)
}
$sql->gen("DELETE FROM #chatbox WHERE cb_id IN ({$deletelist})");
}
$e107cache->clear("nq_chatbox");
e107::getCache()->clear("nq_chatbox");
$mes->addSuccess(CHATBOX_L18);
}

View File

@@ -326,7 +326,7 @@ if ($action == "uopt")
global $ns, $sql, $gen, $e107, $tp;
$frm = new e_form(true); //enable inner tabindex counter
$imgd = e_BASE.$IMAGES_DIRECTORY;
$columnInfo = array(
"checkboxes" => array("title" => "", "forced"=> TRUE, "width" => "3%", "thclass" => "center first", "toggle" => "dl_selected"),
"upload_id" => array("title"=>DOWLAN_67, "type"=>"", "width"=>"auto", "thclass"=>"", "forced"=>true),
@@ -533,18 +533,14 @@ if ($action == "uopt")
}
/**
*
*/
function show_upload_filetypes() {
global $ns;
//TODO is there an e107:: copy of this
if (!is_object($e_userclass))
{
$e_userclass = new user_class;
}
$ns = e107::getRender();
$e_userclass = e107::getUserClass();
if(!getperms("0")) exit; //TODO still needed?

View File

@@ -65,7 +65,7 @@ if (!e107::isInstalled('download'))
e107::getComment()->enter_comment($clean_authorname, $clean_comment, "download", $id, $pid, $clean_subject);
// $e107cache->clear("comment.download.{$sub_action}"); $sub_action not used here
$e107cache->clear("comment.download");
e107::getCache()->clear("comment.download");
}
}
}

View File

@@ -467,8 +467,8 @@ $columnInfo = array(
$text .= '</tr>';
$foundSome = true;
}
$filesize = (is_readable(e_DOWNLOAD.$row['download_url']) ? $e107->parseMemorySize(filesize(e_DOWNLOAD.$file['fname'])) : DOWLAN_181);
$filets = (is_readable(e_DOWNLOAD.$row['download_url']) ? $gen->convert_date(filectime(e_DOWNLOAD.$file['fname']), "long") : DOWLAN_181);
$filesize = (is_readable(e_DOWNLOAD.$row['download_url']) ? eHelper::parseMemorySize(filesize(e_DOWNLOAD.$file['fname'])) : DOWLAN_181);
$filets = (is_readable(e_DOWNLOAD.$row['download_url']) ? e107::getDate()->convert_date(filectime(e_DOWNLOAD.$file['fname']), "long") : DOWLAN_181);
$text .= '<tr>';
$text .= '<td>'.$tp->toHTML($file['fname']).'</td>';
$text .= '<td>'.$filets.'</td>';

View File

@@ -127,7 +127,7 @@ switch($this->parm){ //FIXME use v2.x standard and replace this with $parm['url'
}
$rss[$i]['title'] = $value['thread_name'];
$rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$value['thread_id'];
$rss[$i]['link'] = SITEURLBASE.e_PLUGIN_ABS."forum/forum_viewtopic.php?".$value['thread_id'];
$rss[$i]['description'] = $value['thread_thread'];
$rss[$i]['datestamp'] = $value['thread_datestamp'];

View File

@@ -1354,7 +1354,7 @@ class forumAdmin
{
if ($reported_total = $sql->select("generic", "*", "gen_type='reported_post' OR gen_type='Reported Forum Post'"))
{
$text .= "
$text = "
<table class='table adminlist'>
<tr>
<td>".FORLAN_170."</td>

View File

@@ -570,10 +570,13 @@ class e107forum
$id = (int)$id;
if($sql->select('forum_track', 'track_thread', 'track_userid = '.$id))
{
$ret = array();
while($row = $sql->fetch(MYSQL_ASSOC))
{
$ret[] = $row['track_thread'];
}
return ($retType == 'array' ? $ret : implode(',', $ret));
}
return false;

View File

@@ -333,7 +333,7 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
$poll->submit_poll(2);
}
$e107cache->clear('newforumposts');
e107::getCache()->clear('newforumposts');
$postInfo = $forum->postGet($newPostId, 'post');
$forumInfo = $forum->forumGet($postInfo['post_forum']);
@@ -412,7 +412,7 @@ if (isset($_POST['update_thread']))
$forum->threadUpdate($postInfo['post_thread'], $threadVals);
$forum->postUpdate($postInfo['post_id'], $postVals);
$e107cache->clear('newforumposts');
e107::getCache()->clear('newforumposts');
$url = e107::getUrl()->create('forum/thread/post', array('name'=>$threadVals['thread_name'], 'id' => $postInfo['post_id'], 'thread' => $postInfo['post_thread']), array('encode'=>false));
header('location:'.$url);
exit;
@@ -440,7 +440,7 @@ if (isset($_POST['update_reply']))
$postVals['post_entry'] = $_POST['post'];
$forum->postUpdate($postInfo['post_id'], $postVals);
$e107cache->clear('newforumposts');
e107::getCache()->clear('newforumposts');
$url = e107::getUrl()->create('forum/thread/post', "id={$postInfo['post_id']}", 'encode=0&full=1'); // XXX what data is available, find thread name
header('location:'.$url);
exit;

View File

@@ -18,7 +18,7 @@ if (!$e107->isInstalled('forum'))
if(!USER)
{
header("location:".e_BASE.$PLUGINS_DIRECTORY."forum/forum.php");
header("location:".e_PLUGIN."forum/forum.php");
exit;
}

View File

@@ -389,8 +389,9 @@ class plugin_forum_view_shortcodes extends e_shortcode
}
}
function sc_lasteditby()
{ if(isset($this->postInfo['edit_name']))
function sc_lasteditby($parm='')
{
if(isset($this->postInfo['edit_name']))
{
if($parm == 'link')
{

View File

@@ -115,7 +115,7 @@ if (isset($_POST['saveopts_linkword']))
$pref['lw_notsamepage'] = isset($_POST['lw_notsamepage']);
save_prefs();
$logString = implode(', ',$pref['lw_context_visibility']).'[!br!]'.$pref['lw_page_visibility'].'[!br!]'.$pref['lw_ajax_enable'].'[!br!]'.$pref['lw_notsamepage'];
$e107->ecache->clear_sys(LW_CACHE_TAG);
e107::getCache()->clear_sys(LW_CACHE_TAG);
e107::getLog()->add('LINKWD_04',$logString,'');
}
@@ -163,7 +163,8 @@ if (isset($_POST['submit_linkword']) || isset($_POST['update_linkword']))
$mes->addError(LAN_UPDATED_FAILED);
}
}
$e107->ecache->clear_sys(LW_CACHE_TAG);
e107::getCache()->clear_sys(LW_CACHE_TAG);
}
}

View File

@@ -74,7 +74,7 @@ if (isset($_POST['createFeed']) || isset($_POST['updateFeed']))
$mes->addInfo(LAN_NO_CHANGE.': '.$sql->mySQLerror);
}
}
$e107->ecache->clear(NEWSFEED_LIST_CACHE_TAG); // This should actually clear all the newsfeed data in one go
e107::getCache()->clear(NEWSFEED_LIST_CACHE_TAG); // This should actually clear all the newsfeed data in one go
}
else
{

View File

@@ -113,7 +113,7 @@ class newsfeedClass
if ($this->useCache)
{ // Cache enabled - we need to save some updated info
$temp = e107::serialize($this->feedList, FALSE);
$e107->ecache->set(NEWSFEED_LIST_CACHE_TAG,$temp);
e107::getCache()->set(NEWSFEED_LIST_CACHE_TAG,$temp);
}
}

View File

@@ -24,7 +24,7 @@
*/
if (!defined('e107_INIT')) { exit; }
if (!$e107->isInstalled('newsletter'))
if (!e107::isInstalled('newsletter'))
{
return;
}

View File

@@ -121,7 +121,7 @@ if (isset($_POST['update_prefs']))
$temp[$k] = $v;
}
}
if ($e107->admin_log->logArrayDiffs($temp, $pm_prefs, 'PM_ADM_02'))
if (e107::getLog()->logArrayDiffs($temp, $pm_prefs, 'PM_ADM_02'))
{
// $sysprefs->setArray('pm_prefs');
//print_a($temp);
@@ -189,14 +189,15 @@ if(isset($_POST['addlimit']))
'gen_intdata' => intval($_POST['new_inbox_size']),
'gen_chardata' => intval($_POST['new_outbox_size'])
);
if($sql->db_Insert('generic', $limArray))
if($sql->insert('generic', $limArray))
{
$e107->admin_log->logArrayAll('PM_ADM_05', $limArray);
e107::getLog()->logArrayAll('PM_ADM_05', $limArray);
$mes->addSuccess(ADLAN_PM_6);
}
else
{
$e107->admin_log->log_event('PM_ADM_08', '');
e107::getLog()->log_event('PM_ADM_08', '');
$mes->addError(ADLAN_PM_7);
}
}
@@ -217,14 +218,14 @@ if(isset($_POST['updatelimits']))
if($_POST['inbox_count'][$id] == '' && $_POST['outbox_count'][$id] == '' && $_POST['inbox_size'][$id] == '' && $_POST['outbox_size'][$id] == '')
{
//All entries empty - Remove record
if($sql->db_Delete('generic','gen_id = '.$id))
if($sql->delete('generic','gen_id = '.$id))
{
$e107->admin_log->log_event('PM_ADM_07', 'ID: '.$id);
e107::getLog()->log_event('PM_ADM_07', 'ID: '.$id);
$mes->addSuccess($id.ADLAN_PM_9);
}
else
{
$e107->admin_log->log_event('PM_ADM_10', '');
e107::getLog()->log_event('PM_ADM_10', '');
$mes->addError($id.ADLAN_PM_10);
}
}
@@ -236,14 +237,14 @@ if(isset($_POST['updatelimits']))
'gen_intdata' => intval($_POST['inbox_size'][$id]),
'gen_chardata' => intval($_POST['outbox_size'][$id])
);
if ($sql->db_Update('generic',array('data' => $limArray, 'WHERE' => 'gen_id = '.$id)))
if ($sql->update('generic',array('data' => $limArray, 'WHERE' => 'gen_id = '.$id)))
{
$e107->admin_log->logArrayAll('PM_ADM_06', $limArray);
e107::getLog()->logArrayAll('PM_ADM_06', $limArray);
$mes->addSuccess($id.ADLAN_PM_11);
}
else
{
$e107->admin_log->log_event('PM_ADM_09', '');
e107::getLog()->log_event('PM_ADM_09', '');
$mes->addError($id.ADLAN_PM_7);
}
}

View File

@@ -128,6 +128,9 @@ class pm_shortcodes extends e_shortcode
{
return '';
}
$ret = "";
if(check_class($this->pmPrefs['opt_userclass']) && check_class($this->pmPrefs['multi_class']))
{
$ret = "<input type='checkbox' name='to_userclass' value='1' />".LAN_PM_4." ";

View File

@@ -201,7 +201,7 @@ if(isset($_POST['delete']))
$d_idt = array_keys($_POST['delete']);
$message = ($sql -> db_Delete("rss", "rss_id=".intval($d_idt[0]))) ? LAN_DELETED : LAN_DELETED_FAILED;
e107::getLog()->add('RSS_01','ID: '.intval($d_idt[0]).' - '.$message,E_LOG_INFORMATIVE,'');
$e107cache->clear("rss");
e107::getCache()->clear("rss");
}
// Create rss feed

View File

@@ -233,7 +233,7 @@ class rssCreate
$this -> rssItems[$loop]['author_email'] = $value['user_email'];
// $this -> rssItems[$loop]['category'] = "<category domain='".SITEURL."news.php?cat.".$value['news_category']."'>".$value['category_name']."</category>";
$this -> rssItems[$loop]['category_name'] = $tp->toHTML($value['category_name'],TRUE,'defs');
$this -> rssItems[$loop]['category_link'] = $e107->base_path."news.php?cat.".$value['news_category'];
$this -> rssItems[$loop]['category_link'] = SITEURL."news.php?cat.".$value['news_category']; //TODO SEFURL.
if($value['news_allow_comments'] && $pref['comments_disabled'] != 1)
{

View File

@@ -110,6 +110,6 @@ if ($errorHeader) header($errorHeader);
require_once(HEADERF);
$ns->tablerender(PAGE_NAME, $errorText);
e107::getRender()->tablerender(PAGE_NAME, $errorText);
require_once(FOOTERF);
?>

View File

@@ -21,7 +21,7 @@ require_once("class2.php");
if (!e_QUERY || isset($_POST['userlogin']))
{
header("location: {$e107->base_path}");
header("location: ".SITEURL); // $e107->base_path
exit();
}

View File

@@ -118,7 +118,8 @@ if (isset($_POST['submitnews_submit']) && $_POST['submitnews_title'] && $_POST['
$sql->insert("submitnews", "0, '$submitnews_user', '$submitnews_email', '$submitnews_title', '".intval($_POST['cat_id'])."', '$submitnews_item', '".time()."', '$ip', '0', '".implode(',',$submitnews_filearray)."' ");
$edata_sn = array("user" => $submitnews_user, "email" => $submitnews_email, "itemtitle" => $submitnews_title, "catid" => intval($_POST['cat_id']), "item" => $submitnews_item, "image" => $submitnews_file, "ip" => $ip);
$e_event->trigger("subnews", $edata_sn);
e107::getEvent()->trigger("subnews", $edata_sn); // bc
e107::getEvent()->trigger("user_news_submit", $edata_sn);
$mes = e107::getMessage();

View File

@@ -103,7 +103,7 @@ if ($action == 'active')
$lastpost_datestamp = $gen->convert_date($row['thread_lastpost'], 'forum');
if ($row['user_last'])
{
$LASTPOST = "<a href='".$e107->url->create('user/profile/view', "name={$row['user_last']}&id={$row['thread_lastuser']}")."'>{$row['user_last']}</a><br />".$lastpost_datestamp;
$LASTPOST = "<a href='".e107::getUrl()->create('user/profile/view', "name={$row['user_last']}&id={$row['thread_lastuser']}")."'>{$row['user_last']}</a><br />".$lastpost_datestamp;
}
else
{

View File

@@ -161,8 +161,10 @@ if (isset($id))
$loop_uid = $id;
$ret = $e_event->trigger("showuser", $id);
if ($ret!='')
$ret = e107::getEvent()->trigger("showuser", $id);
$ret2 = e107::getEvent()->trigger('user_profile_display',$id);
if (!empty($ret) || !empty($ret2))
{
$text = "<div style='text-align:center'>".$ret."</div>";
$ns->tablerender(LAN_USER_48, $text);

View File

@@ -433,12 +433,10 @@ e107::getMessage()->addDebug("<h5>Posted Changes</h5>".print_a($changedUserData,
if (isset($allData['data']['user_class']))
{
unset($changedUserData['user_class']); // We always recalculate this
if (FALSE === $adminEdit)
{ // Make sure admin can't edit another's user classes
if (!is_object($e_userclass))
if (FALSE === $adminEdit) // Make sure admin can't edit another's user classes
{
$e_userclass = new user_class;
}
$e_userclass = e107::getUserClass();
$ucList = $e_userclass->get_editable_classes(USERCLASS_LIST,TRUE); // List of classes which this user can edit
if (count($ucList))
{
@@ -469,7 +467,7 @@ e107::getMessage()->addDebug("<h5>Posted Changes</h5>".print_a($changedUserData,
if (!$error && count($changedUserData) || count($changedEUFData))
{
$_POST['user_id'] = $inp;
$ret = $e_event->trigger('preuserset', $_POST);
$ret =e107::getEvent()->trigger('preuserset', $_POST);
if ($ret == '')
{
@@ -730,10 +728,10 @@ if ($dataToSave && !$promptPassword)
$e_event->trigger('postuserset', $_POST);
e107::getEvent()->trigger('postuserset', $_POST);
if (count($triggerData))
{
$e_event->trigger('userdatachanged', $triggerData);
e107::getEvent()->trigger('userdatachanged', $triggerData);
}
if (e_QUERY == 'update')
@@ -957,7 +955,11 @@ function req($field)
// Also deletes from database if appropriate.
function delete_file($fname, $dir = 'avatars/')
{
global $sql;
return;
/*
$sql = e107::getDb();
$tp = e107::getParser();
$fname = trim($fname);
if (!$fname) return false;
@@ -971,6 +973,6 @@ function delete_file($fname, $dir = 'avatars/')
return true;
}
return false;
*/
}
?>