From bf1c62d6fe03965b96f9c3f87a8b1f78ab030c6d Mon Sep 17 00:00:00 2001 From: mcfly Date: Wed, 10 Mar 2010 01:23:57 +0000 Subject: [PATCH] Updates to use new plugin specific prefs. Change file headers as well. --- e107_plugins/forum/e_admin_events.php | 6 +-- e107_plugins/forum/e_linkgen.php | 22 +++++----- e107_plugins/forum/e_list.php | 41 +++++++++---------- e107_plugins/forum/e_notify.php | 8 ++-- e107_plugins/forum/e_status.php | 2 +- e107_plugins/forum/forum.php | 16 ++++---- e107_plugins/forum/forum_admin.php | 18 ++++---- e107_plugins/forum/forum_admin_class.php | 6 +-- e107_plugins/forum/forum_class.php | 2 +- e107_plugins/forum/forum_conf.php | 6 +-- e107_plugins/forum/forum_mod.php | 14 ++----- e107_plugins/forum/forum_post.php | 26 ++++++------ e107_plugins/forum/forum_post_shortcodes.php | 10 ++--- e107_plugins/forum/forum_shortcodes.php | 6 +-- e107_plugins/forum/forum_stats.php | 12 +++--- e107_plugins/forum/forum_update.php | 3 ++ e107_plugins/forum/forum_uploads.php | 8 ++-- e107_plugins/forum/forum_viewforum.php | 26 ++++++------ e107_plugins/forum/forum_viewtopic.php | 14 +++---- e107_plugins/forum/index.php | 6 +-- e107_plugins/forum/newforumposts_menu.php | 16 ++++---- .../forum/newforumposts_menu_config.php | 6 +-- e107_plugins/forum/plugin.xml | 25 ++++++----- 23 files changed, 135 insertions(+), 164 deletions(-) diff --git a/e107_plugins/forum/e_admin_events.php b/e107_plugins/forum/e_admin_events.php index 94d4a8fb6..34950291d 100755 --- a/e107_plugins/forum/e_admin_events.php +++ b/e107_plugins/forum/e_admin_events.php @@ -8,10 +8,8 @@ * * Check for admin events being triggered * -* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/e_admin_events.php,v $ -* $Revision$ -* $Date$ -* $Author$ +* $URL$ +* $Id$ * */ function plugin_forum_admin_events($type, $parms) diff --git a/e107_plugins/forum/e_linkgen.php b/e107_plugins/forum/e_linkgen.php index 24bc7a451..2518cb8ef 100644 --- a/e107_plugins/forum/e_linkgen.php +++ b/e107_plugins/forum/e_linkgen.php @@ -8,10 +8,8 @@ * * * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/e_linkgen.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ if (!defined('e107_INIT')) { exit; } @@ -19,15 +17,15 @@ if (!defined('e107_INIT')) { exit; } // Usage: sublink_type[x]['title']. // x should be the same as the plugin folder. -include_lan(e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_forum_admin.php"); +include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_admin.php'); - $sublink_type['forum']['title'] = FORLAN_155; // "News Categories"; - $sublink_type['forum']['table'] = "forum"; - $sublink_type['forum']['query'] = "forum_parent !='0' ORDER BY forum_order ASC"; - $sublink_type['forum']['url'] = "{e_PLUGIN}forum/forum_viewforum.php?#"; - $sublink_type['forum']['fieldid'] = "forum_id"; - $sublink_type['forum']['fieldname'] = "forum_name"; - $sublink_type['forum']['fielddiz'] = "forum_description"; +$sublink_type['forum']['title'] = FORLAN_155; // "News Categories"; +$sublink_type['forum']['table'] = 'forum'; +$sublink_type['forum']['query'] = "forum_parent !='0' ORDER BY forum_order ASC"; +$sublink_type['forum']['url'] = "{e_PLUGIN}forum/forum_viewforum.php?#"; +$sublink_type['forum']['fieldid'] = 'forum_id'; +$sublink_type['forum']['fieldname'] = 'forum_name'; +$sublink_type['forum']['fielddiz'] = 'forum_description'; ?> \ No newline at end of file diff --git a/e107_plugins/forum/e_list.php b/e107_plugins/forum/e_list.php index 8c937487c..b56cde8be 100644 --- a/e107_plugins/forum/e_list.php +++ b/e107_plugins/forum/e_list.php @@ -8,14 +8,13 @@ * * Forum e_list Handler * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/e_list.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ * */ if (!defined('e107_INIT')) { exit; } +//TODO: Investigate queries class list_forum { function list_forum($parent) @@ -30,29 +29,29 @@ class list_forum $bullet = $this->parent->getBullet($this->parent->settings['icon']); - if($this->parent->mode == "new_page" || $this->parent->mode == "new_menu" ) + if($this->parent->mode == 'new_page' || $this->parent->mode == 'new_menu' ) { $lvisit = $this->parent->getlvisit(); $qry = " - SELECT tp.thread_name AS parent_name, tp.thread_id as parent_id, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name, t.thread_thread, t.thread_id, t.thread_views as tviews, t.thread_name, tp.thread_parent, t.thread_datestamp, t.thread_user, tp.thread_views, tp.thread_lastpost, tp.thread_lastuser, tp.thread_total_replies - FROM #forum_t AS t - LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id - LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id - LEFT JOIN #user AS u ON t.thread_user = u.user_id - LEFT JOIN #user AS lp ON tp.thread_lastuser = lp.user_id - WHERE f.forum_class REGEXP '".e_CLASS_REGEXP."' - AND t.thread_datestamp > $lvisit + SELECT tp.thread_name AS parent_name, tp.thread_id as parent_id, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name, t.thread_thread, t.thread_id, t.thread_views as tviews, t.thread_name, tp.thread_parent, t.thread_datestamp, t.thread_user, tp.thread_views, tp.thread_lastpost, tp.thread_lastuser, tp.thread_total_replies + FROM #forum_t AS t + LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id + LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id + LEFT JOIN #user AS u ON t.thread_user = u.user_id + LEFT JOIN #user AS lp ON tp.thread_lastuser = lp.user_id + WHERE f.forum_class REGEXP '".e_CLASS_REGEXP."' + AND t.thread_datestamp > $lvisit ORDER BY t.thread_datestamp DESC LIMIT 0,".intval($this->parent->settings['amount']); } else { $qry = " - SELECT t.thread_id, t.thread_name AS parent_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name - FROM #forum_t AS t - LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id - LEFT JOIN #user AS u ON t.thread_user = u.user_id - LEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id - WHERE t.thread_parent=0 AND f.forum_class REGEXP '".e_CLASS_REGEXP."' + SELECT t.thread_id, t.thread_name AS parent_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name + FROM #forum_t AS t + LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id + LEFT JOIN #user AS u ON t.thread_user = u.user_id + LEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id + WHERE t.thread_parent=0 AND f.forum_class REGEXP '".e_CLASS_REGEXP."' ORDER BY t.thread_lastpost DESC LIMIT 0,".intval($this->parent->settings['amount']); } @@ -147,8 +146,8 @@ class list_forum } //return array with 'records', (global)'caption', 'display' return array( - 'records'=>$list_data, - 'caption'=>$list_caption, + 'records'=>$list_data, + 'caption'=>$list_caption, 'display'=>$list_display ); } diff --git a/e107_plugins/forum/e_notify.php b/e107_plugins/forum/e_notify.php index 75257ced4..4daa23977 100644 --- a/e107_plugins/forum/e_notify.php +++ b/e107_plugins/forum/e_notify.php @@ -8,10 +8,8 @@ * * Forum plugin notify configuration * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/e_notify.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ * */ @@ -22,7 +20,7 @@ if(defined('ADMIN_PAGE') && ADMIN_PAGE === true) include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_notify.php'); $config_category = FORUM_NT_1; $config_events = array( - 'forum_nt' => FORUM_NT_NEWTHREAD, + 'forum_nt' => FORUM_NT_NEWTHREAD, 'forum_ntp' => FORUM_NT_NEWTHREAD_PROB, 'forum_thread_del' => FORUM_NT_THREAD_DELETED, 'forum_thread_split' => FORUM_NT_THREAD_SPLIT, diff --git a/e107_plugins/forum/e_status.php b/e107_plugins/forum/e_status.php index a0c79087a..363752aba 100644 --- a/e107_plugins/forum/e_status.php +++ b/e107_plugins/forum/e_status.php @@ -1,6 +1,6 @@ db_Count("forum_t"); +$forum_posts = $sql->db_Count('forum_post'); $text .= "
".E_16_FORUM." ".ADLAN_113.": ".$forum_posts."
"; ?> \ No newline at end of file diff --git a/e107_plugins/forum/forum.php b/e107_plugins/forum/forum.php index 51c0bf816..fecea1d01 100644 --- a/e107_plugins/forum/forum.php +++ b/e107_plugins/forum/forum.php @@ -75,7 +75,7 @@ $fVars->USERINFO = "".LAN_429." | if(USER) { $fVars->USERINFO .= " | ".LAN_431." | ".LAN_432." | ".LAN_435.""; - if($pref['forum_attach'] && (check_class($pref['upload_class']) || getperms('0'))) + if($forum->prefs->get('attach') && (check_class($pref['upload_class']) || getperms('0'))) { $fVars->USERINFO .= " | ".FORLAN_442.""; } @@ -193,7 +193,7 @@ if (USER && $allread != TRUE && $total_new_threads && $total_new_threads >= $tot $fVars->INFO .= "
".LAN_199.''.(e_QUERY != 'new' ? ", ".LAN_421."" : ''); } -if (USER && varsettrue($pref['forum_track']) && e_QUERY != 'track') +if (USER && varsettrue($forum->prefs->get('track')) && e_QUERY != 'track') { $fVars->INFO .= "
".LAN_393.''; } @@ -407,9 +407,9 @@ if (e_QUERY == 'track') } $forum_track_start = $e107->tp->simpleParse($FORUM_TRACK_START, $trackVars); $forum_track_end = $e107->tp->simpleParse($FORUM_TRACK_END, $trackVars); - if ($pref['forum_enclose']) + if ($forum->prefs->get('enclose')) { - $ns->tablerender($pref['forum_title'], $forum_track_start.$forum_trackstring.$forum_track_end, array('forum', 'main1')); + $ns->tablerender($forum->prefs->get('title'), $forum_track_start.$forum_trackstring.$forum_track_end, array('forum', 'main1')); } else { @@ -449,9 +449,9 @@ if (e_QUERY == 'new') $forum_new_start = $e107->tp->simpleParse($FORUM_NEWPOSTS_START, $nVars); $forum_new_end = $e107->tp->simpleParse($FORUM_NEWPOSTS_END, $nVars); - if ($pref['forum_enclose']) + if ($forum->prefs->get('enclose')) { - $ns->tablerender($pref['forum_title'], $forum_new_start.$forum_newstring.$forum_new_end, array('forum', 'main2')); + $ns->tablerender($forum->prefs->get('title'), $forum_new_start.$forum_newstring.$forum_new_end, array('forum', 'main2')); } else { @@ -462,9 +462,9 @@ if (e_QUERY == 'new') $forum_main_start = $e107->tp->simpleParse($FORUM_MAIN_START, $fVars); $forum_main_end = $e107->tp->simpleParse($FORUM_MAIN_END, $fVars); -if ($pref['forum_enclose']) +if ($forum->prefs->get('enclose')) { - $ns->tablerender($pref['forum_title'], $forum_main_start.$forum_string.$forum_main_end, array('forum', 'main3')); + $ns->tablerender($forum->prefs->get('title'), $forum_main_start.$forum_string.$forum_main_end, array('forum', 'main3')); } else { diff --git a/e107_plugins/forum/forum_admin.php b/e107_plugins/forum/forum_admin.php index b9210db59..22f570049 100644 --- a/e107_plugins/forum/forum_admin.php +++ b/e107_plugins/forum/forum_admin.php @@ -8,19 +8,17 @@ * * * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ $eplug_admin = true; -require_once("../../class2.php"); +require_once('../../class2.php'); include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_admin.php'); -if (!getperms("P")) +if (!getperms('P')) { - header("location:".e_BASE."index.php"); + header('location:'.e_BASE.'index.php'); exit; } $e_sub_cat = 'forum'; @@ -316,15 +314,15 @@ if (isset($_POST['frsubmit'])) $adminrules = $e107->tp->toDB($_POST['adminrules']); if(!$e107->sql->db_Update("generic", "gen_chardata ='$guestrules', gen_intdata='".$_POST['guest_active']."' WHERE gen_type='forum_rules_guest' ")) { - $e107->sql -> db_Insert("generic", "0, 'forum_rules_guest', '".time()."', 0, '', '".$_POST['guest_active']."', '$guestrules' "); + $e107->sql->db_Insert("generic", "0, 'forum_rules_guest', '".time()."', 0, '', '".$_POST['guest_active']."', '$guestrules' "); } if(!$e107->sql->db_Update("generic", "gen_chardata ='$memberrules', gen_intdata='".$_POST['member_active']."' WHERE gen_type='forum_rules_member' ")) { - $e107->sql -> db_Insert("generic", "0, 'forum_rules_member', '".time()."', 0, '', '".$_POST['member_active']."', '$memberrules' "); + $e107->sql->db_Insert("generic", "0, 'forum_rules_member', '".time()."', 0, '', '".$_POST['member_active']."', '$memberrules' "); } if(!$e107->sql->db_Update("generic", "gen_chardata ='$adminrules', gen_intdata='".$_POST['admin_active']."' WHERE gen_type='forum_rules_admin' ")) { - $e107->sql -> db_Insert("generic", "0, 'forum_rules_admin', '".time()."', 0, '', '".$_POST['admin_active']."', '$adminrules' "); + $e107->sql->db_Insert("generic", "0, 'forum_rules_admin', '".time()."', 0, '', '".$_POST['admin_active']."', '$adminrules' "); } } diff --git a/e107_plugins/forum/forum_admin_class.php b/e107_plugins/forum/forum_admin_class.php index f3ffd3df5..7e4378814 100755 --- a/e107_plugins/forum/forum_admin_class.php +++ b/e107_plugins/forum/forum_admin_class.php @@ -8,10 +8,8 @@ * * Forum admin functions * -* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin_class.php,v $ -* $Revision$ -* $Date$ -* $Author$ +* $URL$ +* $Id$ * */ class forumAdmin diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index 1a652832b..e29cc5448 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -19,7 +19,7 @@ class e107forum { // var $fieldTypes = array(); private $userViewed, $permList; - protected $modArray, $prefs; + public $modArray, $prefs; public function __construct() { diff --git a/e107_plugins/forum/forum_conf.php b/e107_plugins/forum/forum_conf.php index c5c60535a..847232b14 100644 --- a/e107_plugins/forum/forum_conf.php +++ b/e107_plugins/forum/forum_conf.php @@ -8,10 +8,8 @@ * * * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_conf.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ require_once('../../class2.php'); diff --git a/e107_plugins/forum/forum_mod.php b/e107_plugins/forum/forum_mod.php index 23e9c0f1c..ed7e72d6e 100644 --- a/e107_plugins/forum/forum_mod.php +++ b/e107_plugins/forum/forum_mod.php @@ -8,10 +8,8 @@ * * * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_mod.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ if (!defined('e107_INIT')) { exit(); } @@ -19,16 +17,12 @@ include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_admin.php'); function forum_thread_moderate($p) { - // var_dump($_POST); - // return; $e107 = e107::getInstance(); - global $sql; foreach ($p as $key => $val) { if (preg_match("#(.*?)_(\d+)_x#", $key, $matches)) { $act = $matches[1]; - // print_a($matches); return; $id = (int)$matches[2]; switch ($act) @@ -69,7 +63,7 @@ function forum_thread_moderate($p) function forumDeleteThread($threadId) { require_once (e_PLUGIN.'forum/forum_class.php'); - $f = &new e107forum; + $f = new e107forum; $ret = $f->threadDelete($threadId); return FORLAN_6.' and '.$ret.' '.FORLAN_7.'.'; } @@ -77,7 +71,7 @@ function forumDeleteThread($threadId) function forumDeletePost($postId) { require_once (e_PLUGIN.'forum/forum_class.php'); - $f = &new e107forum; + $f = new e107forum; $ret = $f->postDelete($postId); return FORLAN_6.' and '.$ret.' '.FORLAN_7.'.'; } diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index b85b6fa66..1b15164f6 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -8,10 +8,8 @@ * * Forum Posting * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ require_once('../../class2.php'); @@ -96,7 +94,7 @@ define('e_PAGETITLE', LAN_01.' / '.$forumInfo['forum_name'].' / '.($action == 'r // ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -if($pref['forum_attach']) +if($forum->prefs->get('forum_attach')) { global $allowed_filetypes, $max_upload_size; include_once(e_HANDLER.'upload_handler.php'); @@ -146,7 +144,7 @@ if (isset($_POST['fpreview'])) $tsubject = $tp->post_toHTML($_POST['subject'], true); $tpost = $tp->post_toHTML($_POST['post'], true); - if ($_POST['poll_title'] != '' && check_class($pref['forum_poll'])) + if ($_POST['poll_title'] != '' && check_class($forum->prefs->get('forum_poll'))) { require_once(e_PLUGIN."poll/poll_class.php"); $poll = new poll; @@ -322,7 +320,7 @@ if (isset($_POST['newthread']) || isset($_POST['reply'])) $e107cache->clear('newforumposts'); $threadLink = $e107->url->getUrl('forum', 'thread', array('func' => 'last', 'id' => $threadId)); $forumLink = $e107->url->getUrl('forum', 'forum', array('func' => 'view', 'id' => $forumId)); - if ($pref['forum_redirect']) + if ($forum->prefs->get('forum_redirect')) { header('location:'.$threadLink); exit; @@ -519,9 +517,9 @@ $text = $tp->parseTemplate($FORUMPOST, true); // ------------------------------------------------------------------------------------------------------------------------------------------------------------- -if ($pref['forum_enclose']) +if ($forum->prefs->get('forum_enclose')) { - $ns->tablerender($pref['forum_title'], $text); + $ns->tablerender($forum->prefs->get('title'), $text); } else { @@ -550,7 +548,7 @@ function forumjump() function process_upload() { - global $pref, $forumInfo, $thread_info, $admin_log; + global $forumInfo, $thread_info, $admin_log; $postId = (int)$postId; $ret = array(); @@ -576,17 +574,17 @@ function process_upload() if(strstr($upload['type'], 'image')) { $_type = 'img'; - if(isset($pref['forum_maxwidth']) && $pref['forum_maxwidth'] > 0) + if($forum->prefs->get('maxwidth', 0) > 0) { require_once(e_HANDLER.'resize_handler.php'); $orig_file = $upload['name']; $new_file = 'th_'.$orig_file; - $resizeDir = ($pref['forum_linkimg'] ? 'thumb/' : ''); + $resizeDir = ($forum->prefs->get('linkimg') ? 'thumb/' : ''); - if(resize_image($attachmentDir.$orig_file, $attachmentDir.$resizeDir.$new_file, $pref['forum_maxwidth'])) + if(resize_image($attachmentDir.$orig_file, $attachmentDir.$resizeDir.$new_file, $forum->prefs->get('maxwidth'))) { - if($pref['forum_linkimg']) + if($forum->prefs->get('linkimg')) { $parms = image_getsize($attachmentDir.$new_file); $_txt = '[br][link='.$fpath.$orig_file."][img{$parms}]".$fpath.$new_file.'[/img][/link][br]'; diff --git a/e107_plugins/forum/forum_post_shortcodes.php b/e107_plugins/forum/forum_post_shortcodes.php index 32aefb751..0866d8ba7 100644 --- a/e107_plugins/forum/forum_post_shortcodes.php +++ b/e107_plugins/forum/forum_post_shortcodes.php @@ -76,7 +76,7 @@ class forum_post_shortcodes function sc_postbox() { - global $post, $pref; + global $post; $rows = (e_WYSIWYG) ? 15 : 10; $ret = "\n
\n"; if(!e_WYSIWYG) @@ -103,9 +103,9 @@ class forum_post_shortcodes function sc_fileattach() { - global $pref, $fileattach, $fileattach_alert; + global $forum, $pref, $fileattach, $fileattach_alert; - if ($pref['forum_attach'] && strpos(e_QUERY, 'edit') === FALSE && (check_class($pref['upload_class']) || getperms('0'))) + if ($forum->prefs->get('forum_attach') && strpos(e_QUERY, 'edit') === FALSE && (check_class($pref['upload_class']) || getperms('0'))) { if (is_writable(e_UPLOAD)) { @@ -179,8 +179,8 @@ class forum_post_shortcodes function sc_poll() { - global $poll_form, $action, $pref; - if ($action == 'nt' && check_class($pref['forum_poll']) && strpos(e_QUERY, 'edit') === false) + global $forum, $poll_form, $action; + if ($action == 'nt' && check_class($forum->prefs->get('poll')) && strpos(e_QUERY, 'edit') === false) { return $poll_form; } diff --git a/e107_plugins/forum/forum_shortcodes.php b/e107_plugins/forum/forum_shortcodes.php index ca642d884..2a3b77111 100644 --- a/e107_plugins/forum/forum_shortcodes.php +++ b/e107_plugins/forum/forum_shortcodes.php @@ -179,16 +179,15 @@ class forum_shortcodes function sc_signature() { if(!USER) { return ''; } - global $pref; + global $forum; static $forum_sig_shown; - if(varsettrue($pref['forum_sig_once'])) + if($forum->prefs->get('sig_once')) { $_tmp = 'forum_sig_shown_'.$this->postInfo['post_user']; if(getcachedvars($_tmp)) { return ''; } cachevars($_tmp, 1); } return ($this->postInfo['user_signature'] ? "

".$this->e107->tp->toHTML($this->postInfo['user_signature'], true).'' : ''); - } function sc_profileimg() @@ -275,7 +274,6 @@ class forum_shortcodes function sc_level($parm) { - global $pref; if (!$this->postInfo['post_user']) { return ''; } $rankInfo = $this->e107->userRank->getRanks($this->postInfo['post_user']); diff --git a/e107_plugins/forum/forum_stats.php b/e107_plugins/forum/forum_stats.php index 56c147941..35f6f08ca 100644 --- a/e107_plugins/forum/forum_stats.php +++ b/e107_plugins/forum/forum_stats.php @@ -8,14 +8,14 @@ * * * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_stats.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ require_once('../../class2.php'); +//TODO: Investigate the queries used here + include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_stats.php'); require_once(e_PLUGIN.'forum/forum_class.php'); $gen = new convert; @@ -27,8 +27,8 @@ $bar = (file_exists(THEME.'images/bar.png') ? THEME.'images/bar.png' : e_PLUGIN. require_once(HEADERF); -$total_posts = $sql -> db_Count('forum_post'); -$total_topics = $sql -> db_Count('forum_thread'); +$total_posts = $sql->db_Count('forum_post'); +$total_topics = $sql->db_Count('forum_thread'); $total_replies = $total_posts - $total_topics; $total_views = 0; $query = 'SELECT sum(thread_views) AS total FROM `#forum_thread` '; diff --git a/e107_plugins/forum/forum_update.php b/e107_plugins/forum/forum_update.php index 42edf3ed8..d8c453d78 100644 --- a/e107_plugins/forum/forum_update.php +++ b/e107_plugins/forum/forum_update.php @@ -259,6 +259,9 @@ function step4() $coreConfig->remove($key); } } + $old_prefs['reported_post_email'] = $coreConfig->get('reported_post_email'); + $coreConfig->remove('reported_post_email'); + $fconf->setPref($old_prefs)->save(false, true); $coreConfig->save(false, true); diff --git a/e107_plugins/forum/forum_uploads.php b/e107_plugins/forum/forum_uploads.php index f815a3df7..07959483f 100644 --- a/e107_plugins/forum/forum_uploads.php +++ b/e107_plugins/forum/forum_uploads.php @@ -8,10 +8,8 @@ * * * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_uploads.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ require_once("../../class2.php"); @@ -95,7 +93,7 @@ if(is_array($fileList)) else { $txt .= "".FRMUP_7.": {$tinfo['thread_id']}"; - } + } } else diff --git a/e107_plugins/forum/forum_viewforum.php b/e107_plugins/forum/forum_viewforum.php index ad023fd88..6855af8ff 100644 --- a/e107_plugins/forum/forum_viewforum.php +++ b/e107_plugins/forum/forum_viewforum.php @@ -30,14 +30,14 @@ if (!e_QUERY) exit; } -//$view = 25; -$view = (varset($pref['forum_threadspage']) ? $pref['forum_threadspage'] : 25); -$page = (varset($_GET['p']) ? $_GET['p'] : 0); -$threadFrom = $page * $view; - require_once(e_PLUGIN.'forum/forum_class.php'); $forum = new e107forum; +//$view = 25; +$view = $forum->prefs->get('threadspage', 25); +$page = (varset($_GET['p']) ? $_GET['p'] : 0); +$threadFrom = $page * $view; + global $forum_info, $FORUM_CRUMB; $fVars = new e_vars; @@ -242,7 +242,7 @@ if (count($threadList) ) { $sticky_threads ++; } - if ($sticky_threads > 0 && !$stuck && $pref['forum_hilightsticky']) + if ($sticky_threads > 0 && !$stuck && $forum->prefs->get('hilightsticky')) { if($FORUM_IMPORTANT_ROW) { @@ -292,9 +292,9 @@ $forum_view_start = $tp->simpleParse($FORUM_VIEW_START, $fVars); $forum_view_end = $tp->simpleParse($FORUM_VIEW_END, $fVars); -if ($pref['forum_enclose']) +if ($forum->prefs->get('forum_enclose')) { - $ns->tablerender($pref['forum_title'], $forum_view_start.$forum_view_subs.$forum_view_forum.$forum_view_end, array('forum_viewforum', 'main1')); + $ns->tablerender($forum->prefs->get('forum_title'), $forum_view_start.$forum_view_subs.$forum_view_forum.$forum_view_end, array('forum_viewforum', 'main1')); } else { @@ -313,7 +313,7 @@ require_once(FOOTERF); function parse_thread($thread_info) { - global $forum, $FORUM_VIEW_FORUM, $FORUM_VIEW_FORUM_STICKY, $FORUM_VIEW_FORUM_ANNOUNCE, $gen, $pref, $menu_pref, $threadsViewed; + global $forum, $FORUM_VIEW_FORUM, $FORUM_VIEW_FORUM_STICKY, $FORUM_VIEW_FORUM_ANNOUNCE, $gen, $menu_pref, $threadsViewed; global $tp; $tVars = new e_vars; $e107 = e107::getInstance(); @@ -351,7 +351,7 @@ function parse_thread($thread_info) $tVars->THREADDATE = $gen->convert_date($thread_info['thread_datestamp'], 'forum'); $tVars->ICON = ($newflag ? IMAGE_new : IMAGE_nonew); - if ($tVars->REPLIES >= $pref['forum_popular']) + if ($tVars->REPLIES >= $forum->prefs->get('popular', 10)) { $tVars->ICON = ($newflag ? IMAGE_new_popular : IMAGE_nonew_popular); } @@ -381,10 +381,10 @@ function parse_thread($thread_info) // { // $thread_name = substr($thread_name, strlen($THREADTYPE)); // } - if ($pref['forum_tooltip']) + if ($forum->prefs->get('tooltip')) { $thread_thread = strip_tags($tp->toHTML($thread_info['thread_thread'], true, 'no_hook')); - $tip_length = ($pref['forum_tiplength'] ? $pref['forum_tiplength'] : 400); + $tip_length = $forum->prefs->get('tiplength', 400); if (strlen($thread_thread) > $tip_length) { //$thread_thread = substr($thread_thread, 0, $tip_length).' '.$menu_pref['newforumposts_postfix']; @@ -399,7 +399,7 @@ function parse_thread($thread_info) } $tVars->THREADNAME = "{$thread_name}"; - $pages = ceil(($tVars->REPLIES+1)/$pref['forum_postspage']); + $pages = ceil(($tVars->REPLIES+1)/$forum->prefs->get('postspage')); if ($pages > 1) { if($pages > 6) diff --git a/e107_plugins/forum/forum_viewtopic.php b/e107_plugins/forum/forum_viewtopic.php index d693edc24..8f99180b8 100644 --- a/e107_plugins/forum/forum_viewtopic.php +++ b/e107_plugins/forum/forum_viewtopic.php @@ -135,7 +135,7 @@ $tVars->NEXTPREV = "<< NEXTPREV .= ' | '; $tVars->NEXTPREV .= " 'next', 'id' => $thread->threadId)) . "'>" . LAN_390 . " >>"; -if ($pref['forum_track'] && USER) +if ($forum->prefs->get('track') && USER) { $img = ($thread->threadInfo['track_userid'] ? IMAGE_track : IMAGE_untrack); $url = $e107->url->getUrl('forum', 'thread', array('func' => 'view', 'id' => $thread->threadId)); @@ -264,7 +264,7 @@ if ($thread->threadInfo['thread_lastpost'] > USERLV && !in_array($thread->thread require_once (HEADERF); -if ($pref['forum_enclose']) +if ($forum->prefs->get('enclose')) { $ns->tablerender(LAN_01, $forumstring, array('forum_viewtopic', 'main')); } @@ -451,10 +451,10 @@ class e107ForumThread function init() { - global $pref, $forum; + global $forum; $e107 = e107::getInstance(); $this->threadId = (int)varset($_GET['id']); - $this->perPage = (varset($_GET['perpage']) ? (int)$_GET['perpage'] : $pref['forum_postspage']); + $this->perPage = (varset($_GET['perpage']) ? (int)$_GET['perpage'] : $forum->prefs->get('postspage')); $this->page = (varset($_GET['p']) ? (int)$_GET['p'] : 0); //If threadId doesn't exist, or not given, redirect to main forum page @@ -499,7 +499,7 @@ class e107ForumThread function processFunction() { - global $forum, $thread, $pref; + global $forum, $thread; $e107 = e107::getInstance(); if (!isset($_GET['f'])) { @@ -513,7 +513,7 @@ class e107ForumThread $postId = varset($_GET['id']); $postInfo = $forum->postGet($postId,'post'); $postNum = $forum->postGetPostNum($postInfo['post_thread'], $postId); - $postPage = ceil($postNum / $pref['forum_postspage'])-1; + $postPage = ceil($postNum / $forum->prefs->get('postspage'))-1; $url = $e107->url->getUrl('forum', 'thread', "func=view&id={$postInfo['post_thread']}&page=$postPage"); header('location: '.$url); exit; @@ -553,7 +553,7 @@ class e107ForumThread if (isset($_POST['report_thread'])) { $report_add = $e107->tp->toDB($_POST['report_add']); - if ($pref['reported_post_email']) + if ($forum->prefs->get('reported_post_email')) { require_once (e_HANDLER . 'mail.php'); $report = LAN_422 . SITENAME . " : " . (substr(SITEURL, -1) == "/" ? SITEURL : SITEURL . "/") . $PLUGINS_DIRECTORY . "forum/forum_viewtopic.php?" . $thread_id . ".post\n" . LAN_425 . USERNAME . "\n" . $report_add; diff --git a/e107_plugins/forum/index.php b/e107_plugins/forum/index.php index 7547394e2..a262c1dd6 100644 --- a/e107_plugins/forum/index.php +++ b/e107_plugins/forum/index.php @@ -8,10 +8,8 @@ * * * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/index.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ header("location: forum.php"); diff --git a/e107_plugins/forum/newforumposts_menu.php b/e107_plugins/forum/newforumposts_menu.php index a21c55986..62ea06e33 100755 --- a/e107_plugins/forum/newforumposts_menu.php +++ b/e107_plugins/forum/newforumposts_menu.php @@ -8,10 +8,8 @@ * * * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/newforumposts_menu.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ if (!defined('e107_INIT')) { exit; } @@ -25,13 +23,13 @@ include_once(e_PLUGIN.'forum/forum_class.php'); $max_age = varset($menu_pref['newforumposts_maxage'], 0); $max_age = $max_age == 0 ? '' : '(t.post_datestamp > '.(time()-(int)$max_age*86400).') AND '; -$forum = new e107forum; +$forum = new e107forum; $forumList = implode(',', $forum->permList['view']); - +//TODO: Use query from forum class to get thread list $qry = " SELECT - p.post_user, p.post_id, p.post_datestamp, p.post_user_anon, p.post_entry, - t.thread_id, t.thread_datestamp, t.thread_name, u.user_name + p.post_user, p.post_id, p.post_datestamp, p.post_user_anon, p.post_entry, + t.thread_id, t.thread_datestamp, t.thread_name, u.user_name FROM `#forum_post` as p LEFT JOIN `#forum_thread` AS t ON t.thread_id = p.post_thread LEFT JOIN `#user` AS u ON u.user_id = p.post_user @@ -82,7 +80,7 @@ if($results = $e107->sql->db_Select_gen($qry)) } else { - $text = NFP_2; + $text = NFP_2; } $e107->ns->tablerender($menu_pref['newforumposts_caption'], $text, 'nfp_menu'); diff --git a/e107_plugins/forum/newforumposts_menu_config.php b/e107_plugins/forum/newforumposts_menu_config.php index afc226603..a67f084e8 100755 --- a/e107_plugins/forum/newforumposts_menu_config.php +++ b/e107_plugins/forum/newforumposts_menu_config.php @@ -8,10 +8,8 @@ * * * - * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/newforumposts_menu_config.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ $eplug_admin = TRUE; diff --git a/e107_plugins/forum/plugin.xml b/e107_plugins/forum/plugin.xml index 314f82bb2..8c8624233 100755 --- a/e107_plugins/forum/plugin.xml +++ b/e107_plugins/forum/plugin.xml @@ -14,19 +14,18 @@ Forum - - 1 - [more...] - 255 - 10 - 1 - [forum] - 1 - Forums - 10 - 25 - 1 - + + 1 + [more...] + 255 + 10 + 1 + [forum] + 1 + Forums + 10 + 1 +