recent topics - What the new hotfix 3.0.6 phpbb-SEO code

Support for the phpBB3 SEO mods released in the phpBB3 SEO Toolikt forum.

Moderator: Moderators

recent topics - What the new hotfix 3.0.6 phpbb-SEO code

Postby muhabbetim » Sat Feb 27, 2010 7:21 pm

Help me,
external page headline in the last 10
phpbb seo seo correction is compatible with 3.0.4

This code does not work in 3.0.6
What the new hotfix 3.0.6 phpbb-SEO code

Test: http://forum.muhabbetim.com/forum_son_yazilar.php
Redirected broken links to the home page...

Code: Select all
<?php

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = './'; // phpBB3'? kurulu oldu? dizin
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
@$user->session_begin();
$auth->acl($user->data);
$user->setup();

// + setup
$config['exclude_forums']   = ''; // exclude forums id
$config['max_topics']      = '10'; // last xx topic
// - setup

// Exclude forums
$sql_where = '';
if ($config['exclude_forums'])
{
   $exclude_forums = explode(',', $config['exclude_forums']);
   foreach ($exclude_forums as $i => $id)
   {
      if ($id > 0)
      {
         $sql_where .= ' AND t.forum_id != ' . trim($id);
      }
   }
}

// Recent topic (only show normal topic)
$sql = 'SELECT t.topic_title, t.forum_id, t.topic_id, f.forum_id, f.forum_name, f.forum_image
      FROM ' . TOPICS_TABLE . ' t,  ' . FORUMS_TABLE . ' f
      WHERE t.topic_status <> 2
         AND t.topic_approved = 1
         AND t.topic_type = 0
         AND t.forum_id = f.forum_id
         ' . $sql_where . '
      ORDER BY t.topic_time DESC';
$result = $db->sql_query_limit($sql, $config['max_topics']);

?>

<table cellpadding="0" cellspacing="0" height="245" width="250">
   <tr><td height="8%" width="10">&nbsp;</td></tr>
   <?php
   while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title'] != '') )
   {
   
      $topic_title = iconv('utf-8','ISO-8859-9', $row['topic_title']);
   
      // phpBB 3.0.4  - www.phpBB-SEO.com SEO TOOLKIT BEGIN
      /* FIX: Undefined index: forum_name */
      if ( empty($phpbb_seo->seo_url['forum'][$row['forum_id']]) )
      {
         $phpbb_seo->seo_url['forum'][$row['forum_id']] = $phpbb_seo->set_url($row['forum_name'], $row['forum_id'], $phpbb_seo->seo_static['forum']);
      }
      // phpBB 3.0.4  - www.phpBB-SEO.com SEO TOOLKIT END

      // phpBB 3.0.4  - www.phpBB-SEO.com SEO TOOLKIT BEGIN
      if ( empty($phpbb_seo->seo_url['topic'][$row['topic_id']]) )
      {
         $phpbb_seo->seo_censored[$row['topic_id']] = censor_text($row['topic_title']);
         $phpbb_seo->seo_url['topic'][$row['topic_id']] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$row['topic_id']]);
      }
      // phpBB 3.0.4  - www.phpBB-SEO.com SEO TOOLKIT END
   
      // auto auth
      if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
      {
         $url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']);
      ?>
         <tr><td height="8%" width="35"><p align="center"><img border="1" src="http://www.muhabbetim.com/grafik/nokta.gif" width="9" height="9"></td>
            <td height="8%" width="250"><a class="forum_son_mesajlar" target="_blank" href="<?=$url; ?>"><?=$topic_title; ?></a></td>
         <td height="8%" width="10">&nbsp;</td></tr>
      <?php
      }
   }
   $db->sql_freeresult($result);
   ?>
         <tr><td height="8%" width="35">&nbsp;</td>
            <td align="right" height="8%" width="250"><a class="forum_son_mesajlar_devam" target="_blank" href="http://forum.muhabbetim.com">Hepsini Oku</a></td>
         <td height="8%" width="10">&nbsp;</td></tr>
</table>


...
Fix phpbb-seo to phpbb 3.0.4

Code: Select all
// phpBB 3.0.4  - www.phpBB-SEO.com SEO TOOLKIT BEGIN
      /* FIX: Undefined index: forum_name */
      if ( empty($phpbb_seo->seo_url['forum'][$row['forum_id']]) )
      {
         $phpbb_seo->seo_url['forum'][$row['forum_id']] = $phpbb_seo->set_url($row['forum_name'], $row['forum_id'], $phpbb_seo->seo_static['forum']);
      }
      // phpBB 3.0.4  - www.phpBB-SEO.com SEO TOOLKIT END

      // phpBB 3.0.4  - www.phpBB-SEO.com SEO TOOLKIT BEGIN
      if ( empty($phpbb_seo->seo_url['topic'][$row['topic_id']]) )
      {
         $phpbb_seo->seo_censored[$row['topic_id']] = censor_text($row['topic_title']);
         $phpbb_seo->seo_url['topic'][$row['topic_id']] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$row['topic_id']]);
      }
      // phpBB 3.0.4  - www.phpBB-SEO.com SEO TOOLKIT END


What the new hotfix 3.0.6 phpbb-SEO code
muhabbetim
 
Posts: 1
Joined: Sat Feb 27, 2010 6:58 pm

Advertisement

Return to phpBB SEO MODS

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 4 guests