Version: , by ethank
Developer Last Online: Jun 2010
Version: 2.2.x
Rating:
Released: 11-02-2001
Last Update: Never
Installs: 25
No support by the author.
Hack: Persistent Mark Forum Read Version of VB: 2.2.5 Current version: 1.3 Description: This hack replaces the bahavior of vBulletin's "Mark Forum Read" and "Mark All Forums Read" with a system that uses a database to track when forums are set read. By eliminating the use of cookies for this feature, a user can come onto your boards, read a bit, mark forums read as they go through and logout. The next time they come into the forums, the status of which forums they've read and which they haven't, as well as new posts since the last time they read is preserved.
This functions a lot like EZBoard and Chatspace's Webboard.
Included in this hack are three search routines: searing the entire forum for new messages, an individual forum and a section of the hierarchy (parent + children)
Also: Mark All Forums Read, Mark Individual Forum Read and Mark Hierarchy Section (Parent + Children) Read
Note: The install is not all pretty yet and requires a degree of knowledge of MySQL (to add a table) and PHP (as it requires heavy modifications to core files). It is recommended that you backup everything before using this.
After installation, behavior might be a bit odd until a default "markread" record is created for users. This is created when they first login if one does not exist.
This hack has been tweaked to now not add more than two queries to your index page. It will add load on sub-forum pages currently if you have a lot of nested forums. This will be fixed in the next release.
Instructions:
Follow the instructions in the included text file TO THE LETTER. If you run into problems, post here so we can work through them and improve the instructions. Look for a better install utility soon.
I recommend doing the text editing using a DIFF utility to see where you made changes, it honestly helps.
Place the images in your vbulletin image folder. I included PSD files for them if you want to change colors.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Anyone get this going with 2.2.7? I really want too. The default Vb mark all read, and new post indicators are driving me to bits. I'm sick of looking at a new post indicator on my main page, then going into the thread to see nothing new. Or nothing is being mark'd read and the post indicators are off, when there is a new post... :devious:
I still have the hack working (as it was in this release) in 2.2.8, but have one problem. The query count in forumdisplay is petrifying when a forum contains several forums with sub-forums. Im thinking that the replacement code for forumdisplay.php needs to be optimized like index.php was. I've played with it a little trying to emulate what was done in index.php and it does knock the query count down, but new post indications don't appear for subforums when viewing forumdisplay.php. :\
Nevermind my previous post. Using the same replacements for index.php in forumdisplay.php did work, I was just putting one piece in the wrong place, and it did fix the query counts as well. Down from over 300 to now only 18
Originally posted by Cynthia Blue Ok.. actually, it's not quite working right, either. I don't have child forums, I have different categories. When you click one forum in a category as read, it marks all the forums in that category as read.
This is the code that is in the template next to each individual forum... in the forumhome_forumbit_level2_post template:
help... thanks.
Mind telling us how you fixed it? I'm having the same problem...
Nevermind, fixed it by moving all forums out of a category (I was going to do that eventually anyway, the category being there was just a result of the conversion from phpBB to vBulletin)
I must say, this hack is farking genius
The more I use it, the more I become addicted to it... damn, now gotta add it to my other board!
so, has anybody successfully installed this on a vb2.3.0 site? if so, is it a public site i can play with?
i'd like to have something better than the default read/unread functionality, but i'm concerned that this hack hasn't quite made it into 2.3.0 territory.
i installed the hack on a fresh new board to see where the problem was.
its the modification in index.php with me.
i have to replace this and then it goes wrong
PHP Code:
REPLACE:
// do light bulb
if ($bbuserinfo['lastvisitdate']=='Never') {
$forum['onoff']='on';
} else {
if (isset($bbforumview[$forum['forumid']]) and $bbforumview[$forum['forumid']]>$bbuserinfo['lastvisit']) {
$userlastvisit=$bbforumview[$forum['forumid']];
} else {
$userlastvisit=$bbuserinfo['lastvisit'];
}
if ($userlastvisit<$forum['lastpost']) {
$forum['onoff']='on';
} else {
$forum['onoff']='off';
}
}
WITH:
// do light bulb
if ($bbuserinfo['lastvisitdate']=='Never') {
$forum['onoff']='on';
} else {
// ** CODE ADDED BY ETHANK TO SEE IF THE FORUM WAS MARKED READ SEPERATELY
/* Select id from forum where parentlist like forumid
cycle through, for each if lates thread is greater than mark read time or bbuserinfo, select lastpost, limit 1, if true flag
*/
$forum['onoff'] = 'off';
// Need to find forum children
$children_array = find_children($forum['forumid']);
for ($i=0;$i<count($children_array);$i++)
{
$childrenid = $children_array[$i];
$forum_array = $forumsarray_markread[$childrenid];
$readtime = $forum_array['readtime'];
$latest_thread = $forum_array['lastpost'];
$forum['last_thread'] = $latest_thread;
//Check to see if this thread's last read is < than the markread or base mark read
if ($readtime != '')
{
if ($readtime<$latest_thread)
{
$forum['onoff']='on';
}
}
else
{
$forum_info = $forumsarray_list[$childrenid];
$latest_thread = $forum_info['lastpost'];
if ($bbuserinfo['lastvisit']< intval($latest_thread))
{
$forum['onoff'] = 'on';
}
}
}
anyone can see if there a sign missing or too much??
Still going strong on this hack -- from 2.0.6 through 2.2.6!
I am working on upgrading straight to 2.3.0 and haven't stayed on top of the code changes. Does anyone know where bbarraycookie (forumdisplay.php line 34 and 294, member2.php line 450, showthread.php line 192, 311, etc..... ) came from? How does it relate to the vbsetcookie that it seems to be replacing in some of these locations?
If anyone can get this running in 2.3.0, post and let us know what you find!