$forumperms = array(); foreach ($forumcache AS $forum) { $forumperms["$forum[forumid]"] = fetch_permissions($forum['forumid']); if (!($forumperms["$forum[forumid]"] and CANVIEW) or !($forumperms["$forum[forumid]"] and CANVIEWOTHERS)) { $limitfids .= ',' . $forum['forumid']; } } $getthreads = $DB_site->query(" SELECT thread.title, thread.date, thread.time, thread.replycount FROM " . TABLE_PREFIX . "thread AS thread WHERE open = '1' AND thread.lastpost >= " . (time() - 86400) . " AND forumid NOT IN (0$limitfids) AND thread.visible = '1' ORDER BY lastpost DESC LIMIT 5 "); while ($thread = $DB_site->fetch_array($getthreads)) { $thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['title']), 68)); $thread['date'] = vbdate($vboptions['dateformat'], $thread['lastpost'], 1); $thread['time'] = vbdate($vboptions['timeformat'], $thread['lastpost']); $thread['replycount'] = vb_number_format($thread['replycount']); eval('$threadbits .= "' . fetch_template('myowntemplate_latestthreadbit') . '";'); } unset($forum, $thread, $threads); $DB_site->free_result($getthreads);
$forumperms = array(); foreach ($forumcache AS $forum) { $forumperms["$forum[forumid]"] = fetch_permissions($forum['forumid']); if (!($forumperms["$forum[forumid]"] and CANVIEW) or !($forumperms["$forum[forumid]"] and CANVIEWOTHERS)) { $limitfids .= ',' . $forum['forumid']; } } $getthreads = $DB_site->query(" SELECT thread.title, thread.date, thread.time, thread.replycount, f.title as forumtitle FROM " . TABLE_PREFIX . "thread AS thread LEFT JOIN " . TABLE_PREFIX . "forum as f ON f.forumid = thread.forumid WHERE thread.open = '1' AND thread.lastpost >= " . (time() - 86400) . " AND thread.forumid NOT IN ($limitfids) AND thread.visible = '1' ORDER BY thread.lastpost DESC LIMIT 5 "); while ($thread = $DB_site->fetch_array($getthreads)) { $thread['title'] = fetch_censored_text(fetch_trimmed_title(unhtmlspecialchars($thread['title']), 68)); $thread['date'] = vbdate($vboptions['dateformat'], $thread['lastpost'], 1); $thread['time'] = vbdate($vboptions['timeformat'], $thread['lastpost']); $thread['replycount'] = vb_number_format($thread['replycount']); $forumname = $thread['forumtitle']; eval('$threadbits .= "' . fetch_template('myowntemplate_latestthreadbit') . '";'); } unset($forum, $thread, $threads); $DB_site->free_result($getthreads);