Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Sep 1999
Posts: 33
Power User
Power User
Offline
Joined: Sep 1999
Posts: 33
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.
Attachments
40207-sitstayadds.php (0 Bytes, 51 downloads)

Sponsored Links
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
Warning: Cannot add header information - headers already sent by (output started at markread.php on line 111

do you know what that means?

ciao

Joined: Mar 2000
Posts: 84
Member
Member
Offline
Joined: Mar 2000
Posts: 84
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.

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
stupid me.. right that fixed it...
by mistake I had uploaded the file in MAC format, not Unix.

Interesting that that leads to that type of error,
that lead me in the total wrong direction..

Good to know such a thing for the future ..

Thank you .. and: Great Hack!!!!!

Joined: Nov 2001
Posts: 8
Lurker
Lurker
Offline
Joined: Nov 2001
Posts: 8
hi
please can you send me this hack. I can't get the attached one !?

Sponsored Links
Joined: Sep 1999
Posts: 33
Power User
Power User
Offline
Joined: Sep 1999
Posts: 33
Here it is. Right click on the Attachment link and do a Save as...
Attachments
43259-sitstayadds.php (0 Bytes, 52 downloads)

Joined: Nov 2001
Posts: 52
Power User
Power User
Offline
Joined: Nov 2001
Posts: 52
Hi SitStay,

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 ?


mh #211327 11/25/2001 7:57 AM
Joined: Sep 1999
Posts: 33
Power User
Power User
Offline
Joined: Sep 1999
Posts: 33
Okay here it is as a text file so it can be saved/downloaded.
Attachments
43429-sitstayadds.txt (0 Bytes, 87 downloads)

mh #211328 11/25/2001 9:17 AM
Joined: Nov 2001
Posts: 52
Power User
Power User
Offline
Joined: Nov 2001
Posts: 52
THNX SitStay !

mh #211329 11/28/2001 4:58 PM
Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Hi sitstay,

Thanks, this looks good... could you please explain the need of
"Edit line 97 to be a board on your site" ?

Could it be any board? why is it needed?

Regards,
Max


Sponsored Links
Maze_Brendan #211330 11/29/2001 7:50 AM
Joined: Sep 1999
Posts: 33
Power User
Power User
Offline
Joined: Sep 1999
Posts: 33
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.


Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
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.

Cheers & thanks again,
Max


Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
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.

Thanks for any help,
Max

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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 smile


- Allen wavey
- What Drives You?
Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Hi Allen,

I'm hoping someone will help us figure out how to auto-markallread new users. Maybe SitStay, if he's reading []https://www.ubbdev.com/threads/php/images/icons/wink.gif[/]

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>



Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
My redirect isn't working either.
And I could not find the reason.

Could anybody post a working 5.5.1 compatible version?

This might have got lost in the hack-crack-crash recently.

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
I have a working 5.5 version... but the above should work if you modify the redirect link to a hard-coded link.

Unfortunately, file uploads are disabled for the moment... as soon as they are re-enabled, I'll upload the latest.

Regards,
Max


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)