| |
|
| :: |
| Author |
Message |
mikey67
Joined: 26 Oct 2006 Posts: 6
|
Posted: Thu Oct 26, 2006 12:59 pm Post subject: Topic notification double url problem |
|
|
Hi I am testing your advanced and middel version url rewrite for phpbb and is good, but I see that both have problem.
If a member asks to be notified of a post *watch topic* then the url sent by phpbb is
viewtopic.php?p=12#12
and not the rewrite
This is problem and could lead to double content
Thank you for time and responses |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14403
|
|
| Back to top |
|
 |
mreider phpBB SEO Team

Joined: 07 May 2006 Posts: 219
|
Posted: Sun Nov 05, 2006 5:11 pm Post subject: Re: Topic notification double url problem |
|
|
| Is it a relatively simple thing to do, to get it to show the proper URL? |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14403
|
Posted: Mon Nov 06, 2006 10:50 am Post subject: Re: Topic notification double url problem |
|
|
All right, this is rather simple, here it goes :
Open :
| Code: | | includes/functions_post.php |
Find :
| Code: | | $topic_title = (count($orig_word)) ? preg_replace($orig_word, $replacement_word, unprepare_message($topic_title)) : unprepare_message($topic_title); |
After add :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
$topic_title = (count($orig_word)) ? preg_replace($orig_word, $replacement_word, unprepare_message($topic_title)) : unprepare_message($topic_title);
$paginated = $board_config['posts_per_page'];
$pages = ceil($post_data['topic_replies'] / $paginated);
$topic_url = $server_protocol . $server_name . $server_port . ( (trim($board_config['script_path'], "/") != '/') ? trim($board_config['script_path'], "/") : '' ) . '/' . format_url($topic_title) . '-vt' . $topic_id .( ($pages > 1) ? '-' . $paginated * ($pages -1) : '') . '.html' . '#' . $post_id;
// www.phpBB-SEO.com SEO TOOLKIT END |
Find :
| Code: | 'U_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . "=$post_id#$post_id",
|
Replace with :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
//'U_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . "=$post_id#$post_id",
'U_TOPIC' => $topic_url,
// www.phpBB-SEO.com SEO TOOLKIT END |
Open :
Find :
| Code: | $sql = "SELECT f.*, t.topic_status, t.topic_title, t.topic_type
FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t
WHERE t.topic_id = $topic_id
AND f.forum_id = t.forum_id"; |
Replace with :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
$sql = "SELECT f.*, t.topic_status, t.topic_title, t.topic_replies, t.topic_type
FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t
WHERE t.topic_id = $topic_id
AND f.forum_id = t.forum_id";
// www.phpBB-SEO.com SEO TOOLKIT END |
Find :
| Code: | | $select_sql = (!$submit) ? ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid' : ''; |
Replace With :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
$select_sql = (!$submit) ? ', t.topic_title, t.topic_replies, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid' : '';
// www.phpBB-SEO.com SEO TOOLKIT END |
Find :
| Code: | if ( $result = $db->sql_query($sql) )
{
$post_info = $db->sql_fetchrow($result);
$db->sql_freeresult($result); |
After add :
Note that these code changes are meant for the phpBB SEO advanced mod rewrite.
If you want to do this for the mixed or the simple one, you'll need to replace :
| Code: | | format_url($topic_title) . '-vt' |
With :
In the suggested code changes.
++ |
_________________ 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
Last edited by dcz on Sat Dec 16, 2006 1:02 am; edited 4 times in total |
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14403
|
Posted: Mon Nov 06, 2006 9:11 pm Post subject: Re: Topic notification double url problem |
|
|
Small mystake, forgot the topic_id on its way, so it's fixed now
| Code: | | $topic_url = $server_protocol . $server_name . $server_port . ( (trim($board_config['script_path'], "/") != '/') ? trim($board_config['script_path'], "/") : '' ) . '/' . format_url($topic_title) . '-vt' . $topic_id .( ($pages > 1) ? '-' . $paginated * ($pages -1) : '') . '.html' . '#' . $post_id; |
|
_________________ 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 |
|
 |
mreider phpBB SEO Team

Joined: 07 May 2006 Posts: 219
|
Posted: Tue Nov 07, 2006 12:28 am Post subject: Re: Topic notification double url problem |
|
|
One thing I noticed in your code:
WHen you put the find:
| Code: | | $sql = "SELECT f.*, t.topic_status, t.topic_title, t.topic_type |
in posting.php it should be:
find:
| Code: | $sql = "SELECT f.*, t.topic_status, t.topic_title, t.topic_type
FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t
WHERE t.topic_id = $topic_id
AND f.forum_id = t.forum_id"; |
Otherwise you leave those extra sql querues and get an error in posting.php Seems to be working otherwise! |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14403
|
|
| Back to top |
|
 |
mikey67
Joined: 26 Oct 2006 Posts: 6
|
Posted: Tue Nov 14, 2006 3:07 am Post subject: Re: Topic notification double url problem |
|
|
| thanks works |
|
|
| Back to top |
|
 |
mikey672
Joined: 15 Dec 2006 Posts: 24
|
Posted: Fri Dec 15, 2006 11:41 pm Post subject: Re: Topic notification double url problem |
|
|
i think this is what is causing my posting problem.
i can not edit or delete posts
it says
There is no such post. Please return and try again.
this is last thing done and all was working i am sure before |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14403
|
|
| Back to top |
|
 |
mikey672
Joined: 15 Dec 2006 Posts: 24
|
Posted: Sat Dec 16, 2006 12:03 am Post subject: Re: Topic notification double url problem |
|
|
dcz no this is worse
i can not now edit or delete any posts |
|
|
| Back to top |
|
 |
mikey672
Joined: 15 Dec 2006 Posts: 24
|
Posted: Sat Dec 16, 2006 1:00 am Post subject: Re: Topic notification double url problem |
|
|
dcz i think problem is here
you say find
$select_sql = (!$submit) ? ', t.topic_title, t.topic_url, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid' : '';
this is not the phpbb standard it is
$select_sql = (!$submit) ? ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid' : '';
do i need this t.topi_url ??? it seems to work without it |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14403
|
|
| Back to top |
|
 |
mikey672
Joined: 15 Dec 2006 Posts: 24
|
Posted: Sat Dec 16, 2006 1:08 am Post subject: Re: Topic notification double url problem |
|
|
| good i will do testing now and report status |
|
|
| Back to top |
|
 |
lavinya PR1


Joined: 24 Jul 2006 Posts: 159 Location: Turkey
|
Posted: Sat Feb 10, 2007 3:59 pm Post subject: Re: Topic notification double url problem |
|
|
phpBB SEO Advanced mod Rewrite 0.2.2
phpBB SEO Zero duplicate - phpBB SEO Advanced mod Rewrite version 0.2.2
compatible?
and above which code add? |
|
|
| Back to top |
|
 |
|
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|