2012-02-09, 05:07 AM
Hey,
I was wondering if there was anyway to code (in PHP, I'm guessing) a way for a sidebar that pulls the Latest Threads to ignore certain forums ids?
This is the code that my plugin is using to pull the latest threads:
Any help would be great!
I was wondering if there was anyway to code (in PHP, I'm guessing) a way for a sidebar that pulls the Latest Threads to ignore certain forums ids?
This is the code that my plugin is using to pull the latest threads:
//Get latest threads
if($mybb->settings['sb_latest'] == 1)
{
$altbg = alt_trow();
$threadlist = '';
$query = $db->query("
SELECT t.*, u.username
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
ORDER BY t.lastpost DESC
LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']
);
while($thread = $db->fetch_array($query))
{
$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
// Don't link to guest's profiles (they have no profile).
if($thread['lastposteruid'] == 0)
{
$lastposterlink = $thread['lastposter'];
}
else
{
$lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
}
if(my_strlen($thread['subject']) > 25)
{
$thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
}
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$thread['threadlink'] = get_thread_link($thread['tid']);
eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";");
$altbg = alt_trow();
}
if($threadlist)
{ // show the table only if there are threads
eval("\$sb_latestthreads = \"".$templates->get("portal_latestthreads")."\";");
}
}
Any help would be great!