diff --git a/e107_plugins/forum/forum.php b/e107_plugins/forum/forum.php index a6d2e4036..7fdd39077 100644 --- a/e107_plugins/forum/forum.php +++ b/e107_plugins/forum/forum.php @@ -104,7 +104,7 @@ if(isset($_GET['f'])) //var_dump (is_array($sc)); //--$fVars = new e_vars; -$gen = new convert; +//--$gen = new convert; /*-- // Gonne directly to shortcode file diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index 5c1dba63a..201672314 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -2097,6 +2097,7 @@ class e107forum +// Function eventually to be reworked (move full function to shortcode file, or make a new breadcrumb function, like in downloads, maybe?) /* * set bread crumb * $forum_href override ONLY applies when template is missing FORUM_CRUMB @@ -2229,12 +2230,20 @@ class e107forum +/* $BACKLINK = $BREADCRUMB; + $templateVar->BREADCRUMB = $BREADCRUMB; $templateVar->BACKLINK = $BACKLINK; $templateVar->FORUM_CRUMB = $FORUM_CRUMB; +*/ + // Backlink shortcode is defined inside shortcode file.... +//---- var_dump ($templateVar); +//---- echo "
"; + $templateVar['breadcrumb'] = $BREADCRUMB; + $templateVar['forum_crumb'] = $FORUM_CRUMB; } diff --git a/e107_plugins/forum/forum_viewforum.php b/e107_plugins/forum/forum_viewforum.php index 011eaf694..2bc611c62 100644 --- a/e107_plugins/forum/forum_viewforum.php +++ b/e107_plugins/forum/forum_viewforum.php @@ -82,23 +82,27 @@ $page = (varset($_GET['p']) ? $_GET['p'] : 1); $threadFrom = ($page - 1) * $view; global $forum_info, $FORUM_CRUMB; -$fVars = new e_vars; + $sc = e107::getScBatch('viewforum', 'forum'); + +//----$fVars = new e_vars; + +/*-- $fVars->STARTERTITLE = LAN_FORUM_1004; $fVars->THREADTITLE = LAN_FORUM_1003; $fVars->REPLYTITLE = LAN_FORUM_0003; $fVars->LASTPOSTITLE = LAN_FORUM_0004; $fVars->VIEWTITLE = LAN_FORUM_1005; - +--*/ $forumId = (int)$_REQUEST['id']; if(!$forumId && e_QUERY) // BC Fix for old links. { list($id,$from) = explode(".",e_QUERY); - $forumId = intval($id); + $forumId = intval($id); $threadFrom = intval($from); - unset($id,$from); + unset($id,$from); } if (!$forum->checkPerm($forumId, 'view')) @@ -123,7 +127,7 @@ if (!$forum->checkPerm($forumId, 'view')) } $forumInfo = $forum->forumGet($forumId); -$threadsViewed = $forum->threadGetUserViewed(); +//----$threadsViewed = $forum->threadGetUserViewed(); if (empty($FORUM_VIEW_START)) { @@ -194,16 +198,18 @@ if(!empty($forumInfo['forum_description'])) //define('MODERATOR', $forum_info['forum_moderators'] != '' && check_class($forum_info['forum_moderators'])); //$modArray = $forum->forum_getmods($forum_info['forum_moderators']); +// $thread??? $modArray = $forum->forumGetMods($thread->forum_info['forum_moderators']); define('MODERATOR', (USER && is_array($modArray) && in_array(USERID, array_keys($modArray)))); -$message = ''; +//----$message = ''; if (MODERATOR) { if ($_POST) { require_once(e_PLUGIN.'forum/forum_mod.php'); - $message = forum_thread_moderate($_POST); +//-- $message = forum_thread_moderate($_POST); + $forumSCvars['message']=forum_thread_moderate($_POST); } } @@ -237,12 +243,14 @@ require_once(HEADERF); $text=''; // TODO - message batch shortcode +/*-- if ($message) { //$ns->tablerender('', $message, array('forum_viewforum', 'msg')); //e107::getMessage()->add($thread->message); $fVars->MESSAGE = $message; } +--*/ $threadCount = $forumInfo['forum_threads']; @@ -262,24 +270,32 @@ if ($pages) if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== false || strpos($FORUM_VIEW_END, 'THREADPAGES') !== false) { $url = e107::url('forum','forum',$forumInfo, array('query'=>array('p'=>'[FROM]'))); +/*-- $parms = "total={$pages}&type=page¤t={$page}&url=".$url."&caption=off"; $fVars->THREADPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}"); +--*/ + $forumSCvars['parms'] = "total={$pages}&type=page¤t={$page}&url=".$url."&caption=off"; +//-- ?????????? unset $ulrparms???? unset($urlparms); } } if($forum->checkPerm($forumId, 'thread')) //new thread access only. { + $forumSCvars['ntUrl']= e107::url('forum','post')."?f=nt&id=". $forumId; +/*-- $ntUrl = e107::url('forum','post')."?f=nt&id=". $forumId; $fVars->NEWTHREADBUTTON = "".IMAGE_newthread.''; $fVars->NEWTHREADBUTTONX = newthreadjump($ntUrl); + } if(!BOOTSTRAP) { $fVars->NEWTHREADBUTTONX = $fVars->NEWTHREADBUTTON; } - +--*/ +} if(substr($forumInfo['forum_name'], 0, 1) == '*') { @@ -296,18 +312,26 @@ if(substr($forum_info['sub_parent'], 0, 1) == '*') $forum_info['sub_parent'] = substr($forum_info['sub_parent'], 1); } -$forum->set_crumb(true, '', $fVars); // set $BREADCRUMB (and $BACKLINK) +//----$forum->set_crumb(true, '', $fVars); // set $BREADCRUMB (and $BACKLINK) + +//-- Function eventually to be reworked (move full function to shortcode file, or make a new breadcrumb function, like in downloads, maybe?) +$forum->set_crumb(true, '', $forumSCvars); // set $BREADCRUMB (and $BACKLINK) + $modUser = array(); foreach ( $modArray as $user) { $modUser[] = "".$user['user_name'].""; } +/*-- $fVars->FORUMTITLE = $forumInfo['forum_name']; $fVars->MODERATORS = LAN_FORUM_1009.': '.implode(', ', $modUser); $fVars->BROWSERS = ''; +--*/ + $forumSCvars['forum_name']= $forumInfo['forum_name']; + $forumSCvars['modUser']= $modUser; + $forumSCvars['track_online']= varset($pref['track_online']); - - +/*-- if(varset($pref['track_online'])) { $fVars->BROWSERS = $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).')'; @@ -346,10 +370,10 @@ else // v1.x "; } - +--*/ // ----------------- { VIEWABLE_BY } --------------------------- - +/*-- if($users = $forum->getForumClassMembers($forumId)) { $userList = array(); @@ -391,13 +415,12 @@ else { $fVars->VIEWABLE_BY = ''; } - +--*/ // ------------------------------------------------------------ ///TODO XXX All these $fVars items need to be put into a shortcode class so they can be parsed with parms and wrappers. Big Job! - - +/*-- $fVars->SEARCH = "

@@ -407,8 +430,9 @@ $fVars->SEARCH = "

"; +--*/ - +/*-- // ----- Perm Display --- $permDisplay = array(); @@ -427,12 +451,11 @@ $fVars->SEARCH = " $fVars->PERMS = implode("", $permDisplay); - +--*/ // ------------------------------- - $sticky_threads = 0; $stuck = false; $reg_threads = 0; @@ -446,9 +469,12 @@ if(!empty($_GET['srch'])) } $threadList = $forum->forumGetThreads($forumId, $threadFrom, $view, $threadFilter); +/*-- $subList = $forum->forumGetSubs(vartrue($forum_id)); -$gen = new convert; - +--*/ +//------$gen = new convert; + $forumSCvars['forum_parent']= $forumInfo['forum_parent']; +/*-- $fVars->SUBFORUMS = ''; if(is_array($subList) && isset($subList[$forumInfo['forum_parent']][$forumId])) { @@ -460,7 +486,7 @@ if(is_array($subList) && isset($subList[$forumInfo['forum_parent']][$forumId])) } $fVars->SUBFORUMS = $FORUM_VIEW_SUB_START.$sub_info.$FORUM_VIEW_SUB_END; } - +--*/ if (count($threadList) ) { foreach($threadList as $thread_info) @@ -513,8 +539,8 @@ else $forum_view_forum .= "".LAN_FORUM_1008.""; } -$fVars->FORUMJUMP = forumjump(); -$fVars->TOPLINK = "".LAN_GO.''; // FIXME - TOPLINK not used anymore? +//--$fVars->FORUMJUMP = forumjump(); +//--$fVars->TOPLINK = "".LAN_GO.''; // FIXME - TOPLINK not used anymore? if($container_only) { @@ -523,13 +549,21 @@ if($container_only) $forum_view_forum = ''; } -$forum_view_start = $tp->simpleParse($FORUM_VIEW_START, $fVars); -$forum_view_end = $tp->simpleParse($FORUM_VIEW_END, $fVars); + $sc->setVars($forumSCvars); + +//var_dump ($FORUM_VIEW_START); +// var_dump ($FORUM_VIEW_SUB); +$forum_view_start = $tp->parseTemplate($FORUM_VIEW_START, false, $sc); +$forum_view_end = $tp->parseTemplate($FORUM_VIEW_END, false, $sc); + +//$forum_view_start .= "

FVARS FORUM

".$tp->simpleParse($FORUM_VIEW_START, $fVars); +//$forum_view_end = $tp->simpleParse($FORUM_VIEW_END, $fVars); if ($forum->prefs->get('enclose')) { +// $forum_view_subs???? $ns->tablerender($forum->prefs->get('title'), $forum_view_start.$forum_view_subs.$forum_view_forum.$forum_view_end, array('forum_viewforum', 'main1')); } else @@ -546,10 +580,10 @@ echo "