In a plugin on global_start add this code
Code:
include('includes/functions_forumlist.php');
global $vbulletin, $lastpostarray;
// call fetch_last_post_array() first to get last post info for forums
cache_ordered_forums(1);
if (!is_array($lastpostarray))
{
fetch_last_post_array(-1);
}
$forumidx = 999; //Set your forum id to check here
$lastpostinfo = (empty($lastpostarray[$forumidx]) ? array() : $vbulletin->forumcache["$lastpostarray[$forumidx]"]);
$forumx = $vbulletin->forumcache["$forumidx"];
$isnew = fetch_forum_lightbulb($forumidx, $lastpostinfo, $forumx);
if ($isnew == "new")
{
//Execute code here if the forumid chosen above contains new posts
}
Replace 999 with the forumid of the forum (or category) you want to check
This works for me, I repeat this code multiple times in the plugin to check multiple forumids-
Code:
$forumidx = 998; //Set your forum id to check here
$lastpostinfo = (empty($lastpostarray[$forumidx]) ? array() : $vbulletin->forumcache["$lastpostarray[$forumidx]"]);
$forumx = $vbulletin->forumcache["$forumidx"];
$isnew = fetch_forum_lightbulb($forumidx, $lastpostinfo, $forumx);
if ($isnew == "new")
{
//Execute code here if the forumid chosen above contains new posts
}