PDA

View Full Version : Auto Mark Read


Fizzban
01-02-2006, 10:00 PM
Adds a new option "Automatically mark forums read" to the User Control Panel.

If an user enable this option, only threads with new postings since his last visit will be marked as unread when he returns to the forums after being inactive for a certain amount of time (the value of the cookie timeout option). This is how all versions of vBulletin before 3.5 functioned.

This product mimics the "Inactivity/Cookie Based Thread/Forum Read Marking" behaviour but is actually completely database-based and does not use cookies at all.

It will only work if you use "Database (no automatic forum marking)" or "Database (automatic forum marking)" as Thread/Forum Read Marking Type. Of course, there is no need to use this plugin if you use "Inactivity/Cookie Based".

See the included readme for instructions how to install this product.

nexialys
01-03-2006, 02:48 PM
very interesting... may be very useful for forums with hundreds of subforums... and may be very db extensive the same way.. ;)

Fizzban
01-03-2006, 03:17 PM
I wrote it because users complained about the new vBulletin behaviour and demanded the old vB 3.0. system back. This way, the users have a choice.

And there aren't a lot of additional database calls, only one "Mark all forums" query whenever an inactive user returns.

Snake
01-03-2006, 03:46 PM
How about a screeny? :\

Fizzban
01-03-2006, 03:50 PM
A screenshot of what? Marked forums? :D

The only thing to see is the new option in the usercp and I don't think that it is very interesting.

Edit: I have added a screenshot of the new option.

Robru
01-13-2006, 01:16 PM
What's the sql "Mark all forums" query for all the users in one time ?

Fizzban
01-15-2006, 02:31 AM
The code used in the plugin is:

$query = '';
foreach ($vbulletin->forumcache AS $fid => $finfo)
{
// mark the forum and all child forums read
$query .= ", ($fid, " . $vbulletin->userinfo['userid'] . ", " . $vbulletin->userinfo['lastactivity'] . ")";
}

if ($query)
{
$query = substr($query, 2);
$db->query_write("
REPLACE INTO " . TABLE_PREFIX . "forumread
(forumid, userid, readtime)
VALUES
$query
");
}