With the latest phpbb-seo, many of the portal links are already rewritten by default, including member names, forum names, forum index etc. but the topics are not. First we will rewrite the news module's topics.
OPEN portal/block/news.php:
FIND (2 Times):
- Code: Select all
$forum_id = $fetch_news[$i]['forum_id'];
$topic_id = $fetch_news[$i]['topic_id'];
ADD AFTER:
- Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ($fetch_news[$i]['topic_type'] == POST_GLOBAL || !empty($phpbb_seo->seo_url['forum'][$fetch_news[$i]['forum_id']])) {
$phpbb_seo->prepare_iurl($fetch_news[$i], 'topic', $fetch_news[$i]['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$fetch_news[$i]['forum_id']]);
}
// www.phpBB-SEO.com SEO TOOLKIT END
To reiterate, you will find the above lines TWICE and must add the code after each occurence.
Now on to the announcements.
OPEN portal/block/announcements.php:
FIND (2 Times):
- Code: Select all
$forum_id = $fetch_news[$i]['forum_id'];
$topic_id = $fetch_news[$i]['topic_id'];
ADD AFTER:
- Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ($fetch_news[$i]['topic_type'] == POST_GLOBAL || !empty($phpbb_seo->seo_url['forum'][$fetch_news[$i]['forum_id']])) {
$phpbb_seo->prepare_iurl($fetch_news[$i], 'topic', $fetch_news[$i]['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$fetch_news[$i]['forum_id']]);
}
// www.phpBB-SEO.com SEO TOOLKIT END
Now we want to rewrite the urls of the recent topics block.
OPEN portal/block/recent.php:
FIND (3 Times):
- Code: Select all
$sql = 'SELECT topic_title, forum_id, topic_id
REPLACE WITH:
- Code: Select all
$sql = 'SELECT topic_title, forum_id, topic_id, topic_type
FIND (3 Times):
- Code: Select all
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
{
ADD AFTER:
- Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ($row['topic_type'] == POST_GLOBAL || !empty($phpbb_seo->seo_url['forum'][$row['forum_id']])) {
$phpbb_seo->prepare_iurl($row, 'topic', $row['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$row['forum_id']]);
}
// www.phpBB-SEO.com SEO TOOLKIT END
Now the final thing is that the group links aren't rewritten in the who is online section. To fix that...
OPEN portal/block/whois_online.php:
FIND:
- Code: Select all
$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
ADD BEFORE:
- Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$phpbb_seo->prepare_url('group', $row['group_name'], $row['group_id']);
// www.phpBB-SEO.com SEO TOOLKIT END
That should do it. I hope you guys find this useful. Thanks again to dcz for all the help he's given me with this great mod.
EDIT: Seems I missed a topic where dcz already took care of this. See here for more info.

English |
French
