Topic notification double url problem

Discussions and support about the different URL Rewriting techniques for phpBB2.

Moderator: Moderators

Topic notification double url problem

Postby mikey67 » Thu Oct 26, 2006 12:59 pm

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
mikey67
 
Posts: 6
Joined: Thu Oct 26, 2006 12:35 pm

Advertisement

Postby dcz » Thu Oct 26, 2006 2:31 pm

And welcome :D

Actually, if you have installed the robots.txt as suggested, this won't be the case, but this is only for before the public release of the zero dupe ;)

Anyway, this particular feature could be added in the next update, as a cosmetic one since it's not really a SEO threat.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby mreider » Sun Nov 05, 2006 5:11 pm

Is it a relatively simple thing to do, to get it to show the proper URL?
mreider
phpBB SEO Team
phpBB SEO Team
 
Posts: 292
Joined: Sun May 07, 2006 3:11 pm

Postby dcz » Mon Nov 06, 2006 10:50 am

All right, this is rather simple, here it goes :

Open :

Code: Select all
includes/functions_post.php


Find :

Code: Select all
               $topic_title = (count($orig_word)) ? preg_replace($orig_word, $replacement_word, unprepare_message($topic_title)) : unprepare_message($topic_title);


After add :

Code: Select all
               // 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: Select all
                     'U_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . "=$post_id#$post_id",

Replace with :

Code: Select all
                     // 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 :

Code: Select all
posting.php


Find :

Code: Select all
$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: Select all
      // 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 all
      $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: Select all
      // 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: Select all
if ( $result = $db->sql_query($sql) )
{
   $post_info = $db->sql_fetchrow($result);
   $db->sql_freeresult($result);


After add :
Code: Select all
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   $post_data['topic_replies'] = $post_info['topic_replies'];
      // www.phpBB-SEO.com SEO TOOLKIT END


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: Select all
format_url($topic_title)  . '-vt'


With :

Code: Select all
'topic'


In the suggested code changes.

;)

++
Last edited by dcz on Sat Dec 16, 2006 1:02 am, edited 4 times in total.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby dcz » Mon Nov 06, 2006 9:11 pm

Small mystake, forgot the topic_id on its way, so it's fixed now :D

Code: Select all
               $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 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby mreider » Tue Nov 07, 2006 12:28 am

One thing I noticed in your code:

WHen you put the find:
Code: Select all
$sql = "SELECT f.*, t.topic_status, t.topic_title, t.topic_type


in posting.php it should be:

find:
Code: Select all
$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!
mreider
phpBB SEO Team
phpBB SEO Team
 
Posts: 292
Joined: Sun May 07, 2006 3:11 pm

Postby dcz » Tue Nov 07, 2006 1:08 am

You're right, I am so stubborn some times :lol:
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby mikey67 » Tue Nov 14, 2006 3:07 am

thanks works
mikey67
 
Posts: 6
Joined: Thu Oct 26, 2006 12:35 pm

Postby mikey672 » Fri Dec 15, 2006 11:41 pm

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
mikey672
 
Posts: 24
Joined: Fri Dec 15, 2006 7:55 am

Postby dcz » Fri Dec 15, 2006 11:49 pm

Yes, it's beta and there is still a small pagination bug, but it only concerns the links sent by the notification under some circumstances, you can still browse the topic and go to the last post.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby mikey672 » Sat Dec 16, 2006 12:03 am

dcz no this is worse

i can not now edit or delete any posts
mikey672
 
Posts: 24
Joined: Fri Dec 15, 2006 7:55 am

Postby mikey672 » Sat Dec 16, 2006 1:00 am

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
mikey672
 
Posts: 24
Joined: Fri Dec 15, 2006 7:55 am

Postby dcz » Sat Dec 16, 2006 1:02 am

You're right my fault.

Post edited.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby mikey672 » Sat Dec 16, 2006 1:08 am

good i will do testing now and report status
mikey672
 
Posts: 24
Joined: Fri Dec 15, 2006 7:55 am

Postby lavinya » Sat Feb 10, 2007 3:59 pm

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?
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey


Return to phpBB2 mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests