UBB.Dev
Posted By: Astaran [6.2] Mark all read for single forum - 03/20/2003 11:37 PM
NAME: Mark all read for single forum
VERSION: 1.0.1
DESCRIPTION: Mark all posts in a single forum as read.
WORKING UNDER: UBB.threads 6.2.x
PREREQUISITES: none
AUTHORS: Astaran
CREDITS: JustDave, who created the first MarkAllRead hack
DEMO: none
FILES ALTERED: ubbthreads.php,markallread.php, domarkallread.php,templates/ubbthreads.tmpl, templates/markallread.tmpl
DATABASE ALTERED: no
NEW FILES: none

HISTORY:
2003-03-20 Astaran - 1.0.0 Release of the hack
2003-03-25 Astaran - 1.0.1 Added a title tag to the image

Attached File
Hm, I must be missing something. I made all the changes and it's marking all the forums still. Time to debug...
Posted By: Astaran Re: [6.2] Mark all read for single forum - 03/21/2003 5:44 PM
Are you clicking on the bulbs/newpost icons that appear right before the forum name?


Attached picture 73796-screen.jpg
aha, ok. I was looking for it to be within the forum itself. Since if you go into a forum and read say 3 out of 30 new threads, i looked at it as having the option there so that you could clear those threads of new posts after going in and seeing nothing else you wanted to read.

Once you go into the thread, you can't do the markforum from the index.
Posted By: smilesforu Re: [6.2] Mark all read for single forum - 03/22/2003 10:59 AM
Nice mod... a great addition to this would be a mouse over that said it would mark this forum topics as read.
Posted By: RandyJG Re: [6.2] Mark all read for single forum - 03/22/2003 11:45 AM
Not sure if this is a problem, but it lets someone create entries into w3t_Last for forums that don't exist.

I was trying to add this into postlist.php/tmpl and ended up with some odd entries when I was doing something wrong.
Posted By: AKD96 Re: [6.2] Mark all read for single forum - 03/23/2003 7:36 PM
I'm with smilesforu. I installed and it's working great, but I would have been in the same boat as Chris. There needs to be something that let's the users know they have this option.
Posted By: RandyJG Re: [6.2] Mark all read for single forum - 03/24/2003 10:38 PM
Installed, works. Only been in use for half a day.

I added this where the post button is on a forum instead.
Works great in expanded mode where not all the messages are marked as read when leaving the forum.

Next step: Mark Category read?
Posted By: Astaran Re: [6.2] Mark all read for single forum - 03/25/2003 8:04 PM
I added a title tag that is displayed when the user hovers over the image.
You can define the text in your language files.

For upgrading just search for "marktitle" in the instructions and add this lines to your code.
Posted By: Astaran Re: [6.2] Mark all read for single forum - 03/25/2003 8:16 PM
If you're willing to share the instructions for adding the button on postlist.php, I'll update the instructions accordingly.

Expanding that to work with categories should be too hard.
You'll could use the existing "question mark" button or create a extra button.
Posted By: ChrisBeveridge Re: [6.2] Mark all read for single forum - 03/26/2003 12:15 AM
[]RandyJG said:
I added this where the post button is on a forum instead.
[/]

Randy, can you post what you did for that? I'm having a hell of a time getting it to work right and must be missing something silly on my part.
Posted By: RandyJG Re: [6.2] Mark all read for single forum - 03/26/2003 12:27 AM
Reason I didn't share it was I haven't bothered to work it into the php/language files and to block it from annonymous.

For now I just have it hardcoded as an active link in the template for postlist.tmpl:

<!-- Under construction -->
<td class="navigation" nowrap="nowrap">
<a href="/ubbthreads/markallread.php?Cat=$Cat&singleforum=$Board">Mark Read</a>
</td>
Posted By: Astaran Re: [6.2] Mark all read for single forum - 03/26/2003 12:30 AM
[]RandyJG said:
Reason I didn't share it was I haven't bothered to work it into the php/language files and to block it from annonymous.
[/]

I'll do that tomorrow and update the intructions.
Posted By: KrisG Re: [6.2] Mark all read for single forum - 03/28/2003 10:58 AM
It'd be nice if the new posts icon remained (along with the ability to mark the forum) in the Main Index after you visited a forum if you haven't marked that particular forum yet. Can this be done?
Posted By: RandyJG Re: [6.2] Mark all read for single forum - 03/28/2003 2:33 PM
In the first instruction instead of replacing with this:

// --------------------------
// Which folder do we display
$boardfolder = "nonewposts.gif";
$markallstart = "";
$markallend = "";
$marktitle = "";
if ( ($checker < $Last) ){
$boardfolder = "newposts.gif";
if ($Username) {
$markallstart = "<a href="{$config['phpurl']}/markallread.php?Cat=$Cat&singleforum=$Keyword">";
$markallend = "</a>";
$marktitle = "title="". $ubbt_lang['MARK_TEXT'] . """;
}
}

Replace with this (Move the inner if to the outside of the new check):

// --------------------------
// Which folder do we display
$boardfolder = "nonewposts.gif";
$markallstart = "";
$markallend = "";
$marktitle = "";
if ( ($checker < $Last) ){
$boardfolder = "newposts.gif";
}
if ($Username) {
$markallstart = "<a href="{$config['phpurl']}/markallread.php?Cat=$Cat&singleforum=$Keyword">";
$markallend = "</a>";
$marktitle = "title="". $ubbt_lang['MARK_TEXT'] . """;
}
Posted By: KrisG Re: [6.2] Mark all read for single forum - 03/28/2003 3:43 PM
Sweet deal! Thanks RandyJG.
Posted By: KrisG Re: [6.2] Mark all read for single forum - 03/28/2003 3:55 PM
I can now mark the forum even if the "no new posts" icon appears in the Main Index, but the icon in the main index changes to the "no new posts" icon even though there are still unread posts in that specific forum. Is there a way you can keep the "New posts" icon untill a user marks that specific forum?
Posted By: RandyJG Re: [6.2] Mark all read for single forum - 08/06/2003 8:41 PM
[6.2]

While trying to setup new indicators for anonymous users I noticed that this line is possibly not doing what it should:

preg_replace ("-$singleforum=(\d*?)-", '', ${$config['cookieprefix']."w3t_visit"})

It appears to be replacing, for example:

-myforum=1234567-

with this:

-1234567-

and then adding the new entry to the end of the cookie leaving some garbage behind each time a user uses 'mark read' for a specific forum.

When I replaced the pattern with this instead it appears to work as expected:

"/-$singleforum=(.*?)-/"

(this pattern is the pattern found in existing code to check if a forum in in w3t_visit cookie string)
Posted By: Astaran Re: [6.2] Mark all read for single forum - 08/08/2003 4:21 PM
Thx, RandyJG!

I updated the instructions and reposted them HERE
© UBB.Developers