diff --git a/e107_plugins/forum/e_url.php b/e107_plugins/forum/e_url.php index 421d659c2..4e94abff3 100644 --- a/e107_plugins/forum/e_url.php +++ b/e107_plugins/forum/e_url.php @@ -52,10 +52,12 @@ class forum_url // plugin-folder + '_url' // only create url - parsed above. $config['move'] = array( 'sef' => 'forum/post/?f=move&id={thread_id}', + 'legacy' => '{e_PLUGIN}forum/forum_post.php?f=move&id={thread_id}' ); $config['split'] = array( 'sef' => 'forum/post/?f=split&id={thread_id}&post={post_id}', + 'legacy' => '{e_PLUGIN}forum/forum_post.php?f=split&id={thread_id}&post={post_id}' ); $config['topic'] = array( diff --git a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php index 74b60dd9f..b90c0d2cd 100644 --- a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php @@ -1,909 +1,983 @@ gen = new convert; -// $this->forum_rules = forum_rules('check'); + exit; } + + class plugin_forum_viewforum_shortcodes extends e_shortcode + { + + private $gen; + + function __construct() + { + $this->gen = new convert; // TODO replace all usage with e107::getParser()->toDate(); +// $this->forum_rules = forum_rules('check'); + } + // LEGACY shortcodes, to be deprecated & directly handled in template file??? - function sc_startertitle() {return LAN_FORUM_1004;} + function sc_startertitle() + { + return LAN_FORUM_1004; + } - function sc_threadtitle() {return LAN_FORUM_1003;} + function sc_threadtitle() + { + return LAN_FORUM_1003; + } - function sc_replytitle() {return LAN_FORUM_0003;} + function sc_replytitle() + { + return LAN_FORUM_0003; + } - function sc_lastpostitle() {return LAN_FORUM_0004;} + function sc_lastpostitle() + { + return LAN_FORUM_0004; + } + + function sc_viewtitle() + { + return LAN_FORUM_1005; + } - function sc_viewtitle() {return LAN_FORUM_1005;} // End of LEGACY shortcodes... - function sc_message() {return $this->var['message'];} + function sc_message() + { + return $this->var['message']; + } - function sc_threadpages() {return e107::getParser()->parseTemplate("{NEXTPREV={$this->var['parms']}}");} + function sc_threadpages() + { + return e107::getParser()->parseTemplate("{NEXTPREV={$this->var['parms']}}"); + } - function sc_newthreadbutton() - { - return "".IMAGE_newthread.''; - } + function sc_newthreadbutton() + { + return "" . IMAGE_newthread . ''; + } - function sc_newthreadbuttonx() - { + function sc_newthreadbuttonx() + { -if(!BOOTSTRAP) -{ - return sc_newthreadbutton; -} -//--function newthreadjump($url) -//--{ - global $forum; - $jumpList = $forum->forumGetAllowed('view'); + if(!BOOTSTRAP) + { + return $this->sc_newthreadbutton(); + } + + //--function newthreadjump($url) + //--{ - $text = '
- '.LAN_FORUM_1018.' - - -
'; - - return $text; - + global $forum; + $jumpList = $forum->forumGetAllowed('view'); + + + $text = '
'; + + if(!empty($this->var['ntUrl'])) + { + $text .= '' . LAN_FORUM_1018 . ''; + } + + $text .= ' + + +
'; + + return $text; + //} - } - - function sc_breadcrumb() - { -// var_dump ($this->var); - return $this->var['breadcrumb']; - } - - function sc_backlink() - { - return $this->var['breadcrumb']; - } - - function sc_forum_crumb() - { - return $this->var['forum_crumb']; - } - - function sc_forumtitle() - { - return $this->var['forum_name']; - } - - function sc_moderators() - { - return $this->var['modUser']; - } - - function sc_browsers() - { - -if($this->var['track_online']) -{ - return $users.' '.($users == 1 ? LAN_FORUM_0059 : LAN_FORUM_0060).' ('.$member_users.' '.($member_users == 1 ? LAN_FORUM_0061 : LAN_FORUM_0062).", ".$guest_users." ".($guest_users == 1 ? LAN_FORUM_0063 : LAN_FORUM_0064).')'; -} - } - - function sc_iconkey() - { -global $FORUM_VIEWFORUM_TEMPLATE; - -/*-- -if(defset('BOOTSTRAP')==3 && !empty($FORUM_VIEWFORUM_TEMPLATE['iconkey'])) // v2.x -{ - return e107::getParser()->parseTemplate($FORUM_VIEWFORUM_TEMPLATE['iconkey'],true); -} -// v1.x - - return " - - - - - - - - - - - - - - - - - - - - - -
".IMAGE_new_small."".LAN_FORUM_0039."".IMAGE_nonew_small."".LAN_FORUM_0040."".IMAGE_sticky_small."".LAN_FORUM_1011."".IMAGE_announce_small."".LAN_FORUM_1013."
".IMAGE_new_popular_small."".LAN_FORUM_0039." ".LAN_FORUM_1010."".IMAGE_nonew_popular_small."".LAN_FORUM_0040." ".LAN_FORUM_1010."".IMAGE_stickyclosed_small."".LAN_FORUM_1012."".IMAGE_closed_small."".LAN_FORUM_1014."
"; ---*/ - - return (defset('BOOTSTRAP')==3 && !empty($FORUM_VIEWFORUM_TEMPLATE['iconkey']))?e107::getParser()->parseTemplate($FORUM_VIEWFORUM_TEMPLATE['iconkey'],true):" - - - - - - - - - - - - - - - - - - - - - -
".IMAGE_new_small."".LAN_FORUM_0039."".IMAGE_nonew_small."".LAN_FORUM_0040."".IMAGE_sticky_small."".LAN_FORUM_1011."".IMAGE_announce_small."".LAN_FORUM_1013."
".IMAGE_new_popular_small."".LAN_FORUM_0039." ".LAN_FORUM_1010."".IMAGE_nonew_popular_small."".LAN_FORUM_0040." ".LAN_FORUM_1010."".IMAGE_stickyclosed_small."".LAN_FORUM_1012."".IMAGE_closed_small."".LAN_FORUM_1014."
"; - -} - - function sc_viewable_by() - { -global $forum, $forumId; - -if($users = $forum->getForumClassMembers($forumId)) -{ - $userList = array(); - $viewable = e107::getUserClass()->getFixedClassDescription($users); - if(is_array($users)) - { - foreach($users as $user) - { - $userList[] = "".$user['user_name'].""; } - $viewable = implode(', ', $userList);; - } - elseif($users == 0) - { - $viewable = '' ; - } -/*-- - else - { - $viewable = e107::getUserClass()->getFixedClassDescription($users); - } ---*/ -} - -/*-- -if(!empty($viewable)) -{ - - return " - -
-
Viewable by
-
- ".$viewable." -
-
- - "; -} -//else -//{ - return ''; -//} ---*/ -//else -//{ -//-- Possible candidate for wrapper???? -/* WORKING WRAPPER - $SC_WRAPPER['VIEWABLE_BY'] = "
".LAN_FORUM_8012."
{---}
"; - -*/ - return empty($viewable)?'':$viewable; -} - - function sc_search() - { -return " -
-

- - - - -

-
"; - -} - - function sc_perms() - { -global $forum, $forumId; - - // ----- Perm Display --- - - $permDisplay = array(); - - $permDisplay['topics'] = ($forum->checkPerm($forumId, 'thread')) ? LAN_FORUM_0043 : LAN_FORUM_0044; - $permDisplay['post'] =LAN_FORUM_0046; - $permDisplay['edit'] = LAN_FORUM_0048; - - if($forum->checkPerm($forumId, 'post')) - { - $permDisplay['post'] =LAN_FORUM_0045; - $permDisplay['edit'] = LAN_FORUM_0047; - } -/*-- - else - { - $permDisplay['post'] =LAN_FORUM_0046; - $permDisplay['edit'] = LAN_FORUM_0048; - } ---*/ - - return implode("", $permDisplay); - -} - -function sc_forumjump() -{ - global $forum; - $jumpList = $forum->forumGetAllowed('view'); - $text = "

".LAN_FORUM_1017.":

"; - return $text; -} - - -// FIXME - TOPLINK not used anymore? - function sc_toplink() - { - return "".LAN_GO.''; -} - - function sc_subforums() - { - -// echo "subforums"; - -// Initial ideia, to have a separate shortcode var ($subsc).... -//global $forum, $forumId, $threadFrom, $view; -global $sc, $forum, $forumId; -// var_dump ($forumId); -// var_dump (vartrue($forumId)); -//var_dump ($forum->forumGetSubs(vartrue($forum_id))); - -// var_dump ($FORUM_VIEW_SUB); -// $tp = e107::getParser(); - -// Initial ideia, to have a separate shortcode var ($subsc).... -// $subsc = e107::getScBatch('viewforum', 'forum', 'viewsubforum'); -//var_dump ($subsc); - -//-- $forum_id ?????? -//--$subList = $forum->forumGetSubs(vartrue($forum_id)); -//--$subList = $forum->forumGetSubs(vartrue($forumId)); -$subList = $forum->forumGetSubs(false); - -// var_dump ($forum); - -if(is_array($subList) && isset($subList[$this->var['forum_parent']][$forumId])) -{ -//-- $newflag_list ?????? -//-- $newflag_list = $forum->forumGetUnreadForums(); - $sub_info = ''; -global $FORUM_VIEW_SUB, $FORUM_VIEW_SUB_START, $FORUM_VIEW_SUB_END; - foreach($subList[$this->var['forum_parent']][$forumId] as $subInfo) - { - -//---- global $FORUM_VIEW_SUB, $gen, $newflag_list; -// var_dump ($FORUM_VIEW_SUB); - -//-- $tp = e107::getParser(); -// $tVars = new e_vars; - -//---- $forumName = $tp->toHTML($subInfo['forum_name'], true); -//---- $tVars['SUB_FORUMTITLE'] = "{$forumName}"; -//---- $tVars['SUB_DESCRIPTION'] = $tp->toHTML($subInfo['forum_description'], false, 'no_hook'); -//---- $tVars['SUB_THREADS'] = $subInfo['forum_threads']; -//---- $tVars['SUB_REPLIES'] = $subInfo['forum_replies']; - -//---- $badgeReplies = ($subInfo['forum_replies']) ? "badge-info" : ""; -//---- $badgeThreads = ($subInfo['forum_replies']) ? "badge-info" : ""; - -//---- $tVars['SUB_THREADSX'] = "".$subInfo['forum_threads'].""; -//---- $tVars['SUB_REPLIESX'] = "".$subInfo['forum_replies'].""; - -// $tVars['REPLIESX'] = "".$thread_info['thread_total_replies'].""; -// $tVars['VIEWSX'] = "".$thread_info['thread_views'].""; - -/*---- - if(USER && is_array($newflag_list) && in_array($subInfo['forum_id'], $newflag_list)) - { - - $tVars['NEWFLAG'] = "".IMAGE_new.''; - } - else - { - $tVars['NEWFLAG'] = IMAGE_nonew; - } -----*/ -/*---- - if($subInfo['forum_lastpost_info']) - { - $tmp = explode('.', $subInfo['forum_lastpost_info']); - $lp_thread = " $tmp[1]))."'>".IMAGE_post2.''; - $lp_date = $gen->convert_date($tmp[0], 'forum'); - - if($subInfo['user_name']) + function sc_breadcrumb() { - $lp_name = " $subInfo['forum_lastpost_user'], 'name' => $subInfo['user_name']))."'>{$subInfo['user_name']}"; + return $this->var['breadcrumb']; } - else + + function sc_backlink() { - $lp_name = $subInfo['forum_lastpost_user_anon']; + return $this->var['breadcrumb']; } - $tVars['SUB_LASTPOST'] = $lp_date.'
'.$lp_name.' '.$lp_thread; - - $tVars['SUB_LASTPOSTDATE'] = $gen->computeLapse($tmp[0], time(), false, false, 'short'); - $tVars['SUB_LASTPOSTUSER'] = $lp_name; - } - else - { - $tVars['SUB_LASTPOST'] = '-'; - $tVars['SUB_LASTPOSTUSER'] = ''; - $tVars['SUB_LASTPOSTDATE'] = ''; - } -----*/ -//---- $tVars['_WRAPPER_'] = 'forum_viewforum'; -//var_dump ($subInfo); -// Initial ideia, to have a separate shortcode var ($subsc).... -// $subsc->setVars($subInfo); -// Use setVars or addVars??? - $sc->setVars($subInfo); -//echo "--------------------------------------"; + function sc_forum_crumb() + { + return $this->var['forum_crumb']; + } -// Initial ideia, to have a separate shortcode var ($subsc).... -// $sub_info .= e107::getParser()->parseTemplate($FORUM_VIEW_SUB, false, $subsc); - $sub_info .= e107::getParser()->parseTemplate($FORUM_VIEW_SUB, false, $sc); + function sc_forumtitle() + { + return $this->var['forum_name']; + } -//var_dump ($sc); + function sc_moderators() + { + return $this->var['modUser']; + } + + function sc_browsers() + { + global $member_users, $users, $guest_users; + + if($this->var['track_online']) + { + return $users . ' ' . ($users == 1 ? LAN_FORUM_0059 : LAN_FORUM_0060) . ' (' . $member_users . ' ' . ($member_users == 1 ? LAN_FORUM_0061 : LAN_FORUM_0062) . ", " . $guest_users . " " . ($guest_users == 1 ? LAN_FORUM_0063 : LAN_FORUM_0064) . ')'; + } + + } + + function sc_iconkey() + { + global $FORUM_VIEWFORUM_TEMPLATE; + + /*-- + if(defset('BOOTSTRAP')==3 && !empty($FORUM_VIEWFORUM_TEMPLATE['iconkey'])) // v2.x + { + return e107::getParser()->parseTemplate($FORUM_VIEWFORUM_TEMPLATE['iconkey'],true); + } + // v1.x + + return " + + + + + + + + + + + + + + + + + + + + + +
".IMAGE_new_small."".LAN_FORUM_0039."".IMAGE_nonew_small."".LAN_FORUM_0040."".IMAGE_sticky_small."".LAN_FORUM_1011."".IMAGE_announce_small."".LAN_FORUM_1013."
".IMAGE_new_popular_small."".LAN_FORUM_0039." ".LAN_FORUM_1010."".IMAGE_nonew_popular_small."".LAN_FORUM_0040." ".LAN_FORUM_1010."".IMAGE_stickyclosed_small."".LAN_FORUM_1012."".IMAGE_closed_small."".LAN_FORUM_1014."
"; + --*/ + + return (defset('BOOTSTRAP') == 3 && !empty($FORUM_VIEWFORUM_TEMPLATE['iconkey'])) ? e107::getParser()->parseTemplate($FORUM_VIEWFORUM_TEMPLATE['iconkey'], true) : " + + + + + + + + + + + + + + + + + + + + + +
" . IMAGE_new_small . "" . LAN_FORUM_0039 . "" . IMAGE_nonew_small . "" . LAN_FORUM_0040 . "" . IMAGE_sticky_small . "" . LAN_FORUM_1011 . "" . IMAGE_announce_small . "" . LAN_FORUM_1013 . "
" . IMAGE_new_popular_small . "" . LAN_FORUM_0039 . " " . LAN_FORUM_1010 . "" . IMAGE_nonew_popular_small . "" . LAN_FORUM_0040 . " " . LAN_FORUM_1010 . "" . IMAGE_stickyclosed_small . "" . LAN_FORUM_1012 . "" . IMAGE_closed_small . "" . LAN_FORUM_1014 . "
"; + + } + + function sc_viewable_by() + { + global $forum, $forumId; + + if($users = $forum->getForumClassMembers($forumId)) + { + $userList = array(); + $viewable = e107::getUserClass()->getFixedClassDescription($users); + if(is_array($users)) + { + foreach($users as $user) + { + $userList[] = "" . $user['user_name'] . ""; + } + + $viewable = implode(', ', $userList);; + } + elseif($users == 0) + { + $viewable = ''; + } + /*-- + else + { + $viewable = e107::getUserClass()->getFixedClassDescription($users); + } + --*/ + } + + /*-- + if(!empty($viewable)) + { + + return " + +
+
Viewable by
+
+ ".$viewable." +
+
+ + "; + } + //else + //{ + return ''; + //} + --*/ + //else + //{ + //-- Possible candidate for wrapper???? + /* WORKING WRAPPER + $SC_WRAPPER['VIEWABLE_BY'] = "
".LAN_FORUM_8012."
{---}
"; + + */ + return empty($viewable) ? '' : $viewable; + } + function sc_search() + { + return " +
+

+ + + + +

+
"; - } -//var_dump ("----------->".$FORUM_VIEW_SUB_START.$sub_info.$FORUM_VIEW_SUB_END."<-----------"); - - return $FORUM_VIEW_SUB_START.$sub_info.$FORUM_VIEW_SUB_END; -} - -return ''; - -} + } -// Initial ideia, to have a separate shortcode var ($subsc).... -/*------ -} + function sc_perms() + { + global $forum, $forumId; -class plugin_forum_viewsubforum_shortcodes extends plugin_forum_viewforum_shortcodes -//-- or ??? -//--class plugin_forum_viewsubforum_shortcodes extends e_shortcode -{ + // ----- Perm Display --- - function __construct() - { -// $this->forum_rules = forum_rules('check'); - } -------*/ - function sc_sub_forumtitle() - { - $forumName = e107::getParser()->toHTML($this->var['forum_name'], true); - return "var)."'>{$forumName}"; - } + $permDisplay = array(); - function sc_sub_description() - { - return e107::getParser()->toHTML($this->var['forum_description'], false, 'no_hook'); - } + $permDisplay['topics'] = ($forum->checkPerm($forumId, 'thread')) ? LAN_FORUM_0043 : LAN_FORUM_0044; + $permDisplay['post'] = LAN_FORUM_0046; + $permDisplay['edit'] = LAN_FORUM_0048; - function sc_sub_threads() - { - return $this->var['forum_threads']; - } + if($forum->checkPerm($forumId, 'post')) + { + $permDisplay['post'] = LAN_FORUM_0045; + $permDisplay['edit'] = LAN_FORUM_0047; + } + /*-- + else + { + $permDisplay['post'] =LAN_FORUM_0046; + $permDisplay['edit'] = LAN_FORUM_0048; + } + --*/ - function sc_sub_replies() - { - return $this->var['forum_replies']; - } + return implode("", $permDisplay); - function sc_sub_threadsx() - { - $badgeThreads = ($this->var['forum_replies']) ? "badge-info" : ""; - return "".$this->var['forum_threads'].""; - } + } - function sc_sub_repliesx() - { - $badgeReplies = ($this->var['forum_replies']) ? "badge-info" : ""; - return "".$this->var['forum_replies'].""; - } + function sc_forumjump() + { + global $forum; + $jumpList = $forum->forumGetAllowed('view'); + $text = "

" . LAN_FORUM_1017 . ":

"; + return $text; + } - function sc_newflag() - { + + // FIXME - TOPLINK not used anymore? + function sc_toplink() + { + return "" . LAN_GO . ''; + } + + function sc_subforums() + { + + // echo "subforums"; + + // Initial ideia, to have a separate shortcode var ($subsc).... + //global $forum, $forumId, $threadFrom, $view; + global $sc, $forum, $forumId; + // var_dump ($forumId); + // var_dump (vartrue($forumId)); + //var_dump ($forum->forumGetSubs(vartrue($forum_id))); + + // var_dump ($FORUM_VIEW_SUB); + // $tp = e107::getParser(); + + // Initial ideia, to have a separate shortcode var ($subsc).... + // $subsc = e107::getScBatch('viewforum', 'forum', 'viewsubforum'); + //var_dump ($subsc); + + //-- $forum_id ?????? + //--$subList = $forum->forumGetSubs(vartrue($forum_id)); + //--$subList = $forum->forumGetSubs(vartrue($forumId)); + $subList = $forum->forumGetSubs(false); + + // var_dump ($forum); + + if(is_array($subList) && isset($subList[$this->var['forum_parent']][$forumId])) + { + //-- $newflag_list ?????? + //-- $newflag_list = $forum->forumGetUnreadForums(); + $sub_info = ''; + global $FORUM_VIEW_SUB, $FORUM_VIEW_SUB_START, $FORUM_VIEW_SUB_END; + foreach($subList[$this->var['forum_parent']][$forumId] as $subInfo) + { + + //---- global $FORUM_VIEW_SUB, $gen, $newflag_list; + // var_dump ($FORUM_VIEW_SUB); + + //-- $tp = e107::getParser(); + // $tVars = new e_vars; + + //---- $forumName = $tp->toHTML($subInfo['forum_name'], true); + //---- $tVars['SUB_FORUMTITLE'] = "{$forumName}"; + //---- $tVars['SUB_DESCRIPTION'] = $tp->toHTML($subInfo['forum_description'], false, 'no_hook'); + //---- $tVars['SUB_THREADS'] = $subInfo['forum_threads']; + //---- $tVars['SUB_REPLIES'] = $subInfo['forum_replies']; + + //---- $badgeReplies = ($subInfo['forum_replies']) ? "badge-info" : ""; + //---- $badgeThreads = ($subInfo['forum_replies']) ? "badge-info" : ""; + + //---- $tVars['SUB_THREADSX'] = "".$subInfo['forum_threads'].""; + //---- $tVars['SUB_REPLIESX'] = "".$subInfo['forum_replies'].""; + + // $tVars['REPLIESX'] = "".$thread_info['thread_total_replies'].""; + // $tVars['VIEWSX'] = "".$thread_info['thread_views'].""; + + /*---- + if(USER && is_array($newflag_list) && in_array($subInfo['forum_id'], $newflag_list)) + { + + $tVars['NEWFLAG'] = "".IMAGE_new.''; + } + else + { + $tVars['NEWFLAG'] = IMAGE_nonew; + } + ----*/ + /*---- + if($subInfo['forum_lastpost_info']) + { + $tmp = explode('.', $subInfo['forum_lastpost_info']); + $lp_thread = " $tmp[1]))."'>".IMAGE_post2.''; + $lp_date = $gen->convert_date($tmp[0], 'forum'); + + if($subInfo['user_name']) + { + $lp_name = " $subInfo['forum_lastpost_user'], 'name' => $subInfo['user_name']))."'>{$subInfo['user_name']}"; + } + else + { + $lp_name = $subInfo['forum_lastpost_user_anon']; + } + $tVars['SUB_LASTPOST'] = $lp_date.'
'.$lp_name.' '.$lp_thread; + + $tVars['SUB_LASTPOSTDATE'] = $gen->computeLapse($tmp[0], time(), false, false, 'short'); + $tVars['SUB_LASTPOSTUSER'] = $lp_name; + } + else + { + $tVars['SUB_LASTPOST'] = '-'; + $tVars['SUB_LASTPOSTUSER'] = ''; + $tVars['SUB_LASTPOSTDATE'] = ''; + } + ----*/ + //---- $tVars['_WRAPPER_'] = 'forum_viewforum'; + //var_dump ($subInfo); + + // Initial ideia, to have a separate shortcode var ($subsc).... + // $subsc->setVars($subInfo); + // Use setVars or addVars??? + $sc->setVars($subInfo); + //echo "--------------------------------------"; + + // Initial ideia, to have a separate shortcode var ($subsc).... + // $sub_info .= e107::getParser()->parseTemplate($FORUM_VIEW_SUB, false, $subsc); + $sub_info .= e107::getParser()->parseTemplate($FORUM_VIEW_SUB, false, $sc); + + //var_dump ($sc); + + + } + //var_dump ("----------->".$FORUM_VIEW_SUB_START.$sub_info.$FORUM_VIEW_SUB_END."<-----------"); + + return $FORUM_VIEW_SUB_START . $sub_info . $FORUM_VIEW_SUB_END; + } + + return ''; + + } + + + // Initial ideia, to have a separate shortcode var ($subsc).... + /*------ + } + + class plugin_forum_viewsubforum_shortcodes extends plugin_forum_viewforum_shortcodes + //-- or ??? + //--class plugin_forum_viewsubforum_shortcodes extends e_shortcode + { + + function __construct() + { + // $this->forum_rules = forum_rules('check'); + } + ------*/ + + + function sc_sub_forumtitle() + { + $forumName = e107::getParser()->toHTML($this->var['forum_name'], true); + return "var) . "'>{$forumName}"; + } + + + function sc_sub_description() + { + return e107::getParser()->toHTML($this->var['forum_description'], false, 'no_hook'); + } + + + function sc_sub_threads() + { + return $this->var['forum_threads']; + } + + + function sc_sub_replies() + { + return $this->var['forum_replies']; + } + + + function sc_sub_threadsx() + { + $badgeThreads = ($this->var['forum_replies']) ? "badge-info" : ""; + return "" . $this->var['forum_threads'] . ""; + } + + + function sc_sub_repliesx() + { + $badgeReplies = ($this->var['forum_replies']) ? "badge-info" : ""; + return "" . $this->var['forum_replies'] . ""; + } + + + function sc_newflag() + { //-- global $newflag_list; - global $forum; - $newflag_list = $forum->forumGetUnreadForums(); -/*-- - if(USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list)) - { - return "".IMAGE_new.''; - } - return IMAGE_nonew; ---*/ - return (USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list))?"".IMAGE_new.'':IMAGE_nonew; + global $forum; + $newflag_list = $forum->forumGetUnreadForums(); + /*-- + if(USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list)) + { + return "".IMAGE_new.''; + } + return IMAGE_nonew; + --*/ + return (USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list)) ? "" . IMAGE_new . '' : IMAGE_nonew; - } - - function sc__wrapper_() { return 'forum_viewforum';} - - - function subinfo() { - $caller = debug_backtrace()[1]['function']; - if($this->var['forum_lastpost_info']) - { -// global $gen; - $tmp = explode('.', $this->var['forum_lastpost_info']); - $lp_thread = " $tmp[1]))."'>".IMAGE_post2.''; - $lp_date = $this->gen->convert_date($tmp[0], 'forum'); - -/*-- - $lp_name = $this->var['forum_lastpost_user_anon']; - if($this->var['user_name']) - { - $lp_name = " $this->var['forum_lastpost_user'], 'name' => $this->var['user_name']))."'>{$this->var['user_name']}"; } ---*/ -/*-- - else + + + function sc__wrapper_() // TODO XXX ?? { - $lp_name = $this->var['forum_lastpost_user_anon']; + return 'forum_viewforum'; } ---*/ - $lp_name = ($this->var['user_name'])?" $this->var['forum_lastpost_user'], 'name' => $this->var['user_name']))."'>{$this->var['user_name']}":$this->var['forum_lastpost_user_anon']; -/*---- - $tVars['SUB_LASTPOST'] = $lp_date.'
'.$lp_name.' '.$lp_thread; - - $tVars['SUB_LASTPOSTDATE'] = $gen->computeLapse($tmp[0], time(), false, false, 'short'); - $tVars['SUB_LASTPOSTUSER'] = $lp_name; -----*/ - return ($caller == 'sc_sub_lastpostuser'?$lp_name:($caller == 'sc_sub_lastpostdate'?$this->gen->computeLapse($tmp[0], time(), false, false, 'short'):($caller == 'sc_sub_lastpost'?$lp_date.'
'.$lp_name.' '.$lp_thread:''))); - } -/*---- - else - { - $tVars['SUB_LASTPOST'] = '-'; - $tVars['SUB_LASTPOSTUSER'] = ''; - $tVars['SUB_LASTPOSTDATE'] = ''; - } -----*/ - return ($caller == 'sc_sub_lastpost'?'-':''); -} - function sc_sub_lastpostuser() - { - return $this->subinfo(); - } + function subinfo() + { + $caller = debug_backtrace()[1]['function']; + if($this->var['forum_lastpost_info']) + { + // global $gen; + $tmp = explode('.', $this->var['forum_lastpost_info']); + $lp_thread = " $tmp[1])) . "'>" . IMAGE_post2 . ''; + $lp_date = $this->gen->convert_date($tmp[0], 'forum'); - function sc_sub_lastpostdate() - { - return $this->subinfo(); - } + /*-- + $lp_name = $this->var['forum_lastpost_user_anon']; + if($this->var['user_name']) + { + $lp_name = " $this->var['forum_lastpost_user'], 'name' => $this->var['user_name']))."'>{$this->var['user_name']}"; + } + --*/ + /*-- + else + { + $lp_name = $this->var['forum_lastpost_user_anon']; + } + --*/ + $lp_name = ($this->var['user_name']) ? " $this->var['forum_lastpost_user'], 'name' => $this->var['user_name'])) . "'>{$this->var['user_name']}" : $this->var['forum_lastpost_user_anon']; + /*---- + $tVars['SUB_LASTPOST'] = $lp_date.'
'.$lp_name.' '.$lp_thread; - function sc_sub_lastpost() - { - return $this->subinfo(); - } + $tVars['SUB_LASTPOSTDATE'] = $gen->computeLapse($tmp[0], time(), false, false, 'short'); + $tVars['SUB_LASTPOSTUSER'] = $lp_name; + ----*/ + return ($caller == 'sc_sub_lastpostuser' ? $lp_name : ($caller == 'sc_sub_lastpostdate' ? $this->gen->computeLapse($tmp[0], time(), false, false, 'short') : ($caller == 'sc_sub_lastpost' ? $lp_date . '
' . $lp_name . ' ' . $lp_thread : ''))); + + } + /*---- + else + { + $tVars['SUB_LASTPOST'] = '-'; + $tVars['SUB_LASTPOSTUSER'] = ''; + $tVars['SUB_LASTPOSTDATE'] = ''; + } + ----*/ + return ($caller == 'sc_sub_lastpost' ? '-' : ''); + } + + + function sc_sub_lastpostuser() + { + return $this->subinfo(); + } + + + function sc_sub_lastpostdate() + { + return $this->subinfo(); + } + + + function sc_sub_lastpost() + { + return $this->subinfo(); + } // Initial ideia, to have a separate shortcode var ($threadsc).... -/*------ -} + /*------ + } -class plugin_forum_viewforumthread_shortcodes extends plugin_forum_viewforum_shortcodes -//-- or ??? -//--class plugin_forum_viewforumthread_shortcodes extends e_shortcode -{ + class plugin_forum_viewforumthread_shortcodes extends plugin_forum_viewforum_shortcodes + //-- or ??? + //--class plugin_forum_viewforumthread_shortcodes extends e_shortcode + { - function __construct() - { -// $this->forum_rules = forum_rules('check'); - } -------*/ + function __construct() + { + // $this->forum_rules = forum_rules('check'); + } + ------*/ - function sc_views() - { - return $this->var['thread_views']; - } - function sc_replies() - { - return ($this->var['thread_total_replies']?:"0"); - } + function sc_views() + { + return $this->var['thread_views']; + } - function sc_viewsx() - { -/*-- - if(!deftrue('BOOTSTRAP')) - { - return $this->sc_views; - } - $badge = ($this->var['thread_views'] > 0) ? "badge-info" : ""; - return "".$this->sc_views.""; ---*/ - $badge = ($this->var['thread_views'] > 0) ? "badge-info" : ""; - return deftrue('BOOTSTRAP')?"".$this->sc_views()."":$this->sc_views(); - } - function sc_repliesx() - { -/*-- - if(!deftrue('BOOTSTRAP')) - { - return $this->sc_replies; - } - $badge = ($this->var['thread_total_replies'] > 0) ? "badge-info" : ""; - return "".$this->sc_replies.""; ---*/ - $badge = ($this->var['thread_total_replies'] > 0) ? "badge-info" : ""; - return deftrue('BOOTSTRAP')?"".$this->sc_replies()."":$this->sc_replies(); - } + function sc_replies() + { + return ($this->var['thread_total_replies'] ?: "0"); + } + + + function sc_viewsx() + { + /*-- + if(!deftrue('BOOTSTRAP')) + { + return $this->sc_views; + } + $badge = ($this->var['thread_views'] > 0) ? "badge-info" : ""; + return "".$this->sc_views.""; + --*/ + $badge = ($this->var['thread_views'] > 0) ? "badge-info" : ""; + return deftrue('BOOTSTRAP') ? "" . $this->sc_views() . "" : $this->sc_views(); + } + + + function sc_repliesx() + { + /*-- + if(!deftrue('BOOTSTRAP')) + { + return $this->sc_replies; + } + $badge = ($this->var['thread_total_replies'] > 0) ? "badge-info" : ""; + return "".$this->sc_replies.""; + --*/ + $badge = ($this->var['thread_total_replies'] > 0) ? "badge-info" : ""; + return deftrue('BOOTSTRAP') ? "" . $this->sc_replies() . "" : $this->sc_replies(); + } // function sc__wrapper_() { return 'forum_viewforum';} - function threadlastpostdata() { - $caller = debug_backtrace()[1]['function']; + function threadlastpostdata() + { + $caller = debug_backtrace()[1]['function']; // if($this->var['thread_views']) //($this->var['thread_total_replies']?:"0") - if($this->var['thread_views'] || $this->var['thread_total_replies']>0) - { + if($this->var['thread_views'] || $this->var['thread_total_replies'] > 0) + { // global $gen; //---- $lastpost_datestamp = $gen->convert_date($this->var['thread_lastpost'], 'forum'); -$LASTPOST = $LASTPOSTUSER = LAN_FORUM_1015; - if($this->var['lastpost_username']) - { - // XXX hopefully & is not allowed in user name - it would break parsing of url parameters, change to array if something wrong happens - $url = e107::getUrl()->create('user/profile/view', "name={$this->var['lastpost_username']}&id={$this->var['thread_lastuser']}"); + $LASTPOST = $LASTPOSTUSER = LAN_FORUM_1015; + if($this->var['lastpost_username']) + { + // XXX hopefully & is not allowed in user name - it would break parsing of url parameters, change to array if something wrong happens + $url = e107::getUrl()->create('user/profile/view', "name={$this->var['lastpost_username']}&id={$this->var['thread_lastuser']}"); //---- $tVars['LASTPOST'] = "".$this->var['lastpost_username'].""; //---- $tVars['LASTPOSTUSER'] = "".$this->var['lastpost_username'].""; -$LASTPOST = $LASTPOSTUSER = "".$this->var['lastpost_username'].""; - } -/*-- - else - { - if(!$this->var['thread_lastuser']) ---*/ - elseif(!$this->var['thread_lastuser']) - { + $LASTPOST = $LASTPOSTUSER = "" . $this->var['lastpost_username'] . ""; + } + /*-- + else + { + if(!$this->var['thread_lastuser']) + --*/ + elseif(!$this->var['thread_lastuser']) + { //---- $tVars['LASTPOST'] = $tp->toHTML($this->var['thread_lastuser_anon']); //---- $tVars['LASTPOSTUSER'] = $tp->toHTML($this->var['thread_lastuser_anon']); -$LASTPOST = $LASTPOSTUSER = e107::getParser()->toHTML($this->var['thread_lastuser_anon']); -/*-- - } + $LASTPOST = $LASTPOSTUSER = e107::getParser()->toHTML($this->var['thread_lastuser_anon']); + /*-- + } - else - { -//---- $tVars['LASTPOST'] = LAN_FORUM_1015; -//---- $tVars['LASTPOSTUSER'] = LAN_FORUM_1015; -//--$LASTPOST = $LASTPOSTUSER = LAN_FORUM_1015; - } ---*/ - } + else + { + //---- $tVars['LASTPOST'] = LAN_FORUM_1015; + //---- $tVars['LASTPOSTUSER'] = LAN_FORUM_1015; + //--$LASTPOST = $LASTPOSTUSER = LAN_FORUM_1015; + } + --*/ + } //---- $tVars['LASTPOST'] .= '
'.$lastpost_datestamp; -$LASTPOST .= '
'.$this->gen->convert_date($this->var['thread_lastpost'], 'forum'); + $LASTPOST .= '
' . $this->gen->convert_date($this->var['thread_lastpost'], 'forum'); //---- $tVars['LASTPOSTUSER'] = $this->var['lastpost_username']; // $lastpost_name; -$LASTPOSTUSER = $this->var['lastpost_username']; + $LASTPOSTUSER = $this->var['lastpost_username']; //----- ??????? - $temp['thread_sef'] = eHelper::title2sef($this->var['thread_name'],'dashl'); - $this->addVars($temp); + $temp['thread_sef'] = eHelper::title2sef($this->var['thread_name'], 'dashl'); + $this->addVars($temp); - $urlData = array('forum_sef'=>$this->var['forum_sef'], 'thread_id'=>$this->var['thread_id'],'thread_sef'=>$this->var['thread_sef']); - $url = e107::url('forum', 'topic', $urlData); - $url .= (strpos($url,'?')!==false) ? '&' : '?'; - $url .= "last=1#post-".$this->var['lastpost_id']; + $urlData = array('forum_sef' => $this->var['forum_sef'], 'thread_id' => $this->var['thread_id'], 'thread_sef' => $this->var['thread_sef']); + $url = e107::url('forum', 'topic', $urlData); + $url .= (strpos($url, '?') !== false) ? '&' : '?'; + $url .= "last=1#post-" . $this->var['lastpost_id']; //---- $tVars['LASTPOSTDATE'] .= "". $gen->computeLapse($thread_info['thread_lastpost'],time(), false, false, 'short').""; - return ($caller == 'sc_lastpostuser'?$LASTPOSTUSER:($caller == 'sc_lastpostdate'?"".$this->gen->computeLapse($this->var['thread_lastpost'],time(), false, false, 'short')."":($caller == 'sc_lastpost'?$LASTPOST:''))); + return ($caller == 'sc_lastpostuser' ? $LASTPOSTUSER : ($caller == 'sc_lastpostdate' ? "" . $this->gen->computeLapse($this->var['thread_lastpost'], time(), false, false, 'short') . "" : ($caller == 'sc_lastpost' ? $LASTPOST : ''))); - } + } - return ($caller == 'sc_lastpostuser'?'':'-'); -} + return ($caller == 'sc_lastpostuser' ? '' : '-'); + } - function sc_lastpostuser() - { - return $this->threadlastpostdata(); - } - function sc_lastpostdate() - { - return $this->threadlastpostdata(); - } + function sc_lastpostuser() + { + return $this->threadlastpostdata(); + } - function sc_lastpost() - { - return $this->threadlastpostdata(); - } - function sc_threaddate() - { + function sc_lastpostdate() + { + return $this->threadlastpostdata(); + } + + + function sc_lastpost() + { + return $this->threadlastpostdata(); + } + + + function sc_threaddate() + { // global $gen; - return $this->gen->convert_date($this->var['thread_datestamp'], 'forum'); - } + return $this->gen->convert_date($this->var['thread_datestamp'], 'forum'); + } - function sc_threadtimelapse() - { + + function sc_threadtimelapse() + { // global $gen; - return $this->gen->computeLapse($this->var['thread_datestamp'],time(), false, false, 'short'); // convert_date($thread_info['thread_datestamp'], 'forum'); - } + return $this->gen->computeLapse($this->var['thread_datestamp'], time(), false, false, 'short'); // convert_date($thread_info['thread_datestamp'], 'forum'); + } - function sc_icon() - { - global $forum; + + function sc_icon() + { + global $forum; // global $forum, $FORUM_VIEW_FORUM, $FORUM_VIEW_FORUM_STICKY, $FORUM_VIEW_FORUM_ANNOUNCE, $gen, $menu_pref, //$threadsViewed = $forum->threadGetUserViewed(); // $newflag = (USER && $this->var['thread_lastpost'] > USERLV && !in_array($this->var['thread_id'], $threadsViewed)); - $newflag = (USER && $this->var['thread_lastpost'] > USERLV && !in_array($this->var['thread_id'], $forum->threadGetUserViewed())); - $ICON = ($newflag ? IMAGE_new : IMAGE_nonew); + $newflag = (USER && $this->var['thread_lastpost'] > USERLV && !in_array($this->var['thread_id'], $forum->threadGetUserViewed())); + $ICON = ($newflag ? IMAGE_new : IMAGE_nonew); //-- CANDIDATE FOR TERNARY IF - if ($this->var['thread_total_replies'] >= $forum->prefs->get('popular', 10)) - { - $ICON = ($newflag ? IMAGE_new_popular : IMAGE_nonew_popular); - } - elseif(empty($this->var['thread_total_replies']) && defined('IMAGE_noreplies')) - { - $ICON = IMAGE_noreplies; - } + if($this->var['thread_total_replies'] >= $forum->prefs->get('popular', 10)) + { + $ICON = ($newflag ? IMAGE_new_popular : IMAGE_nonew_popular); + } + elseif(empty($this->var['thread_total_replies']) && defined('IMAGE_noreplies')) + { + $ICON = IMAGE_noreplies; + } //-- CANDIDATE FOR TERNARY IF - if ($this->var['thread_sticky'] == 1) - { - $ICON = ($this->var['thread_active'] ? IMAGE_sticky : IMAGE_stickyclosed); - } - elseif($this->var['thread_sticky'] == 2) - { - $ICON = IMAGE_announce; - } - elseif(!$this->var['thread_active']) - { - $ICON = IMAGE_closed; - } + if($this->var['thread_sticky'] == 1) + { + $ICON = ($this->var['thread_active'] ? IMAGE_sticky : IMAGE_stickyclosed); + } + elseif($this->var['thread_sticky'] == 2) + { + $ICON = IMAGE_announce; + } + elseif(!$this->var['thread_active']) + { + $ICON = IMAGE_closed; + } - return $ICON; - } - - function sc_threadtype() - { -//-- CANDIDATE FOR TERNARY IF - if ($this->var['thread_sticky'] == 1) - { - return '['.LAN_FORUM_1011.']
'; - } - elseif($this->var['thread_sticky'] == 2) - { - return '['.LAN_FORUM_1013.']
'; - } - - return ''; -} - - function sc_threadname() - { - global $menu_pref, $forum; - $tp = e107::getParser(); - - $thread_name = strip_tags($tp->toHTML($this->var['thread_name'], false, 'no_hook, emotes_off')); - if(isset($this->var['thread_options']['poll'])) - { - $thread_name = '['.LAN_FORUM_1016.'] ' . $thread_name; - } - -// if (strtoupper($THREADTYPE) == strtoupper(substr($thread_name, 0, strlen($THREADTYPE)))) -// { -// $thread_name = substr($thread_name, strlen($THREADTYPE)); -// } - $title = ''; - if ($forum->prefs->get('tooltip')) - { - $thread_thread = strip_tags($tp->toHTML($this->var['thread_thread'], true, 'no_hook')); - $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']; - $thread_thread = $tp->text_truncate($thread_thread, $tip_length, $menu_pref['newforumposts_postfix']); // Doesn't split entities + return $ICON; } - $thread_thread = str_replace("'", ''', $thread_thread); - $title = "title='".$thread_thread."'"; - } -/*-- - else - { - $title = ''; - } ---*/ - // $tVars['THREADNAME'] = " $threadId, 'name' => $thread_name))."'>{$thread_name}"; -// $url = e107::getUrl()->create('forum/thread/view', array('id' => $threadId, 'name' => $thread_name)); -// $thread_info['thread_sef'] = eHelper::title2sef($this->var['thread_name'],'dashl'); - $temp['thread_sef'] = eHelper::title2sef($this->var['thread_name'],'dashl'); - $this->addVars($temp); + function sc_threadtype() + { + //-- CANDIDATE FOR TERNARY IF + if($this->var['thread_sticky'] == 1) + { + return '[' . LAN_FORUM_1011 . ']
'; + } + elseif($this->var['thread_sticky'] == 2) + { + return '[' . LAN_FORUM_1013 . ']
'; + } - $url = e107::url('forum','topic', $this->var); - return "{$thread_name}"; - } + return ''; + } - function sc_pages() - { + + function sc_threadname() + { + global $menu_pref, $forum; + $tp = e107::getParser(); + + $thread_name = strip_tags($tp->toHTML($this->var['thread_name'], false, 'no_hook, emotes_off')); + if(isset($this->var['thread_options']['poll'])) + { + $thread_name = '[' . LAN_FORUM_1016 . '] ' . $thread_name; + } + + // if (strtoupper($THREADTYPE) == strtoupper(substr($thread_name, 0, strlen($THREADTYPE)))) + // { + // $thread_name = substr($thread_name, strlen($THREADTYPE)); + // } + $title = ''; + if($forum->prefs->get('tooltip')) + { + $thread_thread = strip_tags($tp->toHTML($this->var['thread_thread'], true, 'no_hook')); + $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']; + $thread_thread = $tp->text_truncate($thread_thread, $tip_length, $menu_pref['newforumposts_postfix']); // Doesn't split entities + } + $thread_thread = str_replace("'", ''', $thread_thread); + $title = "title='" . $thread_thread . "'"; + } + /*-- + else + { + $title = ''; + } + --*/ + // $tVars['THREADNAME'] = " $threadId, 'name' => $thread_name))."'>{$thread_name}"; + + // $url = e107::getUrl()->create('forum/thread/view', array('id' => $threadId, 'name' => $thread_name)); + + // $thread_info['thread_sef'] = eHelper::title2sef($this->var['thread_name'],'dashl'); + $temp['thread_sef'] = eHelper::title2sef($this->var['thread_name'], 'dashl'); + $this->addVars($temp); + + $url = e107::url('forum', 'topic', $this->var); + return "{$thread_name}"; + } + + + function sc_pages() + { // $tVars['PAGES'] = fpages($thread_info, $tVars['REPLIES']); - return fpages($this->var, $this->sc_replies()); - } + return fpages($this->var, $this->sc_replies()); + } - function sc_pagesx() - { + + function sc_pagesx() + { // $tVars['PAGESX'] = fpages($thread_info, $tVars['REPLIES']); - return $this->sc_pages(); - } + return $this->sc_pages(); + } - function sc_admin_icons() - { - if (MODERATOR) - { - $threadId = $this->var['thread_id']; - $forumId = $this->var['thread_forum_id']; - // FIXME _URL_ thread name - // e107::getUrl()->create('forum/forum/view', "id={$thread_info['thread_forum_id']}") - // USED self instead + function sc_admin_icons() + { + + if(MODERATOR) + { + $threadId = $this->var['thread_id']; + $forumId = $this->var['thread_forum_id']; + // FIXME _URL_ thread name + // e107::getUrl()->create('forum/forum/view', "id={$thread_info['thread_forum_id']}") + // USED self instead // $moveUrl = e107::url('forum','move', $this->var); - return " -
- - ".($this->var['thread_sticky'] == 1 ? " " : " ")." - ".($this->var['thread_active'] ? " " : " "). " - var)."'>".IMAGE_admin_move.' -
- '; - } - return ''; -} - - function sc_adminoptions() - { -/*-- - if(!deftrue('BOOTSTRAP')) - { - return $this->sc_admin_icons; - } - if (MODERATOR) - { - return fadminoptions($this->var); - } - return ''; ---*/ - return (!deftrue('BOOTSTRAP')?$this->sc_admin_icons():((MODERATOR)?fadminoptions($this->var):'')); - } - - function sc_poster() -{ -/*-- - if ($this->var['user_name']) - { - return " $this->var['thread_user'], 'name' => $this->var['user_name']))."'>".$this->var['user_name'].""; - } -// else -// { - elseif($this->var['thread_user_anon']) - { - return e107::getParser()->toHTML($this->var['thread_user_anon']); + return " +
+ + " . ($this->var['thread_sticky'] == 1 ? " " : " ") . " + " . ($this->var['thread_active'] ? " " : " ") . " + var) . "'>" . IMAGE_admin_move . ' +
+ '; + } + return ''; } + + + function sc_adminoptions() + { + /*-- + if(!deftrue('BOOTSTRAP')) + { + return $this->sc_admin_icons; + } + if (MODERATOR) + { + return fadminoptions($this->var); + } + return ''; + --*/ + return (!deftrue('BOOTSTRAP') ? $this->sc_admin_icons() : ((MODERATOR) ? fadminoptions($this->var) : '')); + } + + + function sc_poster() + { + /*-- + if ($this->var['user_name']) + { + return " $this->var['thread_user'], 'name' => $this->var['user_name']))."'>".$this->var['user_name'].""; + } + // else + // { + elseif($this->var['thread_user_anon']) + { + return e107::getParser()->toHTML($this->var['thread_user_anon']); + } + // else + // { + return LAN_FORUM_1015; + --*/ // else // { - return LAN_FORUM_1015; ---*/ -// else -// { - return (($this->var['user_name'])?" $this->var['thread_user'], 'name' => $this->var['user_name']))."'>".$this->var['user_name']."":(($this->var['thread_user_anon'])?e107::getParser()->toHTML($this->var['thread_user_anon']):LAN_FORUM_1015)); + return (($this->var['user_name']) ? " $this->var['thread_user'], 'name' => $this->var['user_name'])) . "'>" . $this->var['user_name'] . "" : (($this->var['thread_user_anon']) ? e107::getParser()->toHTML($this->var['thread_user_anon']) : LAN_FORUM_1015)); // } // } -} + } //////////////////////////////////////////////// -/* + /* - function sc_sub_description() - { - return e107::getParser()->toHTML($this->var['forum_description'], false, 'no_hook'); - } + function sc_sub_description() + { + return e107::getParser()->toHTML($this->var['forum_description'], false, 'no_hook'); + } - function sc_sub_threadsx() - { - $badgeThreads = ($this->var['forum_replies']) ? "badge-info" : ""; - return "".$this->var['forum_threads'].""; - } + function sc_sub_threadsx() + { + $badgeThreads = ($this->var['forum_replies']) ? "badge-info" : ""; + return "".$this->var['forum_threads'].""; + } - function sc_sub_repliesx() - { - $badgeReplies = ($this->var['forum_replies']) ? "badge-info" : ""; - return "".$this->var['forum_replies'].""; - } + function sc_sub_repliesx() + { + $badgeReplies = ($this->var['forum_replies']) ? "badge-info" : ""; + return "".$this->var['forum_replies'].""; + } - function sc_newflag() - { - global $newflag_list; - if(USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list)) - { - return "".IMAGE_new.''; - } - return IMAGE_nonew; + function sc_newflag() + { + global $newflag_list; + if(USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list)) + { + return "".IMAGE_new.''; + } + return IMAGE_nonew; - } + } -*/ - function sc_avatar($opts) - { - if (isset($this->var['thread_id'])) + */ + function sc_avatar($opts) { - return e107::getParser()->toAvatar(e107::user($this->var['thread_lastuser']),$opts); + if(isset($this->var['thread_id'])) + { + return e107::getParser()->toAvatar(e107::user($this->var['thread_lastuser']), $opts); + } + elseif(isset($this->var['forum_id'])) + { + return e107::getParser()->toAvatar(e107::user($this->var['forum_lastpost_user']), $opts); + } + + return ''; } - elseif (isset($this->var['forum_id'])) - { - return e107::getParser()->toAvatar(e107::user($this->var['forum_lastpost_user']),$opts); - } - - return ''; } -} + + ?>