preserve global unread flags

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28796
Joined: Sat Aug 16, 2003 7:36 am

preserve global unread flags

Post by Extensions Robot »

Modification name: preserve global unread flags
Author: asinshesq
Modification description: This mod fixes a phpbb3 bug that causes unread global announcements to lose their unread status whenever the user reads all the unreads in a given forum or posts any new posts or replies. A bug report about this phpbb3 bug has been posted here: http://www.phpbb.com/bugs/phpbb3/15729
Modification version: 1.0.0
Tested on phpBB version: 3.0.4

Download file: preserve_global_unread_flags.zip
File size: 34.27 KiB

Modification overview page: View

The phpBB Team is not responsible nor required to provide support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Extension Customisations Team may not be able to provide support.

-->Modification support<--
Last edited by Extensions Robot on Mon Sep 14, 2020 12:37 pm, edited 10 times in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 27482
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

preserve global unread flags

Post by Paul »

Modification validated/released

Notes:
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

preserve global unread flags

Post by asinshesq »

[edit on September 26, 2009: phpbb3.0.6 has its own fix to preserve global unread flags that is different from the one this mod uses. Since phpbb3.0.6RC2 was just released yesterday, it appears that phpbb3.0.6 will be released shortly. Thus it does not make sense for people to install this mod at this point. Anyone who plans to update to phpbb3.0.6 using the phpbb updater (as opposed to the new or changed folders approach) and who already has this mod installed should go ahead and uninstall it before using the phpbb updater to update the board to phpbb3.0.6.]

Thanks, Paul. My guess is that most people won't care too much about global unreads since for most boards global announcements rarely change. But for a board where global announcements change often, this mod may be useful.
Last edited by asinshesq on Sat Sep 26, 2009 11:28 am, edited 1 time in total.
User avatar
DoYouSpeakWak
Registered User
Posts: 2310
Joined: Fri Jul 25, 2008 1:32 pm
Location: Island of Wak-Wak
Contact:

Re: preserve global unread flags

Post by DoYouSpeakWak »

Its really nice there is a mod to fix the bug. But as you mention its not widely used. also on our site. 1 locked global annoncement.
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid services. 10+ years of experience with phpBB3 and as System Administrator.
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: preserve global unread flags

Post by IPB_Refugee »

I think bug fixes should not be released as MODs but should become part of phpBB's core code.
It's the same with the MOD that fixes the problem with the spaces in BBCode [ code] when you use Firefox.

But thank you, Alan!
Wolfgang
User avatar
MartectX
Translator
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: preserve global unread flags

Post by MartectX »

I'm with IPB_Refugee on this one: It's obviously not working as intended, so why do we need a MOD to establish the correct functionality?

Alas, thanks to asinshesq for this modification!
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: preserve global unread flags

Post by asinshesq »

IPB_Refugee wrote:I think bug fixes should not be released as MODs but should become part of phpBB's core code.
MartectX wrote:I'm with IPB_Refugee on this one: It's obviously not working as intended, so why do we need a MOD to establish the correct functionality?
Those are fair points, but here are some excerpts from the mods indevelopment topic for this mod where I touched on this issue:
In the mods in development topic for this mod, asinshesq wrote:The bug is not a subtle one the developers missed. It is there by design. The developers who wrote the code for tracking unreads purposefully wrote code to wipe out global unread flags whenever the user reads his last unread post of a forum or posts a new post, and the code and comments they wrote make this totally clear. I suspect they made a choice to do that to avoid the additional resource overhead it would have taken to treat globals just like any other forum, since regular boards rarely will have new global posts anyway. So I would not be surprised if they choose not to fix the bug...

It is possible (not likely but possible ;) ) that I thought of an approach for fixing the bug that is efficient enough so that they might change their minds and adopt something like my fix. So submitting the full code as a mod and having people test it out could convince the developers to fix a bug they were otherwise going to leave alone (and give them a starting place when they write their own fix)...
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: preserve global unread flags

Post by asinshesq »

Since I mentioned overhead for large boards as the reason I am guessing the developers left this bug in place, I figured it would be useful for me to describe exactly what overhead this mod will add to a board:

1. When a global that is the most recent global is deleted or turned into a regular post, the mod needs to find the time of the new most recent global (a single select MAX query) and update the config table with that time (a single update query).

2. When a new global is posted, or an old post with a post time more recent than the post time for the most recent global is edited to become a global, the mod needs to update the config table with the post time for the new global (a single update query).

Even for a huge board with a reasonable amount of activity in globals, it seems to me that the situations described above will not be continuously happening so the additional queries the mod executes ought to be insignificant. I would be interested if anyone has a different perspective on this.
suitlocal
Registered User
Posts: 95
Joined: Sat Mar 08, 2008 11:18 pm

Re: preserve global unread flags

Post by suitlocal »

bug fixes that are more than just a line or two might best be released as modifications first so as to get testing before being implemented. a modification i would like to see added is this one:

http://www.phpbb.com/community/viewtopic.php?t=1323065

the modification has had bug fixes posted along the way for bugs that probably would have had to have been patched in the release after the next one (since it is doubtful phpbb's own quality assurance would have found it; some of these are quite obscure). for example,

http://www.phpbb.com/community/viewtopi ... 5#p8289945

this is not without precedent, either:

http://www.phpbb.com/community/viewtopi ... 4&t=222560
jordancnd
Registered User
Posts: 2
Joined: Wed Jul 29, 2009 1:31 am

Re: preserve global unread flags

Post by jordancnd »

Got similar issue with PM's. Any idea how to resolve ? ie. if you have 3 new messages but only read 1, when you return to the index page it states that you have 0 unread messages. Please advise if solution would be similar to this mod's.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: preserve global unread flags

Post by asinshesq »

jordancnd wrote:Got similar issue with PM's. Any idea how to resolve ? ie. if you have 3 new messages but only read 1, when you return to the index page it states that you have 0 unread messages. Please advise if solution would be similar to this mod's.
No, that problem happens because it is telling you how many NEW pms there are (rather than how many unread pms). Easy to change to unread, but I can't help right now because I'm out of the country for another 10 days but if you look at my view or mark unread posts mod I think I said something in the authors notes about that.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: preserve global unread flags

Post by asinshesq »

asinshesq wrote:
jordancnd wrote:Got similar issue with PM's. Any idea how to resolve ? ie. if you have 3 new messages but only read 1, when you return to the index page it states that you have 0 unread messages. Please advise if solution would be similar to this mod's.
No, that problem happens because it is telling you how many NEW pms there are (rather than how many unread pms). Easy to change to unread, but I can't help right now because I'm out of the country for another 10 days but if you look at my view or mark unread posts mod I think I said something in the authors notes about that.
I managed to take a quick look at the files. All you need to do is to find {PRIVATE_MESSAGE_INFO} where it appears in styles/[your_style]/template/overall_header.html and change that to {PRIVATE_MESSAGE_INFO_UNREAD}
Commander Gizmo
Registered User
Posts: 47
Joined: Mon May 26, 2008 7:45 pm

Re: preserve global unread flags

Post by Commander Gizmo »

It seems that your install.xml references several Find strings that occur multiple times through the document, even matching the line and white space exactly. Do you intend for all of the occurrences to be updated or just one? If the latter, which one?

Examples:
functions_admin.pnp

Code: Select all

		$topic_ids[] = $row['topic_id'];
and

Code: Select all

	$db->sql_transaction('commit');
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: preserve global unread flags

Post by asinshesq »

Commander Gizmo wrote:It seems that your install.xml references several Find strings that occur multiple times through the document, even matching the line and white space exactly. Do you intend for all of the occurrences to be updated or just one? If the latter, which one?
All. They wouldn't have validated the mod if it mistakenly repeated things. Do them in the order you find them.
Commander Gizmo
Registered User
Posts: 47
Joined: Mon May 26, 2008 7:45 pm

Re: preserve global unread flags

Post by Commander Gizmo »

Thanks for the reply. I was thrown off because some MODS do list other lines separately if they do not have the same white space before the code, even if the rest of the line is identical. Perhaps I missed some difference in the code added after the matching lines?

At any rate, the above system seems odd since one could easily mistake one for the other if leading white space is the only difference.
Locked

Return to “[3.0.x] MOD Database Releases”