How would I change this template so that I can exclude a forum or two?
PHP Code:
$how_last = 10; // Wieviel Themen sollen angezeigt werden?
$vbulletin->input->clean_array_gpc('p', array(
'limits'=> TYPE_INT
));
switch($vbulletin->GPC['limits'])
{
case 10:
$max = 10;
;break;
case 20;
$max = 20;
;break;
case 30:
$max = 30;
;break;
default:
$max =& $how_last;
}
$exc = "";
$forumpermissions = array();
foreach($vbulletin->forumcache AS $forum)
{
$forumpermissions[$forum["forumid"]] = fetch_permissions($forum['forumid']);
if ((!($forumpermissions[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canview']) AND
!$vbulletin->options['showprivateforums']) OR
!($forumpermissions[$forum["forumid"]] & $vbulletin->bf_ugp_forumpermissions['canviewothers']))
{
$exc .= "'" . ',' . "'" . $forum['forumid'];
}
}
unset($forum);
$whereit = ",'$exc'";
$last_threads_sql = $db->query_read_slave("
SELECT
thread.threadid, thread.open, thread.visible, thread.title,
thread.lastpost, thread.forumid, thread.dateline, thread.lastposter
" . (($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid']) ? ", threadread.readtime AS threadread" : "") . "
FROM " . TABLE_PREFIX . "thread AS thread
" . (($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid']) ? " LEFT JOIN " . TABLE_PREFIX . "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = " . $vbulletin->userinfo['userid'] . ")" : "") . "
WHERE forumid NOT IN (''$whereit)
AND thread.open != 10 AND thread.visible = 1
ORDER BY thread.lastpost DESC
LIMIT 0, $max
");
while($last_w = $db->fetch_array($last_threads_sql))
{
if ($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
{
$foruminfo['forumreads'] = $vbulletin->forumcache["$last_w[forumid]"]['forumread'];
$lastreads_new = max($foruminfo['forumreads'], TIMENOW - ($vbulletin->options['markinglimit'] * 86400));
}else{
$bbforumviews = intval(fetch_bbarray_cookie('forum_view', $last_w['forumid']));
$lastreads_new = max($bbforumviews, $vbulletin->userinfo['lastvisit']);
}
if (!$lastreads_new)
{
$lastreads_new = $vbulletin->userinfo['lastvisit'];
}
if ($last_w['lastpost'] > $lastreads_new)
{
if ($vbulletin->options['threadmarking'] AND $last_w['threadread'])
{
$threadviews = $last_w['threadread'];
}else{
$threadviews = intval(fetch_bbarray_cookie('thread_lastview', $last_w['threadid']));
}
if ($last_w['lastpost'] > $threadviews)
{
$show['gotonewposts'] = true;
}else{
$show['gotonewposts'] = false;
}
}else{
$show['gotonewposts'] = false;
}
// Optional zu aktivieren // vor $last_w entfernen
//$last_w['date'] = vbdate($vbulletin->options['dateformat'], $last_w['lastpost'], true); //Datum
//$last_w['time'] = vbdate($vbulletin->options['timeformat'], $last_w['lastpost']); //Uhrzeit
$last_class = exec_switch_bg();
$last_w['trimmedtitle'] = fetch_trimmed_title($last_w['title'], $vbulletin->options['lastthreadchars']);
eval('$last_threads .= "' . fetch_template('forumhome_last_threads') . '";');
}
$db->free_result($last_threads_sql);
unset($whereit, $last_threads_sql, $last_w);