phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Assign SEO URLs from a MOD

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 SEO TooLKit  » phpBB SEO Premod
::  
Author Message
ASLAN
PR0
PR0


Joined: 19 Nov 2007
Posts: 58
Location: Chile

Assign SEO URLs from a MODPosted: Sat May 24, 2008 3:19 am    Post subject: Assign SEO URLs from a MOD

I installed a Portal MOD

on one of its blocks have this code
Code:
//
// 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:
//
// 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-title/topic-t2868.html

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

What are mading wrong ???

Thanks in advice
Back to top
Visit poster's website
philippe
phpBB SEO Team
phpBB SEO Team


Joined: 23 Jun 2006
Posts: 496
Location: Région Parisienne

Assign SEO URLs from a MODPosted: Sat May 24, 2008 10:05 am    Post subject: Re: Assign SEO URLs from a MOD

The answer is in this topic:

http://www.phpbb-seo.com/boards/advanced-seo-url/discussions-vt2488.html

_________________
Philippe
Webmaster du forum de Discussions sur la New Beetle | Blog 123-newbeetle | Annuaire Automobile
Back to top
Visit poster's website
ASLAN
PR0
PR0


Joined: 19 Nov 2007
Posts: 58
Location: Chile

Assign SEO URLs from a MODPosted: Sat May 24, 2008 6:14 pm    Post subject: Re: Assign SEO URLs from a MOD

You give a great support
Thanks a lot
Back to top
Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 SEO TooLKit  » phpBB SEO Premod
Page 1 of 1

Navigation Similar Topics

Jump to: