Watched Topics List URL rewrite

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

Moderator: Moderators

Watched Topics List URL rewrite

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

Is the Watched Topics List possible to be rewrite using seo advanced

http://www.phpbb.com/phpBB/viewtopic.php?t=100096
mikey67
 
Posts: 6
Joined: Thu Oct 26, 2006 12:35 pm

Advertisement

Postby dcz » Tue Nov 14, 2006 9:44 am

Here you go :

Open :

Code: Select all
watched_topics.php


Find :

Code: Select all
       for ( $i = 0; $i < count($watch_rows); $i++ )
        {


After add :

Code: Select all
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN
      $seo_forum_name = $watch_rows[$i]]['forum_name'];
      $seo_topic_name = $watch_rows[$i]['topic_title'];
      // www.phpBB-SEO.com SEO TOOLKIT END


You may as well want to activate the phpBB censoring on the mod, in case some topic titles went censored on the forum.

To do this, in the same file find :

Code: Select all
if ($watch_count > 0)
{     


After add :
Code: Select all
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   //
   // Define censored word matches
   //
   $orig_word = array();
   $replacement_word = array();
   obtain_word_list($orig_word, $replacement_word);
   // www.phpBB-SEO.com SEO TOOLKIT END


Find :
Code: Select all
   for ( $i = 0; $i < count($watch_rows); $i++ )
   {
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN


After add :
Code: Select all
      $watch_rows[$i]['topic_title'] = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $watch_rows[$i]['topic_title']) : $watch_rows[$i]['topic_title'];


Eg before the $seo_forum_name and $seo_topic_name statements.

++
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Re: Watched Topics List URL rewrite

Postby dr_somm » Thu Mar 05, 2009 1:35 pm

Do I have to use new code for 0.2.4? Because
Code: Select all
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN
      $seo_forum_name = $watch_rows[$i]]['forum_name'];
      $seo_topic_name = $watch_rows[$i]['topic_title'];
      // www.phpBB-SEO.com SEO TOOLKIT END
doesn't work.
dr_somm
 
Posts: 29
Joined: Sun Mar 01, 2009 9:27 pm

Re: Watched Topics List URL rewrite

Postby SeO » Sat Mar 07, 2009 11:38 am

It was meant for a very early version of our url rewriting mod.
Would now be :
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( !isset($phpbb_seo->seo_url['forum'][$watch_rows[$i]['forum_id']]) ) {
   $phpbb_seo->seo_url['forum'][$watch_rows[$i]['forum_id']] = $phpbb_seo->format_url($watch_rows[$i]['forum_name'], $phpbb_seo->seo_static['forum']);
}
if ( !isset($phpbb_seo->seo_url['topic'][$watch_rows[$i]['topic_id']) ) {
   $phpbb_seo->seo_url['topic'][$watch_rows[$i]['topic_id']] = $phpbb_seo->format_url($watch_rows[$i]['topic_title']);
}
// www.phpBB-SEO.com SEO TOOLKIT END


;)
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Re: Watched Topics List URL rewrite

Postby dr_somm » Sat Mar 07, 2009 5:54 pm

Thanks again! I know, you cannot take help with (approx.) 20 year old code for granted - great support, keep it up!
dr_somm
 
Posts: 29
Joined: Sun Mar 01, 2009 9:27 pm


Return to phpBB2 mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests


 
cron