PDA

View Full Version : how does vb know when a forum is read or unread


nnStaff
05-29-2009, 04:19 PM
from what I can tell, it uses the fetch_forum_lightbulb function in functions_forumlist.php, correct?

But in that function, it doesn't do any user-level checking. For our forum, we have "Database (automatic forum marking)" enabled.

So looking at the code, this is the only real check I see:


if ($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
{
$userlastvisit = (!empty($foruminfo['forumread']) ? $foruminfo['forumread'] : (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)));
}

if ($lastpostinfo['lastpost'] AND $userlastvisit < $lastpostinfo['lastpost'])
{
return 'new';
}


How does that code at any point check a user's thread read settings? We have thread marking enabled, so shouldn't it be checking the db to see which threads a user has marked as read, and then do a tally of some sort? Am I missing something?

The reason I'm asking is because from what I can tell, that is the function that forumhome uses to get the $forum[statusicon]. I'm using the exact same function for a plugin of mine (tryin to test out something) in order to see whether a forum is read or not. But it's marking them ALL as new, even though only half of them are. It thinks my $userlastvisit is May 19th, how is that?

nnStaff
05-30-2009, 06:55 PM
nobody understands how this works? :(