This exact code works for me...
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 = 1; //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
$newmsg = "Yes";
} else {
$newmsg = "No";
}
In your vBulletin Options -> General Settings -> Thread/Forum Read Marking Type, is it set to
Database (automatic forum marking)? It may need to be for this to work.