| |
| |
|
|
|
|
| |
|
| |
|
| :: |
| Author |
Message |
ASLAN PR0

Joined: 19 Nov 2007 Posts: 58 Location: Chile
|
Posted: 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'] . '&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'] . '&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 |
|
 |
|
 |
philippe phpBB SEO Team


Joined: 23 Jun 2006 Posts: 496 Location: Région Parisienne
|
|
| Back to top |
|
 |
ASLAN PR0

Joined: 19 Nov 2007 Posts: 58 Location: Chile
|
Posted: 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 |
|
 |
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |