diff --git a/class2.php b/class2.php index 27f0312b7..6e560c719 100644 --- a/class2.php +++ b/class2.php @@ -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); diff --git a/comment.php b/comment.php index 3bdac645f..336c74362 100644 --- a/comment.php +++ b/comment.php @@ -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 } diff --git a/contact.php b/contact.php index ca9b0f862..bf6feb785 100644 --- a/contact.php +++ b/contact.php @@ -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; diff --git a/e107_admin/filemanager.php b/e107_admin/filemanager.php index d237c65cd..fec0a48a8 100644 --- a/e107_admin/filemanager.php +++ b/e107_admin/filemanager.php @@ -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 .= " diff --git a/e107_admin/menus.php b/e107_admin/menus.php index 67ceab52c..8a434fd46 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -1317,7 +1317,7 @@ require_once("auth.php"); if($_POST) { - $e107cache->clear_sys("menus_"); + e107::getCache()->clear_sys("menus_"); } diff --git a/e107_admin/updateadmin.php b/e107_admin/updateadmin.php index ce76c40a7..7ba220955 100644 --- a/e107_admin/updateadmin.php +++ b/e107_admin/updateadmin.php @@ -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 ); diff --git a/e107_handlers/cron_class.php b/e107_handlers/cron_class.php index 8e13933ab..376fac7ca 100644 --- a/e107_handlers/cron_class.php +++ b/e107_handlers/cron_class.php @@ -83,66 +83,66 @@ class _system_cron { // Check if there's a core e107 update available - // Get site version - if (is_readable(e_ADMIN."ver.php")) - { - include (e_ADMIN."ver.php"); // $e107info['e107_version']; - } - else - { - // Find alternate way to get local site version or throw an error - } - - // Check for updates for currently installed version - $localVersion = (int) $e107info['e107_version']; - - switch ($localVersion) { - case 0: - // Local version is <= 0.7 - // Run update routine for 0.x - break; - case 1: - // Local version is == 1.x - // Run update routine for 1.x - break; - case 2: - // Local version is == 2.x - // Run update routine for 2.x - - // Get newest available release version - $xml = e107::getXml(); - $file = "http://e107.org/releases.php?mode=2"; - $xdata = $xml->loadXMLfile($file,true,false); - - // Check for update - if ($e107info['e107_version'] < $xdata['core']['@attributes']['version']) - { - // If there is a new version of e107 available, notify Site Admin by email, make a log entry, and notify Admin in Admin Area, $versionTest = false - - $pref = e107::getPref(); - require_once(e_HANDLER.'mail.php'); - $message = "There is a new version of e107 available. Please visit http://www.e107.org for further details."; - sendemail($pref['siteadminemail'], "e107 - Update(s) Available For " . $pref['sitename'], $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']); - - // Add entry to the log - e107::getAdminLog()->add("Update(s) Available", "There is a new version of e107 available. Please visit http://www.e107.org for further details.", 3); + // Get site version + if (is_readable(e_ADMIN."ver.php")) + { + include (e_ADMIN."ver.php"); // $e107info['e107_version']; + } + else + { + // Find alternate way to get local site version or throw an error + } - $versionTest = $xdata['core']['@attributes']['version']; - - } - else - { - // If there is not a new version of e107 available, $versionTest = false + // Check for updates for currently installed version + $localVersion = (int) $e107info['e107_version']; + + switch ($localVersion) { + case 0: + // Local version is <= 0.7 + // Run update routine for 0.x + break; + case 1: + // Local version is == 1.x + // Run update routine for 1.x + break; + case 2: + // Local version is == 2.x + // Run update routine for 2.x + + // Get newest available release version + $xml = e107::getXml(); + $file = "http://e107.org/releases.php?mode=2"; + $xdata = $xml->loadXMLfile($file,true,false); + + // Check for update + if ($e107info['e107_version'] < $xdata['core']['@attributes']['version']) + { + // If there is a new version of e107 available, notify Site Admin by email, make a log entry, and notify Admin in Admin Area, $versionTest = false + + $pref = e107::getPref(); + require_once(e_HANDLER.'mail.php'); + $message = "There is a new version of e107 available. Please visit http://www.e107.org for further details."; + sendemail($pref['siteadminemail'], "e107 - Update(s) Available For " . $pref['sitename'], $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']); + + // Add entry to the log + e107::getAdminLog()->add("Update(s) Available", "There is a new version of e107 available. Please visit http://www.e107.org for further details.", 3); + + $versionTest = $xdata['core']['@attributes']['version']; + + } + else + { + // If there is not a new version of e107 available, $versionTest = false $versionTest = false; - } - - break; + } + + break; } //$versionTest = "{CHECK THE VERSION}"; // If out of date, return some text, if up-to-date , return false; - - $che = e107::getCache(); - $che->setMD5(e_LANGUAGE); + + $che = e107::getCache(); + $che->setMD5(e_LANGUAGE); if($versionTest) { @@ -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); } } diff --git a/e107_handlers/e_marketplace.php b/e107_handlers/e_marketplace.php index ae52d63f9..43a482fb9 100644 --- a/e107_handlers/e_marketplace.php +++ b/e107_handlers/e_marketplace.php @@ -362,7 +362,6 @@ abstract class e_marketplace_adapter_abstract else { $mes->addSuccess( "Download Manually"); // 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]); diff --git a/e107_handlers/event_class.php b/e107_handlers/event_class.php index 03a2ea272..2ae195d33 100644 --- a/e107_handlers/event_class.php +++ b/e107_handlers/event_class.php @@ -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" ), diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index fe6cf1a12..89edb8e68 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -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.
*
diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index 638b3cbd5..1cc81b3c6 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -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']) { diff --git a/e107_plugins/alt_auth/alt_auth_adminmenu.php b/e107_plugins/alt_auth/alt_auth_adminmenu.php index 19b12894b..e738b97be 100755 --- a/e107_plugins/alt_auth/alt_auth_adminmenu.php +++ b/e107_plugins/alt_auth/alt_auth_adminmenu.php @@ -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 .= "".LAN_ALT_48; + $text .= "".LAN_ALT_48; if ($val_name) { $text .= "
".LAN_ALT_49.$val_name.'
'.LAN_ALT_50; diff --git a/e107_plugins/alt_auth/alt_auth_login_class.php b/e107_plugins/alt_auth/alt_auth_login_class.php index 34012d119..89f330858 100755 --- a/e107_plugins/alt_auth/alt_auth_login_class.php +++ b/e107_plugins/alt_auth/alt_auth_login_class.php @@ -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 diff --git a/e107_plugins/banner/admin_banner.php b/e107_plugins/banner/admin_banner.php index de5f76020..864073bfa 100644 --- a/e107_plugins/banner/admin_banner.php +++ b/e107_plugins/banner/admin_banner.php @@ -443,7 +443,7 @@ class banner_form_ui extends e_admin_form_ui case 'filter': case 'batch': - return $array; + return null; break; } } diff --git a/e107_plugins/chatbox_menu/admin_chatbox.php b/e107_plugins/chatbox_menu/admin_chatbox.php index c8ad12f5e..7168459fd 100644 --- a/e107_plugins/chatbox_menu/admin_chatbox.php +++ b/e107_plugins/chatbox_menu/admin_chatbox.php @@ -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); } diff --git a/e107_plugins/chatbox_menu/chat.php b/e107_plugins/chatbox_menu/chat.php index b29d5c57c..99bbdb902 100644 --- a/e107_plugins/chatbox_menu/chat.php +++ b/e107_plugins/chatbox_menu/chat.php @@ -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); } diff --git a/e107_plugins/download/admin_download.php b/e107_plugins/download/admin_download.php index 9183b44de..cd3a2b4b2 100644 --- a/e107_plugins/download/admin_download.php +++ b/e107_plugins/download/admin_download.php @@ -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() { - - - 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? diff --git a/e107_plugins/download/download.php b/e107_plugins/download/download.php index 202e1b3e4..cc104e9d7 100644 --- a/e107_plugins/download/download.php +++ b/e107_plugins/download/download.php @@ -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"); } } } diff --git a/e107_plugins/download/includes/admin.php b/e107_plugins/download/includes/admin.php index 41cea608a..538a7ca01 100644 --- a/e107_plugins/download/includes/admin.php +++ b/e107_plugins/download/includes/admin.php @@ -467,8 +467,8 @@ $columnInfo = array( $text .= ''; $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 .= ''; $text .= ''.$tp->toHTML($file['fname']).''; $text .= ''.$filets.''; diff --git a/e107_plugins/forum/e_rss.php b/e107_plugins/forum/e_rss.php index 861445278..8a98331a6 100644 --- a/e107_plugins/forum/e_rss.php +++ b/e107_plugins/forum/e_rss.php @@ -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']; diff --git a/e107_plugins/forum/forum_admin.php b/e107_plugins/forum/forum_admin.php index c76f4a39f..633711cca 100644 --- a/e107_plugins/forum/forum_admin.php +++ b/e107_plugins/forum/forum_admin.php @@ -1354,7 +1354,7 @@ class forumAdmin { if ($reported_total = $sql->select("generic", "*", "gen_type='reported_post' OR gen_type='Reported Forum Post'")) { - $text .= " + $text = " diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index ca8ee148b..ef613ada7 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -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; diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index 7ff30d29a..e500a0ae8 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -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; diff --git a/e107_plugins/forum/forum_uploads.php b/e107_plugins/forum/forum_uploads.php index bf87cfbb5..141f289fe 100644 --- a/e107_plugins/forum/forum_uploads.php +++ b/e107_plugins/forum/forum_uploads.php @@ -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; } diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php index 968effc12..2503a2c30 100644 --- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php @@ -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') { diff --git a/e107_plugins/linkwords/admin_config.php b/e107_plugins/linkwords/admin_config.php index 65d822130..a5e93866e 100644 --- a/e107_plugins/linkwords/admin_config.php +++ b/e107_plugins/linkwords/admin_config.php @@ -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); } } diff --git a/e107_plugins/newsfeed/admin_config.php b/e107_plugins/newsfeed/admin_config.php index 71263508e..be04b5f52 100644 --- a/e107_plugins/newsfeed/admin_config.php +++ b/e107_plugins/newsfeed/admin_config.php @@ -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 { diff --git a/e107_plugins/newsfeed/newsfeed_functions.php b/e107_plugins/newsfeed/newsfeed_functions.php index 52de4fe30..d29a85aa8 100644 --- a/e107_plugins/newsfeed/newsfeed_functions.php +++ b/e107_plugins/newsfeed/newsfeed_functions.php @@ -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); } } diff --git a/e107_plugins/newsletter/newsletter_menu.php b/e107_plugins/newsletter/newsletter_menu.php index 3bc3ec8a4..e88f9b337 100644 --- a/e107_plugins/newsletter/newsletter_menu.php +++ b/e107_plugins/newsletter/newsletter_menu.php @@ -24,7 +24,7 @@ */ if (!defined('e107_INIT')) { exit; } -if (!$e107->isInstalled('newsletter')) +if (!e107::isInstalled('newsletter')) { return; } diff --git a/e107_plugins/pm/pm_conf.php b/e107_plugins/pm/pm_conf.php index ee4a8d93c..910eec3f8 100755 --- a/e107_plugins/pm/pm_conf.php +++ b/e107_plugins/pm/pm_conf.php @@ -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); } } diff --git a/e107_plugins/pm/pm_shortcodes.php b/e107_plugins/pm/pm_shortcodes.php index a29282702..5d8f2f8f2 100755 --- a/e107_plugins/pm/pm_shortcodes.php +++ b/e107_plugins/pm/pm_shortcodes.php @@ -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 = "".LAN_PM_4." "; diff --git a/e107_plugins/rss_menu/admin_prefs.php b/e107_plugins/rss_menu/admin_prefs.php index 4cf8d4fe6..aead5acfa 100644 --- a/e107_plugins/rss_menu/admin_prefs.php +++ b/e107_plugins/rss_menu/admin_prefs.php @@ -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 diff --git a/e107_plugins/rss_menu/rss.php b/e107_plugins/rss_menu/rss.php index dec1353b3..34e031cca 100644 --- a/e107_plugins/rss_menu/rss.php +++ b/e107_plugins/rss_menu/rss.php @@ -233,7 +233,7 @@ class rssCreate $this -> rssItems[$loop]['author_email'] = $value['user_email']; // $this -> rssItems[$loop]['category'] = "".$value['category_name'].""; $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) { diff --git a/error.php b/error.php index b2c94d03a..c9f71eeb6 100644 --- a/error.php +++ b/error.php @@ -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); ?> \ No newline at end of file diff --git a/request.php b/request.php index a0b1a4798..156421475 100644 --- a/request.php +++ b/request.php @@ -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(); } diff --git a/submitnews.php b/submitnews.php index 9d6fd6827..e5377f102 100644 --- a/submitnews.php +++ b/submitnews.php @@ -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(); diff --git a/top.php b/top.php index 122fdc9bf..31b232785 100644 --- a/top.php +++ b/top.php @@ -103,7 +103,7 @@ if ($action == 'active') $lastpost_datestamp = $gen->convert_date($row['thread_lastpost'], 'forum'); if ($row['user_last']) { - $LASTPOST = "{$row['user_last']}
".$lastpost_datestamp; + $LASTPOST = "{$row['user_last']}
".$lastpost_datestamp; } else { diff --git a/user.php b/user.php index 803d2347a..b1a8b0ba7 100644 --- a/user.php +++ b/user.php @@ -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 = "
".$ret."
"; $ns->tablerender(LAN_USER_48, $text); diff --git a/usersettings.php b/usersettings.php index 0ce50fb64..f95b6c85b 100644 --- a/usersettings.php +++ b/usersettings.php @@ -433,12 +433,10 @@ e107::getMessage()->addDebug("
Posted Changes
".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)) - { - $e_userclass = new user_class; - } + if (FALSE === $adminEdit) // Make sure admin can't edit another's user classes + { + + $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("
Posted Changes
".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; + */ } - ?>
".FORLAN_170."