Assign SEO URLs from a MOD

phpBB SEO Premod for phpBB3 support forum.
This premodded version of phpBB3 includes the three different type of URL rewriting for phpBB3 by phpBB SEO. It comes with several other Search Engine Optimization mods installed.

Moderator: Moderators

Assign SEO URLs from a MOD

Postby ASLAN » Sat May 24, 2008 3:19 am

I installed a Portal MOD

on one of its blocks have this code
Code: Select all
//
// Recent announcements
//
$sql = 'SELECT topic_title, forum_id, topic_id
   FROM ' . TOPICS_TABLE . '
   WHERE topic_status <> ' . FORUM_LINK . '
      AND topic_approved = 1
      AND ( topic_type = ' . POST_ANNOUNCE . ' OR topic_type = ' . POST_GLOBAL . ' )
      ' . $sql_where . '
   ORDER BY topic_time DESC';

$result = $db->sql_query_limit($sql, $config['portal_max_topics']);

while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title']) )
{
   // auto auth
   if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
   {
      $template->assign_block_vars('latest_announcements', array(
         'TITLE'          => character_limit($row['topic_title'], $config['portal_recent_title_limit']),
         'FULL_TITLE'   => censor_text($row['topic_title']),
         'U_VIEW_TOPIC'   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'])
      ));
   }
}
$db->sql_freeresult($result);


And I modified it, and result is this
Code: Select all
//
// Recent announcements
//
$sql = 'SELECT topic_title, forum_id, topic_id
   FROM ' . TOPICS_TABLE . '
   WHERE topic_status <> ' . FORUM_LINK . '
      AND topic_approved = 1
      AND ( topic_type = ' . POST_ANNOUNCE . ' OR topic_type = ' . POST_GLOBAL . ' )
      ' . $sql_where . '
   ORDER BY topic_time DESC';

$result = $db->sql_query_limit($sql, $config['portal_max_topics']);

while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title']) )
{
   //generar URL
   $forum_id = (int) $row['forum_id'];
   $topic_id = (int) $row['topic_id'];
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
      if ($topic_data['topic_type'] == POST_GLOBAL) {
         $phpbb_seo->seo_opt['topic_type'][$topic_id] = POST_GLOBAL;
      }
      $phpbb_seo->seo_censored[$topic_id] = censor_text($topic_data['topic_title']);
      $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$topic_id]);
   }
   if ( empty($phpbb_seo->seo_url['forum'][$topic_data['forum_id']]) ) {
      $phpbb_seo->seo_url['forum'][$topic_data['forum_id']] = $phpbb_seo->set_url($topic_data['forum_name'], $topic_data['forum_id'], $phpbb_seo->seo_static['forum']);
   }
   // www.phpBB-SEO.com SEO TOOLKIT END

   // auto auth
   if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
   {
      $template->assign_block_vars('latest_announcements', array(
         'TITLE'          => character_limit($row['topic_title'], $config['portal_recent_title_limit']),
         'FULL_TITLE'   => censor_text($row['topic_title']),
         'U_VIEW_TOPIC'   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'])
      ));
   }
}
$db->sql_freeresult($result);


But the resulting URL is something like this:
http://www.mydomain.com/custom-forum-ti ... t2868.html

When should be something like this:
http://www.mydomain.com/custom-forum-ti ... t2868.html

What are mading wrong ???

Thanks in advice
ASLAN
PR0
PR0
 
Posts: 58
Joined: Mon Nov 19, 2007 2:38 am
Location: Chile

Advertisement

Postby philippe » Sat May 24, 2008 10:05 am

Philippe
Webmaster du forum de Portail New Beetle | special-t
philippe
phpBB SEO Team
phpBB SEO Team
 
Posts: 601
Joined: Fri Jun 23, 2006 12:00 pm
Location: Région Parisienne

Postby ASLAN » Sat May 24, 2008 6:14 pm

You give a great support
Thanks a lot
ASLAN
PR0
PR0
 
Posts: 58
Joined: Mon Nov 19, 2007 2:38 am
Location: Chile


Return to phpBB SEO Premod

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 7 guests