Global announcements invisible to ordinary users

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
User avatar
DBM
Registered User
Posts: 159
Joined: Tue Oct 25, 2005 10:29 pm
Contact:

Global announcements invisible to ordinary users

Post by DBM »

I've looked through all the documentation and can't see what is causing this.

When I try posting a Global Announcement, it appears above each forum - but the content can only be viewed by admins and moderators.

When I go in to edit it, it appears to be in my moderators' forum. If I move it to a new forum, it simply becomes a standard Announcement which all users can see but only in that particular forum.

If I then edit it to make it a Global Announcement, it ends up back in the moderators' forum.

I have no idea why this is happening and can't find any settings to make Global Announcements viewable by all. Any ideas, anyone?
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Global announcements invisible to ordinary users

Post by A_Jelly_Doughnut »

Um...

That should not be the case if you have not modified the board in any way.

By default, phpBB3 checks to see if you have permission to read the announcement in the forum where it is being viewed.

The only thing that might cause this would be some entries in the phpbb_acl_groups table which refer to forum_id 0. There should be some of these, but not for any of the forum-based permissions.

Code: Select all

SELECT ag.*, ao.* FROM phpbb_acl_groups ag, phpbb_acl_options ao
 WHERE ag.forum_id = 0 
   AND ag.auth_option_id = ao.auth_option_id
   AND ao.auth_option_id LIKE 'f_%'
If you can run that in the Query Window of phpMyAdmin, it should say no results (or "an empty result set"). If it does not, let me know exactly what it does return.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
User avatar
DBM
Registered User
Posts: 159
Joined: Tue Oct 25, 2005 10:29 pm
Contact:

Re: Global announcements invisible to ordinary users

Post by DBM »

"MySQL returned an empty result set (i.e. zero rows). (Query took 0.0140 sec)"

The board does have three mods: phpbb-seo's advanced mod rewrite and zero dupe, plus one to show topic titles on the index.
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Global announcements invisible to ordinary users

Post by A_Jelly_Doughnut »

I have a feeling it is a bug in the Zero Dupe MOD. The MOD seems to be directing users to the moderator-only forum to view this particular announcement, so they are denied access.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
User avatar
DBM
Registered User
Posts: 159
Joined: Tue Oct 25, 2005 10:29 pm
Contact:

Re: Global announcements invisible to ordinary users

Post by DBM »

A_Jelly_Doughnut wrote:I have a feeling it is a bug in the Zero Dupe MOD. The MOD seems to be directing users to the moderator-only forum to view this particular announcement, so they are denied access.
Can you give me some idea why you think this particular mod is causing the problem? I've raised it with the mod's developers and they can't see why it should.

I suspect you may be right that it's down to a mod I've added to the board, otherwise other people would have reported this problem by now, but I'm struggling to locate where the problem might be at the moment.
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Global announcements invisible to ordinary users

Post by A_Jelly_Doughnut »

I think that because a global announcement can be accessed from many different URLs - one for each forum on your board. If it is directing users to the private forum (where the global announcement was started, a logical place to direct them), then it would cause this error.

If you go to the global announcement, what is its URL? What is the URL to the private forum? (I only need URLs from the first / onwards (i.e. /viewtopic-f12-t-15-the-rules.html)
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
User avatar
DBM
Registered User
Posts: 159
Joined: Tue Oct 25, 2005 10:29 pm
Contact:

Re: Global announcements invisible to ordinary users

Post by DBM »

It's still happening with the zero dupe switched off and the mods forum number is 10, while there are other forums with a lower number, so I'm not sure that is the cause of the problem.
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Global announcements invisible to ordinary users

Post by A_Jelly_Doughnut »

It would still be helpful to have the URLs that phpBB is trying to display the global announcement at. Maybe a link to your board as well...

If it isn't Zero Dupes, I'll want to keep digging
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
User avatar
DBM
Registered User
Posts: 159
Joined: Tue Oct 25, 2005 10:29 pm
Contact:

Re: Global announcements invisible to ordinary users

Post by DBM »

OK, I've put up a test Global Announcement at **topic now deleted**

As you can see, the board uses mod rewrite to generate 'friendly' URLs. I have opted to leave the subforum details out of URLs, which has not affected the operation of normal posts in any way.

Once again, it now seems to 'reside' in a private forum (f=10) that is only accessible by moderators. This is despite me posting it in a forum viewable by everyone (f=7). I can edit the post and move it to another forum - but then it automatically becomes a standard Announcement linked to that forum rather than being a Global.

Even if zero dupe or the mod rewrite are causing this, I'm baffled as to why everything gets redirected to forum 10.
Last edited by DBM on Wed Aug 15, 2007 4:59 pm, edited 1 time in total.
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Global announcements invisible to ordinary users

Post by A_Jelly_Doughnut »

Ok, that is the problem right there. Global announcements require a forum ID to be in the URL to be displayed reliably.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
User avatar
DBM
Registered User
Posts: 159
Joined: Tue Oct 25, 2005 10:29 pm
Contact:

Re: Global announcements invisible to ordinary users

Post by DBM »

A_Jelly_Doughnut wrote:Ok, that is the problem right there. Global announcements require a forum ID to be in the URL to be displayed reliably.
OK, but why does it always get diverted to forum 10? I have opted to keep forum names out of the rewritten URLs as it makes them too long and also because topics quite often get moved to different forums so I prefer URLs to simply refer to the topic.

Were forum numbers introduced to phpbb3 URLs to enable global announcements then?
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Global announcements invisible to ordinary users

Post by A_Jelly_Doughnut »

The 10 is an interesting thing about SQL and the way it sorts when no sorting mechanism is specified.

If no forum ID is in the URL, phpBB looks for any postable forum. MySQL will choose one "randomly", but it will always return the same one.

For example, if I run this SQL query on my system, I always get "adsbot [google]"

Code: Select all

SELECT username_clean FROM phpbb_users LIMIT 1
If you were to run the same query, you may get different results.

One relatively easy fix for this would be to exclude forum 10 from the search by changing this bit in viewtopic.php

Code: Select all

	$sql_array['WHERE'] .= ' OR (t.topic_type = ' . POST_GLOBAL . '
		AND f.forum_type = ' . FORUM_POST . ')';
to

Code: Select all

	$sql_array['WHERE'] .= ' OR (t.topic_type = ' . POST_GLOBAL . '
		AND f.forum_type = ' . FORUM_POST . ' AND f.forum_id <> 10)';
DBM wrote:Were forum numbers introduced to phpbb3 URLs to enable global announcements then?
Yes, that is why viewforum.php now takes f as a parameter in the URL :)
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
User avatar
DBM
Registered User
Posts: 159
Joined: Tue Oct 25, 2005 10:29 pm
Contact:

Re: Global announcements invisible to ordinary users

Post by DBM »

Will give it a try, but not for a few days as I'm heading away for a few days. Thanks for the tip. I'll also bring this to the mod author's attention. He may already have a solution to it and I just missed it (it's happened before :oops: ).
User avatar
DBM
Registered User
Posts: 159
Joined: Tue Oct 25, 2005 10:29 pm
Contact:

Re: Global announcements invisible to ordinary users

Post by DBM »

I'm still having problems with this one.

I set up a test board with a fresh install of RC5. I then installed the latest versions of these mods on the test board and had no problems at all with the global announcements. Incidentally, the authors of the mods have been unable to reproduce the problem too.

So tonight I updated the database on my live forum from RC4 to RC5 and used copies of the files from the test board.

And... I still have exactly the same problem as before with the global announcements! :shock: :shock: :shock:

So I can only think that something is screwed in my database. I will try your workaround as suggested above, but right now I'm restoring from backups to get back to where I was.

Edit: have now restored the board. Tried your workaround, Jelly Doughnut, but it was returning syntax errors in viewtopic.php. :(
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Global announcements invisible to ordinary users

Post by A_Jelly_Doughnut »

If you'd provide the exact error, I could probably find a new fix.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
Locked

Return to “[3.0.x] Support Forum”