[SEO URL] Similar topic

phpBB SEO mods by phpBB SEO.

Moderator: Moderators

Re: [SEO URL] Similar topic

Postby dcz » Fri Jul 03, 2009 8:05 am

This is because you're not using the Ultimate SEO url mod yet, so please update ;)
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: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Advertisement

Re: [SEO URL] Similar topic

Postby lizard78 » Fri Jul 03, 2009 9:44 am

dcz wrote:This is because you're not using the Ultimate SEO url mod yet, so please update ;)


I installes the phpBB SEO Mod with GYM. Where is there different to this mod? I don't want to install or update another thing... How can I use a Similar Topic Script with my phpBB SEO?
lizard78
PR0
PR0
 
Posts: 51
Joined: Thu Apr 09, 2009 10:16 am

Re: [SEO URL] Similar topic

Postby dcz » Fri Jul 03, 2009 9:49 am

Then, are you using 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: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: [SEO URL] Similar topic

Postby lizard78 » Fri Jul 03, 2009 9:59 am

no, 3.0.4
lizard78
PR0
PR0
 
Posts: 51
Joined: Thu Apr 09, 2009 10:16 am

Re: [SEO URL] Similar topic

Postby dcz » Fri Jul 03, 2009 10:03 am

Then it normal. You must update before you can use this tweak, but we did provide the code for similar topic and previous versions of our url rewriting mod, please try a quick search.
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: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: [SEO URL] Similar topic

Postby lizard78 » Fri Jul 03, 2009 10:07 am

I used the search many many many times but I did not find a Similar Topic Mod ;)

Perhaps I am not good in finding this Mod, can you give me a tipp where I can find it? ;-) Or a link plz
lizard78
PR0
PR0
 
Posts: 51
Joined: Thu Apr 09, 2009 10:16 am

Re: [SEO URL] Similar topic

Postby dcz » Fri Jul 03, 2009 10:10 am

URL SEO in mod similar topic
Was the second result searching "similar topic" with the embed google search ;)
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: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: [SEO URL] Similar topic

Postby lizard78 » Fri Jul 03, 2009 10:38 am

It doesn't works :?

First I installed this mod http://www.phpbb-seo.de/downloads/mod-s ... opics.html, then I changed some code ( URL SEO in mod similar topic )

And then there comes an error on my site after uploading files: Fatal error: Call to undefined method: phpbb_seo->prepare_iurl() in /home/www/doc/8531/domain.com/www/subs/forum/viewtopic.php on line 1742

Here is my viewtopic:

Code: Select all
// Output the page
// www.phpBB-SEO.com SEO TOOLKIT BEGIN - TITLE
$extra_title = ($start > 0) ? ' - ' . $user->lang['Page'] . ( floor( ($start / $config['posts_per_page']) ) + 1 ) : '';
page_header($topic_data['topic_title'] . $extra_title);
// www.phpBB-SEO.com SEO TOOLKIT END - TITLE


// Begin similar topics
$sql_array = array(
   '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',

   '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',
);
$sql = $db->sql_build_query('SELECT', $sql_array);
if ($result = $db->sql_query_limit($sql, 5))
{
   while($similar = $db->sql_fetchrow($result))
   {
      if ($auth->acl_get('f_read', $similar['forum_id']))
      {
      // 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
         $similar_forum_url   = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=" . $similar['forum_id']);
         $similar_topic_url   = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $similar['forum_id'] . '&amp;t=' . $similar['topic_id']);
         $similar_user      = get_username_string('full', $similar['user_id'], $similar['username'], $similar['user_colour'], $similar['username']);

         $template->assign_block_vars('similar', array(
            'TOPIC_TITLE'         => $similar['topic_title'],
            'U_TOPIC'            => $similar_topic_url,
            'REPLIES'            => $similar['topic_replies'],
            'USER'               => $similar_user,
            'U_FORUM'            => $similar_forum_url,
            'FORUM'               => $similar['forum_name'])
         );
      }
   }
}
// End Similar Topics
lizard78
PR0
PR0
 
Posts: 51
Joined: Thu Apr 09, 2009 10:16 am

Re: [SEO URL] Similar topic

Postby dcz » Wed Jul 08, 2009 3:04 pm

Ho sorry, the post was edited for Ultimate SEO url mod, so I guess that you now have one more reason to update your forum.

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

Re: [SEO URL] Similar topic

Postby pnenquiry » Fri Jul 17, 2009 2:29 pm

dcz, I am trying to display the Similar Topics like you have displayed in your site. With the background gif etc.

I am trying this code, but the the topics list turns up blanks. Can you please help? I use Coffee_time theme. Every thing looks good, except the Topics itself does not show up. Please help

Code: Select all
<div class="forumbg">
   <div class="inner"><span class="corners-top"><span></span></span>
   <ul class="topiclist">
      <li class="header">
         <dl class="icon">
            <dt>{L_SIMILAR_TOPICS}</dt>
      
            <dd class="Forum"><span>Forum</span></dd>
         </dl>
      </li>
   </ul>
   <ul class="topiclist topics">

         <li class="post bg1">
         <dl class="icon" style="background-image: url(./styles/coffee_time/imageset/topic_read.gif); background-repeat: no-repeat;">
            <dt >
               <a href="{similar.U_TOPIC}" class="topictitle" >{similar.TOPIC_TITLE}</a>
                              </dt>

            <dd class="Forum"><span>
               {L_FORUM}: <a href="{similar.U_FORUM}" >{similar.FORUM}</a>      </span>
            </dd>

         </dl>
      </li>
      </ul>
   <span class="corners-bottom"><span></span></span></div>
</div>
pnenquiry
 
Posts: 28
Joined: Tue Jun 09, 2009 1:38 pm

Re: [SEO URL] Similar topic

Postby dcz » Sat Jul 18, 2009 9:24 am

Hard to tell, is this code online somewhere ?
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: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: [SEO URL] Similar topic

Postby pnenquiry » Sat Jul 18, 2009 4:42 pm

This is not online yet as its not working. I have the one that comes with the MOD for similar topics. Can you please give me the viewtopic_body.html code for Simalar Topics thats on phpbb-seo.com/en Site please?
pnenquiry
 
Posts: 28
Joined: Tue Jun 09, 2009 1:38 pm

Re: [SEO URL] Similar topic

Postby elsinor » Thu Jul 23, 2009 9:27 am

Hi, can you dothe same for Advanced Similar Topics?

Code: Select all
<?php
/**
*
* @package phpBB3
* @version $Id: similar_topics.php,v 1.0.0 2008/10/23 01:10:26 Porutchik Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
*/
if (!defined('IN_PHPBB'))
{
   // This was an AJAX request
   define('IN_PHPBB', true);
   $phpbb_root_path = '../';
   $phpEx = substr(strrchr(__FILE__, '.'), 1);
   include($phpbb_root_path . 'common.' . $phpEx);
   include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

   // Start session management
   $user->session_begin();
   $auth->acl($user->data);
   $user->setup('posting');
   
   $topic_title = utf8_normalize_nfc(request_var('topic_title', '', true));
   if (empty($topic_title))
   {
      exit(0);
   }
   $topic_title = utf8_strtolower(utf8_htmlspecialchars($topic_title));
   $AJAXrequest = true;
   $min_amount_words = $config['similar_topics_min_amount_words_posting'];
}
else
{
   $topic_title = utf8_strtolower($topic_data['topic_title']);
   $topic_id = (int) $topic_data['topic_id'];
   $AJAXrequest = false;
   $min_amount_words = $config['similar_topics_min_amount_words_viewtopic'];
}

// Reduce multiple spaces to a single space.
$topic_title = trim(preg_replace('#\s+#', ' ', strip_tags($topic_title)));

if ( $config['similar_stopwords'] )
{
   // check against stopwords start
   if (file_exists("{$user->lang_path}/search_ignore_words.$phpEx"))
   {
      $stopword_list = array();
      // include the file containing ignore words
      include("{$user->lang_path}/search_ignore_words.$phpEx");
      $stopword_list = $words;
      unset($words);
      if ( !empty($stopword_list) )
      {
         // Remove words to be ignored
         $topic_title = ' ' . utf8_case_fold_nfc($topic_title) . ' ';
         foreach ($stopword_list as $stopword)
         {
            $topic_title = str_replace(' ' . trim($stopword) . ' ', ' ', $topic_title);
         }
         $topic_title = trim($topic_title);
         if (empty($topic_title))
         {
            exit(0);
         }
      }
   }
   // check against stopwords end
}
$check_words = (sizeof(explode(' ', $topic_title)) < $min_amount_words) ? false : true;
if (!$check_words && $AJAXrequest)
{
   exit(0);
}
else if (!$check_words && !$AJAXrequest)
{
   return;
}

if ( $config['similar_sort_type'] == 'time' )
{
   $sql_sort = 't.topic_last_post_time';
}
else
{
   $sql_sort = 'relevance';
}

if ( trim($config['similar_ignore_forums_ids']) != '' )
{
   $ignore_forums_ids = ' AND f.forum_id NOT IN (' . implode(',', array_map('intval', explode("\n", trim($config['similar_ignore_forums_ids'])))) . ')';
}
else
{
   $ignore_forums_ids = '';
}

$sql_match = "MATCH (t.topic_title) AGAINST ('" . $db->sql_escape($topic_title) . "' )";
$sql_min_relevance = (trim($config['similar_topics_min_relevance']) != '') ? ' >= ' . trim($config['similar_topics_min_relevance']) : '';

$sql_array = array(
   'SELECT'   => 'f.forum_id, f.forum_name, t.*, t.topic_type ' . (!empty($phpbb_seo->seo_opt['sql_rewrite']) ? ', t.topic_url' : '') . ', u.user_id, u.username, u.user_colour, ' . $sql_match . ' AS relevance',

   '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'      => $sql_match . $sql_min_relevance . '
      AND t.topic_status <> ' . ITEM_MOVED . $ignore_forums_ids . ((!$AJAXrequest) ? ' AND t.topic_id <> ' . $topic_id : ''),

   'GROUP_BY'   => 't.topic_id',

   'ORDER_BY'   => $sql_sort,
);

$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query_limit($sql, intval($config['similar_max_topics']));
$similar_topics = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);

$count_similar = sizeof($similar_topics);
if ( $count_similar )
{
   // Grab icons
   $icons = $cache->obtain_icons();

   if ($AJAXrequest)
   {
      // application/xhtml+xml not used because of IE
      @header('Content-type: text/html; charset=UTF-8');
      $template->assign_vars(array(
         'T_ICONS_PATH'   => "{$phpbb_root_path}{$config['icons_path']}/",
         'LAST_POST_IMG'   => $user->img('icon_topic_latest', 'VIEW_LATEST_POST')
      ));
   }
   $template->set_filenames(array(
      'similar_viewtopic' => 'similar_viewtopic.html')
   );
   $template->assign_vars(array(
      'LAST_POST_IMG'   => $user->img('icon_topic_latest', 'VIEW_LATEST_POST')
   ));

   $forums_auth = array();
   foreach ($similar_topics as $similar)
   {
      $similar_forum_id = $similar['forum_id'];
      if (!isset($forums_auth[$similar_forum_id]))
      {
         $forums_auth[$similar_forum_id]['f_list'] = $auth->acl_get('f_list', $similar_forum_id);
         
         $forums_auth[$similar_forum_id]['m_approve'] = $auth->acl_get('m_approve', $similar_forum_id);
         
      }
      if ($forums_auth[$similar_forum_id]['f_list'])
      {
         $similar_topic_id = $similar['topic_id'];
         $replies = ($forums_auth[$similar_forum_id]['m_approve']) ? $similar['topic_replies_real'] : $similar['topic_replies'];

         $folder_img = $folder_alt = $topic_type = '';
         topic_status($similar, $replies, false, $folder_img, $folder_alt, $topic_type);

         $similar_forum_url   = append_sid('viewforum.' . $phpEx, 'f=' . $similar_forum_id);
         $similar_topic_url   = append_sid('viewtopic.' . $phpEx, 'f=' . $similar_forum_id . '&amp;t=' . $similar_topic_id);
         $similar_user      = get_username_string('full', $similar['user_id'], $similar['username'], $similar['user_colour'], $similar['username']);
      
         
         $template->assign_block_vars('similar', array(
            'TOPIC_TITLE'         => censor_text($similar['topic_title']),
            'TOPIC_FOLDER_IMG'      => $user->img($folder_img, $folder_alt),
            'TOPIC_FOLDER_IMG_SRC'   => $user->img($folder_img, $folder_alt, false, '', 'src'),
            'TOPIC_ICON_IMG'      => (!empty($icons[$similar['icon_id']])) ? $icons[$similar['icon_id']]['img'] : '',
            'TOPIC_ICON_IMG_WIDTH'   => (!empty($icons[$similar['icon_id']])) ? $icons[$similar['icon_id']]['width'] : '',
            'TOPIC_ICON_IMG_HEIGHT'   => (!empty($icons[$similar['icon_id']])) ? $icons[$similar['icon_id']]['height'] : '',
            'TOPIC_REPLIES'         => $replies,
            'TOPIC_VIEWS'         => $similar['topic_views'],
            'TOPIC_AUTHOR'         => get_username_string('no_profile', $similar['user_id'], $similar['username'], $similar['user_colour']),
            'TOPIC_AUTHOR_FULL'      => $similar_user,
            'TOPIC_AUTHOR_COLOUR'   => get_username_string('colour', $similar['user_id'], $similar['username'], $similar['user_colour']),
            'FIRST_POST_TIME'      => $user->format_date($similar['topic_time']),
            'PAGINATION'         => topic_generate_pagination($replies, $similar_topic_url),
            'LAST_POST_AUTHOR'         => get_username_string('no_profile', $similar['topic_last_poster_id'], $similar['topic_last_poster_name'], $similar['topic_last_poster_colour']),
            'LAST_POST_AUTHOR_COLOUR'   => get_username_string('colour', $similar['topic_last_poster_id'], $similar['topic_last_poster_name'], $similar['topic_last_poster_colour']),
            'LAST_POST_AUTHOR_FULL'      => get_username_string('full', $similar['topic_last_poster_id'], $similar['topic_last_poster_name'], $similar['topic_last_poster_colour']),
            'LAST_POST_TIME'      => $user->format_date($similar['topic_last_post_time']),
            'FORUM_TITLE'         => $similar['forum_name'],
            'S_TOPIC_TYPE'         => $similar['topic_type'],
            'S_TOPIC_GLOBAL'      => (!$similar_forum_id) ? true : false,
            'U_VIEW_TOPIC'         => $similar_topic_url,
            'U_VIEW_FORUM'         => $similar_forum_url,
            'U_LAST_POST'         => append_sid('viewtopic.' . $phpEx, 'p=' . $similar['topic_last_post_id'] . '#p' . $similar['topic_last_post_id']),
            'U_LAST_POST_AUTHOR'   => append_sid(get_username_string('profile', $similar['topic_last_poster_id'], $similar['topic_last_poster_name'], $similar['topic_last_poster_colour'], false, 'memberlist.' . $phpEx . '?mode=viewprofile')),
            'U_TOPIC_AUTHOR'      => append_sid(get_username_string('profile', $similar['user_id'], $similar['username'], $similar['user_colour'], false, 'memberlist.' . $phpEx . '?mode=viewprofile')),
            )
         );
      }
   }
   if ($AJAXrequest)
   {
      $template->display('similar_viewtopic');
   }
}
?>
elsinor
 
Posts: 24
Joined: Sun May 10, 2009 2:47 pm

Re: [SEO URL] Similar topic

Postby dcz » Thu Jul 23, 2009 3:41 pm

Just 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

after :
Code: Select all
      if ($forums_auth[$similar_forum_id]['f_list'])
      {

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

Re: [SEO URL] Similar topic

Postby elsinor » Thu Jul 23, 2009 6:35 pm

I tried. Dont work.
elsinor
 
Posts: 24
Joined: Sun May 10, 2009 2:47 pm

PreviousNext

Return to phpBB SEO TooLKit

Who is online

Users browsing this forum: No registered users and 4 guests