// ######################### PROCESS NEWS ############################
// standard news block
if (($vbindex['options'] & VBI_SHOWNEWS) && !($vbindex['options'] & VBI_VBWAR) && !EXTRA_PAGE && $_REQUEST['action'] != 'shoutbox') {
$getnews = $DB_site->query("
## GET NEWS ##
SELECT thread.*,thread.iconid AS threadiconid, threadpost.pagetext AS pagetext,
threadpost.attach AS attachcount,
".iif($vbindex['options'] & VBI_SHOWNEWSAVATAR, 'avatarpath, NOT ISNULL(avatardata) AS customavatar, user.avatarrevision, customavatar.dateline AS customdateline,')."
".iif(($vbindex['options'] & VBI_SUBNEWS) AND $bbuserinfo['userid'], 'NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed,')."
IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid
FROM ".TABLE_PREFIX."thread AS thread
LEFT JOIN ".TABLE_PREFIX."user AS user ON (thread.postuserid = user.userid)
LEFT JOIN ".TABLE_PREFIX."post AS threadpost ON (thread.firstpostid = threadpost.postid)
LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread')
".iif($vbindex['options'] & VBI_SHOWNEWSAVATAR, '
LEFT JOIN '.TABLE_PREFIX.'customavatar AS customavatar ON (customavatar.userid = user.userid)
LEFT JOIN '.TABLE_PREFIX.'avatar AS avatar ON (avatar.avatarid = user.avatarid)'
)."
".iif(($vbindex['options'] & VBI_SUBNEWS) AND $bbuserinfo['userid'], "
LEFT JOIN ".TABLE_PREFIX."subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = $bbuserinfo[userid])"
)."
WHERE forumid IN ($vbindex[newsfid])
AND deletionlog.primaryid IS NULL
AND forumid NOT IN (".implode(',', $limitfids).")
AND thread.open <> 10
AND thread.visible = '1'
$globalignore $ignorelist ORDER BY ".iif($vbindex['options'] & VBI_STICKYNEWS, 'thread.sticky DESC,', '')." thread.dateline DESC
LIMIT $vbindex[newsposts]");
// if vBwar is enabled then show that instead
if ((($vbindex['options'] & VBI_VBWAR) && !($vbindex['options'] & VBI_SHOWNEWS)) && !EXTRA_PAGE && $_REQUEST['action'] != 'shoutbox') {