| :: |
| Author |
Message |
arch stanton PR1

Joined: 04 Oct 2006 Posts: 113
|
Posted: Fri Aug 10, 2007 12:38 pm Post subject: Can zero dupe affect Global Announcements? |
|
|
There is a problem with global announcements on my RC4 board.
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 again to make it a Global Announcement, it ends up back in the moderators' forum.
I asked for help on this on the phpbb.com forum at http://www.phpbb.com/community/viewtopic.php?f=46&t=571891
I was asked about what mods I have (as no-one else seems to have this problem) and I replied that I had advanced mod-rewrite and zero dupe. I was then told that zero dupe was causing the problem.
I don't really see how zero dupe would affect it and I can't see that I've done anything wrong in the edits.
dcz, is there any chance of you casting your expert eye over this?  |
|
|
| Back to top |
|
 |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3116
|
Posted: Fri Aug 10, 2007 2:38 pm Post subject: Re: Can zero dupe affect Global Announcements? |
|
|
Well it should not.
Try turning the zero dupe off just to make sure, but I really doubt it could be it. |
_________________
|
|
| Back to top |
|
 |
arch stanton PR1

Joined: 04 Oct 2006 Posts: 113
|
Posted: Fri Aug 10, 2007 8:25 pm Post subject: Re: Can zero dupe affect Global Announcements? |
|
|
| SeO wrote: | Well it should not.
Try turning the zero dupe off just to make sure, but I really doubt it could be it. |
How do I turn it off?
I'm going to set up a vanilla RC4 board and see if I can replicate the problem on there. If so, then I'll report it to the phpBB bug tracker.
Has anyone else on here noticed any similar problems with Global Announcements after installing mod-rewrite and zero dupe? If not, then I guess it has to be a faulty edit on my part but I can't find it.  |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Sun Aug 12, 2007 10:43 am Post subject: Re: Can zero dupe affect Global Announcements? |
|
|
From the install file :
| Code: | 2) Settings :
_____________
This mod runs two level of checking as well as several options.
In phpbb_seo/phpbb_seo_class.php you will find :
$this->seo_opt['zero_dupe'] = array( 'on' => true, // Activate or not the redirections : true / false
'strict' => false, // strict compare, == VS strpos() : true / false
'post_redir' => 'off', // Redirect post urls if not valid ? : guest / all / post / off |
0.4.0RC1 is close to be released and will include the zero duplicate settings, I'm sure you'll appreciate the setting pages, screenshots :
Main setting page -----------------> phpBB SEO class settings -------> Forum URL setting -------------> .htaccess setting
 |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
arch stanton PR1

Joined: 04 Oct 2006 Posts: 113
|
Posted: Wed Aug 15, 2007 4:57 pm Post subject: Re: Can zero dupe affect Global Announcements? |
|
|
It doesn't look like zero dupe was the problem, check out AcydBurn's response to the bug report here: http://www.phpbb.com/bugs/phpbb3/ticket.php?ticket_id=14117
It seems that the problem is caused by taking the forum id out of URLs in mod rewrite. This is most annoying, as I want friendly URLs and Global Announcements - but don't want forum injection as I think it makes URLs too long (plus we tend to move topics around quite a lot on my board).  |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3116
|
Posted: Wed Aug 15, 2007 6:32 pm Post subject: Re: Can zero dupe affect Global Announcements? |
|
|
hum.
One could see this as phpBB3 not being fully ready for people migrating from phpBB2. Since all old topic URLs could be affected.
Anyway, I could not reproduce this issue when testing. I tried to post a global announce within an admin only access forum, and it displayed well for guest and regular users, in all forums. The same when I set up the guest auth to no access on this forum.
I even tried to deactivate the zero duplicate redirections and use the real url, the exact same result, it's working.
If I deactivate the URL rewriting totally, global announcement show up normally, and they use the current forum ID in all forums.
It's only displaying in the first available public forum, which you can only notice by the navigation links (the same way it does with regular URLs when the global announce would be posted in a private forum).
And for sure this does not affect the fact that regular topics won't show up for people not having enough authorisations.
Actually, the only thing I noticed (I of course can miss something but it's pretty straigh forward) is about post :
| Code: | if (!$post_id)
{
$sql_array['WHERE'] = "t.topic_id = $topic_id";
}
else
{
$sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id" . ((!$auth->acl_get('m_approve', $forum_id)) ? ' AND p.post_approved = 1' : '');
$sql_array['FROM'][POSTS_TABLE] = 'p';
} |
At this stage, if the forum id is not provided in the url, the auth check will always return false since the code handling no forum id the case is just bellow in the file :
| Code: | if (!$forum_id)
{
// If it is a global announcement make sure to set the forum id to a postable forum
$sql_array['WHERE'] .= ' OR (t.topic_type = ' . POST_GLOBAL . '
AND f.forum_type = ' . FORUM_POST . ')';
}
else
{
$sql_array['WHERE'] .= ' OR (t.topic_type = ' . POST_GLOBAL . "
AND f.forum_id = $forum_id)";
} |
What is strange, is this code really seems to be there to handle the no forum id case, with a special note for global announcements.
So all together this really seems to mean that only post could be affected in some ways, but again, I'm not convinced it could. It really looks like the only side effect is to select a bit less posts than the topic should output (approved and not approved if any), but since this check is performed later, I'm not sure it would even mess up.
It should not even cause any pagination bug, since the total amount of posts is performed at a stage where the forum id is always known.
In the end, this means more investigation is required.
Could you try, after you deactivated the zero duplicate, to add :
Right after :
| Code: | function url_rewrite($url, $is_amp = TRUE ) {
global $phpEx, $user; |
in phpbb_seo_class.php.
This will fully deactivate all the rewriting, just try again to see what's happening, if announces do not displays correctly, it won't be linked to the mod rewrite. |
_________________
|
|
| Back to top |
|
 |
arch stanton PR1

Joined: 04 Oct 2006 Posts: 113
|
Posted: Wed Aug 15, 2007 6:50 pm Post subject: Re: Can zero dupe affect Global Announcements? |
|
|
| Will do, but it will have to be in a few days' time as I'm going away. |
|
|
| Back to top |
|
 |
arch stanton PR1

Joined: 04 Oct 2006 Posts: 113
|
Posted: Sun Sep 02, 2007 11:18 pm Post subject: Re: Can zero dupe affect Global Announcements? |
|
|
This is really weird but...
I have upgraded my live board to RC5 and have installed the latest versions of all the SEO mods from scratch, tested the files on a test board and the global announces worked perfectly.
I then copied these files to the live forum, made a new .htaccess etc and... the problem is STILL there!
I just don't get it. These are freshly modified RC5 files (which work perfectly on the test board) and the database update has been done - so this has to be some problem in my database??
Edit: oh dear, more problems.
When I try to activate zero dupe in the phpbb_seo control panel, I get the following error message:
[phpBB Debug] PHP Notice: in file /phpbb_seo/phpbb_seo_class.php on line 496: fopen(/phpbb_seo/cache/phpbb_cache.php) [function.fopen]: failed to open stream: Permission denied
[phpBB Debug] PHP Notice: in file /phpbb_seo/phpbb_seo_class.php on line 497: fputs(): supplied argument is not a valid stream resource
[phpBB Debug] PHP Notice: in file /phpbb_seo/phpbb_seo_class.php on line 498: fclose(): supplied argument is not a valid stream resource
[phpBB Debug] PHP Notice: in file /phpbb_seo/phpbb_seo_class.php on line 501: chmod() [function.chmod]: Operation not permitted
Warning: Cannot modify header information - headers already sent by (output started at /home/paul/domains/gladtalk.co.uk/public_html/forum/includes/functions.php:3751) in /home/paul/domains/gladtalk.co.uk/public_html/forum/includes/functions.php on line 4245
Warning: Cannot modify header information - headers already sent by (output started at /home/paul/domains/gladtalk.co.uk/public_html/forum/includes/functions.php:3751) in /home/paul/domains/gladtalk.co.uk/public_html/forum/includes/functions.php on line 4247
Warning: Cannot modify header information - headers already sent by (output started at /home/paul/domains/gladtalk.co.uk/public_html/forum/includes/functions.php:3751) in /home/paul/domains/gladtalk.co.uk/public_html/forum/includes/functions.php on line 4248
Warning: Cannot modify header information - headers already sent by (output started at /home/paul/domains/gladtalk.co.uk/public_html/forum/includes/functions.php:3751) in /home/paul/domains/gladtalk.co.uk/public_html/forum/includes/functions.php on line 4249
I think I'd better restore my database and old files for now.  |
|
|
| Back to top |
|
 |
arch stanton PR1

Joined: 04 Oct 2006 Posts: 113
|
Posted: Mon Sep 03, 2007 5:03 pm Post subject: Re: Can zero dupe affect Global Announcements? |
|
|
Sorry to bump, but I have now imported a copy of my live board's database into the test board (the one where everything was working perfectly, including the global announcement) and guess what? The same problem reproduces itself.
So clearly there is something in the database or the way I've set the board up. I'm still baffled as to what could be causing this.
However, at least the phpbb-seo control panel works in there, so maybe the error messages were because I had uploaded the includes/functions.php before trying to use it - would that have caused that particular problem?
Finally, I have also tried this test board with the above database and a plain vanilla (i.e. unmodified) set of phpBB files and then the Global Announcements does work properly.  |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
arch stanton PR1

Joined: 04 Oct 2006 Posts: 113
|
Posted: Tue Sep 04, 2007 11:55 am Post subject: Re: Can zero dupe affect Global Announcements? |
|
|
I think we may be getting somewhere.
In the test board's ACP, I went into Forum Administration and noticed a mouseover of the forums gave links like this:
adm/index.php?i=forums&sid=08315580822d28c70e80674a5ff34f2c&mode=manage&parent_id=53
I noticed that my mods' forum had parent_id=53
Other forums were 54,55,56, 57 etc. I wondered if the fact that the mods' forum had the lowest parent_id number was causing global announcements to default to there.
So I deleted the mods' forum (this is just my test board after all) and the problem was gone. I then set up a new mods forum with the same permissions, which now had the parent_id=63. Still the Global Announcements show correctly. So this parent_id number seems to be the problem.
By the way, dcz, what would have caused the error messages in phpbb_seo_class.php above? Could it be caused by copying the includes/functions.php across with the other files before trying to set zero-dupe in seo_class.php? If not, what else might have caused it? Obviously, I can't update my live forum until I know what is causing this error. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
arch stanton PR1

Joined: 04 Oct 2006 Posts: 113
|
Posted: Wed Sep 05, 2007 1:37 pm Post subject: Re: Can zero dupe affect Global Announcements? |
|
|
| dcz wrote: | | About the errors in phpbb_seo_class.php, it looks like it's because you did not CHMOD the phpbb_seo/cache/ folder to 0777. |
I did change it to 0777, after it was initially at 0755, and the error persisted. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
|
|