URL SEO in mod similar topic

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

Moderator: Moderators

URL SEO in mod similar topic

Postby PDD_20 » Mon Sep 01, 2008 11:07 am

Hi, I have this code but I dont get URL SEO, I dont know :S

Code: Select all
$sql= 'SELECT f.forum_id, f.forum_name, t.topic_id, t.topic_title, u.user_id, u.username, u.user_colour
   FROM ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . FORUMS_TABLE . " f
   WHERE MATCH (t.topic_title) AGAINST ('" . $db->sql_escape($topic_data['topic_title']) . "' IN BOOLEAN MODE)
   AND f.forum_id = t.forum_id
   AND u.user_id = t.topic_poster
   AND t.topic_id <> " . (int) $topic_data['topic_id'] . '
   GROUP BY t.topic_id';

if ($result = $db->sql_query_limit($sql, 5))
{
   while($similar = $db->sql_fetchrow($result))
   {
      if ($auth->acl_get('f_list', $similar['forum_id']))
      {
         $similar_forum_url = append_sid('viewforum.php?f='.$similar['forum_id']);
         $similar_topic_url = append_sid('viewtopic.php?f='.$similar['forum_id'].'&amp;t='.$similar['topic_id']);
         $similar_user = '<a style="color: #' .$similar['user_colour']. ';" href="' .append_sid('memberlist.php?mode=viewprofile&amp;u='.$similar['user_id']). '">' .$similar['username']. '</a>';
         
         $template->assign_block_vars('similar', array(
            'TOPIC_TITLE' => $similar['topic_title'],
            'U_TOPIC' => $similar_topic_url,
            'USER' =>  $similar_user,
            'U_FORUM' => $similar_forum_url,
            'FORUM' => $similar['forum_name'])
          );
      }
   }
}


Can you help me?

Thanks!!!
PDD_20
PR1
PR1
 
Posts: 136
Joined: Fri May 23, 2008 4:42 pm
Location: Spain

Advertisement

Postby dcz » Sat Sep 06, 2008 8:13 am

Try adding :
Code: Select all
t.topic_type,   ' . (!empty($phpbb_seo->seo_opt['sql_rewrite']) ? ', t.topic_url' : '') . '


after (in the same line) :
Code: Select all
t.topic_title,

and then add :
Code: Select all
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   $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


after :

Code: Select all
   while($similar = $db->sql_fetchrow($result))
   {
      if ($auth->acl_get('f_list', $similar['forum_id']))
      {


;)

[EDIT] Post edited for the ultimate SEO url mod
Last edited by dcz on Sat Sep 06, 2008 1:59 pm, edited 1 time 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: 21379
Joined: Fri Apr 28, 2006 9:03 pm

Postby PDD_20 » Sat Sep 06, 2008 10:29 am

Sorry but It show non URL SEO :S

Thanks
PDD_20
PR1
PR1
 
Posts: 136
Joined: Fri May 23, 2008 4:42 pm
Location: Spain

Postby dcz » Sat Sep 06, 2008 1:59 pm

I edited my post, I had left some $topic_id from the viewtopic code I was pasting from.

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

Postby PDD_20 » Sat Sep 06, 2008 2:08 pm

Yes, now It is correct!!!!!!! Thanksssssssss!!!!!!!!!!!

You are the best xD

Bye and thanks
PDD_20
PR1
PR1
 
Posts: 136
Joined: Fri May 23, 2008 4:42 pm
Location: Spain

Postby Professional » Sun Oct 19, 2008 7:29 am

can anyone plz say which similar topic mod did u use?
انجمن تخصصی نسل جدید موبایل ها-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

Postby PDD_20 » Sun Oct 19, 2008 10:17 am

PDD_20
PR1
PR1
 
Posts: 136
Joined: Fri May 23, 2008 4:42 pm
Location: Spain

Postby Professional » Tue Oct 21, 2008 4:59 pm

tnx i'll try it :lol:

but i use sub silver3 style :(
this cod is for prosilver style:

Open: styles/prosilver/template/viewtopic_body.html

find:
Code: Select all
<!-- INCLUDE jumpbox.html -->


Add before

Code: Select all
<div class="forumbg" style="width: 800px; margin:0 auto">
   <span class="corners-top"><span></span></span>
   <div style="color: #FFFFFF; height: 20px;"><b>{L_SIMILAR_TOPICS}</b></div>

   <table border="0" class="bg1">
   <!-- BEGIN similar -->
   <tr>
   <td width="400"><a class="topictitle" href="{similar.U_TOPIC}">{similar.TOPIC_TITLE}</a></td>
   <td width="300"><a class="topictitle" href="{similar.U_FORUM}">{similar.FORUM}</a></td>
   <td width="100">{similar.USER}</td>
   </tr>
   <!-- END similar -->   
   </table>   
   <span class="corners-bottom"><span></span></span>
</div>


can anyone help me to do this for sub silver2 style?

and another question plz answe admins,does this mod will effect at indexing?
انجمن تخصصی نسل جدید موبایل ها-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

Postby globetrotting » Wed Oct 22, 2008 10:27 pm

Hi,

is this topic and patch concerning http://www.phpbb.com/community/viewtopi ... 0&t=556125 ?
globetrotting
 
Posts: 17
Joined: Mon Apr 14, 2008 9:24 pm

Postby Professional » Thu Oct 23, 2008 5:01 am

yes tnx i asked here:
http://www.phpbb.com/community/viewtopi ... 5#p7459365

another question.
the phpbb-seo stufs don't have plan to write similar topic? :oops:
if yes i'll wait for it
انجمن تخصصی نسل جدید موبایل ها-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

Postby dcz » Sun Oct 26, 2008 12:13 pm

We do, but you can install another one already patched and then install ours when it gets released ;)

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

Postby Professional » Sun Oct 26, 2008 5:15 pm

dcz wrote:We do, but you can install another one already patched and then install ours when it gets released ;)

++


sure tnx :wink:
انجمن تخصصی نسل جدید موبایل ها-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

Postby Horizon70s » Wed Jan 28, 2009 7:08 pm

I am using Mod_similar_topics_0_1_2 and I made the changes above so the end of my viewtopic.php now looks like this:

Code: Select all
$sql= 'SELECT f.forum_id, f.forum_name, t.topic_id, t.topic_title, t.topic_type, u.user_id, u.username, u.user_colour
   FROM ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . FORUMS_TABLE . " f
   WHERE MATCH (t.topic_title) AGAINST ('" . $db->sql_escape($topic_data['topic_title']) . "' IN BOOLEAN MODE)
   AND f.forum_id = t.forum_id
   AND u.user_id = t.topic_poster
   AND t.topic_id <> " . (int) $topic_data['topic_id'] . '
   GROUP BY t.topic_id';

if ($result = $db->sql_query_limit($sql, 5))
{
   while($similar = $db->sql_fetchrow($result))
   {
      if ($auth->acl_get('f_list', $similar['forum_id']))
      {
         // www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( empty($phpbb_seo->seo_url['topic'][$similar['topic_id']]) ) {
   if ($similar['topic_type'] == POST_GLOBAL) {
      $phpbb_seo->seo_opt['topic_type'][$similar['topic_id']] = POST_GLOBAL;
   }
   $phpbb_seo->seo_url['topic'][$similar['topic_id']] = $phpbb_seo->format_url($similar['topic_title']);
}
if ( empty($phpbb_seo->seo_url['forum'][$similar['forum_id']]) ) {
   $phpbb_seo->seo_url['forum'][$similar['forum_id']] = $phpbb_seo->set_url($similar['forum_name'], $similar['forum_id'], $phpbb_seo->seo_static['forum']);
}
// www.phpBB-SEO.com SEO TOOLKIT END

         $similar_forum_url = append_sid('viewforum.php?f='.$similar['forum_id']);
         $similar_topic_url = append_sid('viewtopic.php?f='.$similar['forum_id'].'&amp;t='.$similar['topic_id']);
      
         
         $template->assign_block_vars('similar', array(
            'TOPIC_TITLE' => $similar['topic_title'],
            'U_TOPIC' => $similar_topic_url,
            'USER' =>  $similar_user,
            'U_FORUM' => $similar_forum_url,
            'FORUM' => $similar['forum_name'])
          );
      }
   }
}


The similar links are still the original way, "viewtopic.php?=####"

Am I missing another step?
Horizon70s
 
Posts: 32
Joined: Wed Jan 21, 2009 4:06 pm

Postby SeO » Thu Jan 29, 2009 10:03 am

Well it should work. How about your other urls, are they rewritten ok ?
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Postby Horizon70s » Thu Jan 29, 2009 6:55 pm

SeO wrote:Well it should work. How about your other urls, are they rewritten ok ?


Here is my .htaccess posted on another issue:

http://www.phpbb-seo.com/boards/simple- ... html#23879
Horizon70s
 
Posts: 32
Joined: Wed Jan 21, 2009 4:06 pm

Next

Return to phpBB mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: ADmantX [Bot], Google Adsense [Bot] and 11 guests