Attached is a file that contains a routine to Mark All Read. This was a Perl hack we had and since we converted to PHP (much faster!) we have converted the hack as well. Instructions for installation (very simple) are in the file.
Here is what it does (pulled right out of the comments in the file). The user will see these instructions formatted.
// What does Mark All Read do? (from our user instructions below) // It will mark all messages in every forum as having been read. This will remove // the new flags for all threads in every forum. // Any new messages, from this point forward, will still have the new // flag until you use Mark All Read again. // Why would I want to use Mark All Read? // If you don't go into every board, you will always see the new // flags on every forum. If you find this annoying, use Mark All Read which basically // acts like you read every message all at once. Then you can easily see new // messages when they are posted as they'll stand out like a sore paw. // Can I get the new flags back? // New messages will still be flagged as new. Only new messages at the time you // pressed Mark All Read will have their new flags turned off.
Installation instructions are in the file. It's easy.
That means that there is some kind of output coming from that script before the headers specified by w3t are sent. This is usually caused by line feeds or other additional white space in the script you're using, probably toward the tail end. Your best bet is to try and go to the end of the file, and delete everything until you come up to the last character to ensure there are no hard returns or anything hiding down there. Then try it again.
I guess you will have to rename the attachment to a txt extension for example because the php is parsed and gives even as a save as (which is the correct behaviour)
Fatal error: Failed opening required 'main.inc.php' (include_path='.:/usr/local/lib/php') in /home/htdocs/vhosts/ubbdev.com/htdocs/threads/php/uploads/43259-sitstayadds.php on line 27
Allen, could the upload directory be changed so it does not parse php ?
It can be any board at all on your site. This is the "keyword name" of the board used as the name of the SQL table.
It is necessary as lines 101-109 need to set a session variable or cookie with the last visit information. Without this, markallread doesn't work. It is because of the way the system uses this session variable / cookie later on.
Many thanks... I did get it working, very cool. Beyond the convenience factor, it looks like this is making a big performance/speed improvement on busy boards with lots of forums.
FYI, there are a couple of little typos...
In the instructions: // We added a link in the menu area of send_header in main.inc.php
That's a typo, it should be ubbt.inc.php
Also, in the last section which creates the redirect, url=$config[phpurl]/wwwthreads.php?Cat=$Cat should be url=$config[phpurl]/ubbthreads.php?Cat=$Cat
But for some strange reason that I couldn't figure out, my redirect wasn't working... I was getting http://www.mysite.com/ubbthreads.php when it should be http://www.mysite.com/myforumdirectory/ubbthreads.php ... although everything else is working fine, and similar redirects are working fine in the other ubbthreads scripts. I ended up having to hardcode the URL. Strange.
Sorry for the simplistic question... how would I automate domarkallread when registering a new user?
In adduser.php, can I just add the code from the domarkallread function (without sending the headers), will that work or would the variables require modification? Should I exclude the global $dbh, $user; line?
Or is a better way to try to create a routine as part of ubbt.inc.php that can be called from adduser.php?
On busy boards, it's very resource intensive (and slow) when a user first looks at a main index with a lot of posts.
How is this going Max? Would be an excellent modification I think for newbies to a site.
I added it here, and it seems to work well, with the changes you prescribed to update it. It doesn't seem to read the phpurl variable, so you have to hard code it on lines 59 and 157 (ie, ours is /threads/php/sitstayadds.php ). Thanks for the excellent addon on SitStay
Here's some alternative text that' I'm using on my boards.
<h3>What does Mark All Read do?</h3> <p>It will mark all messages on every board as having been read. This will remove the <font color="#FF0000">new</font> flags for all threads in every forum. It is equivalent to going through every board and reading every message.</p> <h3>Why would I want to use Mark All Read?</h3> <p><b><font color=red>Using Mark All Read will greatly speed up your display of the Main Index, and reduce the load on our server</font></b>. If you don't go into every board, you will always see the <font color="#FF0000">new</font> flags on the boards you don't visit. Using Mark All Read clears all the flags, and allow you to cleanly track new messages from that point forward.</p> <h3>Can I get the new flags back?</h3> <p>After pressing Mark All Read, subsequent messages will continue to be flagged as <font color="#FF0000">new</font>, until you press Mark All Read again. </p> <p>Press this button to give it a try:</p> <p>
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.