[SEO URL] Similar topic

phpBB SEO mods by phpBB SEO.

Moderator: Moderators

[SEO URL] Similar topic

Postby dcz » Thu Jun 18, 2009 3:52 pm

Hello,
here is a thread to tweak the Similar topic mod from here : http://www.phpbb-seo.de/downloads/mod-s ... opics.html

The goal is to output rewritten URLs with the Ultimate SEO URL mod (all modes).

Please note :
phpBB SEO Related Topics has been released, you may want to use it in favor to this mod since it has many more options and abilities than this one.

Open :
Code: Select all
viewtopic.php

Find :
Code: Select all
   'SELECT'   => 'f.forum_id, f.forum_name, t.topic_id, t.topic_title, u.user_id, u.username, u.user_colour, t.topic_replies',

Replace with :
Code: Select all
   'SELECT'   => 'f.forum_id, f.forum_name, t.topic_id, t.topic_title, t.topic_type ' . (!empty($phpbb_seo->seo_opt['sql_rewrite']) ? ', t.topic_url' : '') . ', u.user_id, u.username, u.user_colour, t.topic_replies',

Find :
Code: Select all
      if ($auth->acl_get('f_read', $similar['forum_id']))
      {

After add :
Code: Select all
         // www.phpBB-SEO.com SEO TOOLKIT BEGIN
         $similar['topic_title'] = censor_text($similar['topic_title']);
         $phpbb_seo->set_url($similar['forum_name'], $similar['forum_id'], $phpbb_seo->seo_static['forum']);
         $phpbb_seo->prepare_iurl($similar, 'topic', $similar['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$similar['forum_id']]);
         // www.phpBB-SEO.com SEO TOOLKIT END


Enjoy ;)
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: 21376
Joined: Fri Apr 28, 2006 9:03 pm

Advertisement

Re: [SEO URL] Similar topic

Postby CheapCars » Fri Jun 19, 2009 3:05 am

Thanks dcz for sharing it, I was looking for how to do that. :D I have just a quick question. What's the different between the source code you are giving and the files included in mod_similar-topics_1_0_2.zip? To set the Similar Topic in my forum Do I have to install the files in the Zip or I have to do the modifications you're explain? Thanks in advance and sorry for my ignorance, I have never installed a mod.
User avatar
CheapCars
 
Posts: 23
Joined: Thu Jun 11, 2009 3:37 am
Location: USA

Re: [SEO URL] Similar topic

Postby dcz » Fri Jun 19, 2009 6:46 am

To use this piece of code, install the similar topic mod, then apply the patch and voilà ;)

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

Re: [SEO URL] Similar topic

Postby CheapCars » Fri Jun 19, 2009 7:14 am

Sorry for my ignorance dcz, but, how to install this mod? What should I do with this two files included in mod_similar-topics_1_0_2.zip
: install.xml and modx.prosilver.en.xsl Where I have to put them? I'm lost. :?

I was reading the install instructions of http://www.phpbb-seo.de/downloads/mod-s ... opics.html, but there it says that mod is for phpBB 3.0.4... also I was looking in view_topic.php this piece of code you gave:

Code: Select all
   'SELECT'   => 'f.forum_id, f.forum_name, t.topic_id, t.topic_title, u.user_id, u.username, u.user_colour, t.topic_replies',....


But I didn't find it.. :? I'm using phpBB 3.0.5

Thanks for any help.
User avatar
CheapCars
 
Posts: 23
Joined: Thu Jun 11, 2009 3:37 am
Location: USA

Re: [SEO URL] Similar topic

Postby dcz » Fri Jun 19, 2009 7:23 am

It's a mod to install, just unzip it and drop the install.xml file in you browser's window, you'll see install instructions.

The mod works with 3.0.5 ;)

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

Re: [SEO URL] Similar topic

Postby CheapCars » Fri Jun 19, 2009 4:36 pm

Thanks dcz, but, after 3 times trying, definetly I couldn't do it. :cry:

SQL ERROR [ mysql4 ]
Unknown table 'f' in field list [1109]


The install mode says:

Code: Select all
SQL
ALTER TABLE `phpbb_topics` ADD FULLTEXT (`topic_title`);

What is this for? Should I run this code firstable in the MysqlAdmin editor?


The install mode says:
Code: Select all
Open: viewtopic.php
Find:
page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title']);

There isn't such sentence in my viewtopic.php file (phpBB-SEO 3.0.5). The most similar I found is this one. "page_header" is just once:

Code: Select all
page_header($topic_data['topic_title'] . ' : ' .  $topic_data['forum_name'] . $extra_title);


The install mode says:
Code: Select all
Open: language/en/common.php
Find:
'YOU_NO_NEW_PM'      => 'No new private messages are waiting for you.',

This is fine. There isn't problem with it.

The install mode says:
Code: Select all
Open: styles/prosilver/template/viewtopic_body.html
Find:
<!-- INCLUDE jumpbox.html -->

This is fine as well. No Problem.

Now you said I need to apply a patch in order to this works...

You said:

Code: Select all
Open :  viewtopic.php
Find :
'SELECT'   => 'f.forum_id, f.forum_name, t.topic_id, t.topic_title, u.user_id, u.username, u.user_colour, t.topic_replies',

I couldn't find that line in my viewtopic.php file. f.forum is just two times, but any of them is similar to that sentence. This is what I have:

Code: Select all
$sql_array['WHERE'] .= ' AND (f.forum_id = t.forum_id';

Code: Select all
AND f.forum_id = $forum_id)";

The other part is OK. :?

Is you can give a last advice I would appreciate. If you can't I understand very well that isn't easy sometimes to understand the explanations of why things are not working.

:?:
User avatar
CheapCars
 
Posts: 23
Joined: Thu Jun 11, 2009 3:37 am
Location: USA

Re: [SEO URL] Similar topic

Postby Professional » Sat Jun 20, 2009 5:20 am

do u suggest using that?
انجمن تخصصی نسل جدید موبایل ها-Apple Portal
My Handwritings: Professional Dreams
Every Thing That U Feel,Is Every Thing That I Feel.
User avatar
Professional
PR5
PR5
 
Posts: 550
Joined: Mon Apr 07, 2008 5:41 am
Location: 1/2 of the World

Re: [SEO URL] Similar topic

Postby dcz » Sat Jun 20, 2009 9:36 am

The mods actually ask you to find the original :
Code: Select all
page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title']);


In viewtopic.php, which was indeed modified by our optimal title mod, but it's not a problem, add the required code after the modified :
Code: Select all
page_header(..

line, and it start with :
Code: Select all
// Begin similar topics
$sql_array = array(
   'SELECT'   => 'f.forum_id, f.forum_name, t.topic_id, t.topic_title, u.user_id, u.username, u.user_colour, t.topic_replies',

   'FROM'      => array(
      TOPICS_TABLE   => 't',
   ),

   'LEFT_JOIN'   => array(
      array(
         'FROM'   =>   array(USERS_TABLE   => 'u'),
         'ON'   => 'u.user_id = t.topic_poster'
   ),
      array(
         'FROM'   =>   array(FORUMS_TABLE   => 'f'),
         'ON'   => 'f.forum_id = t.forum_id'
      ),
   ),

   'WHERE'      => "MATCH (t.topic_title) AGAINST ('" . $db->sql_escape($topic_data['topic_title']) . "' ) >= 0.5
      AND t.topic_status <> " . ITEM_MOVED . '
      AND t.topic_id <> ' . (int) $topic_data['topic_id'],

   'GROUP_BY'   => 't.topic_id',

   'ORDER_BY'   => 't.topic_last_post_time DESC',
);

Which include the above mentioned code to replace for the ultimate SEO URL mod.

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

Re: [SEO URL] Similar topic

Postby lizard78 » Sun Jun 21, 2009 2:35 am

Thanks for the mod. But I have problems to install this mod, too. I get this error after install:

Fatal error: Call to undefined method: phpbb_seo->prepare_iurl() in /home/www/doc/1111/domain.com/www/forum/viewtopic.php on line 1740


In the line 1740 is this code:
Code: Select all
$phpbb_seo->prepare_iurl($similar, 'topic', $similar['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$similar['forum_id']]);


Can anybody help please?
lizard78
PR0
PR0
 
Posts: 51
Joined: Thu Apr 09, 2009 10:16 am

Re: [SEO URL] Similar topic

Postby dcz » Tue Jun 23, 2009 7:52 am

This is because you're not up to date yet, you need the Ultimate SEO url mod to use this tweak.

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

Re: [SEO URL] Similar topic

Postby lizard78 » Tue Jun 23, 2009 1:22 pm

I use phpBB SEO 3.0.4 with Simple Urls.
Isn't it possible to use the similar topics-mod with this version?

oh man, I will never get the similar topic-mod :?
lizard78
PR0
PR0
 
Posts: 51
Joined: Thu Apr 09, 2009 10:16 am

Re: [SEO URL] Similar topic

Postby dcz » Thu Jun 25, 2009 7:59 am

I don't think that you need any change to use this mod with the simple SEO url mod.

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

Re: [SEO URL] Similar topic

Postby pnenquiry » Fri Jun 26, 2009 6:15 pm

This is one awesome mod. Thanks so much
pnenquiry
 
Posts: 28
Joined: Tue Jun 09, 2009 1:38 pm

Re: [SEO URL] Similar topic

Postby AkrepKral » Fri Jun 26, 2009 9:58 pm

Thanks
AkrepKral
 
Posts: 3
Joined: Sun Jun 08, 2008 12:01 pm

Re: [SEO URL] Similar topic

Postby lizard78 » Sun Jun 28, 2009 6:57 pm

dcz wrote:I don't think that you need any change to use this mod with the simple SEO url mod.

++




Thanks for the mod. But I have problems to install this mod, too. I get this error after install:

Fatal error: Call to undefined method: phpbb_seo->prepare_iurl() in /home/www/doc/1111/domain.com/www/forum/viewtopic.php on line 1740


In the line 1740 is this code:
Code: Select all
$phpbb_seo->prepare_iurl($similar, 'topic', $similar['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$similar['forum_id']]);


Can anybody help please?
lizard78
PR0
PR0
 
Posts: 51
Joined: Thu Apr 09, 2009 10:16 am

Next

Return to phpBB SEO TooLKit

Who is online

Users browsing this forum: VoilaBot [Bot] and 7 guests