The mechanism is the same. Find the place where you are going to assign the template vars. e.g. for Similar Topic mod. Open viewtopic.php and Find:
- Code: Select all
if ($auth->acl_get('f_read', $similar['forum_id']))
{
Add after:
- Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN -> no dupe
if (@$phpbb_seo->seo_opt['no_dupe']['on']) {
if ($similar['topic_status'] == ITEM_MOVED) {
$similar['topic_id'] = $similar['topic_moved_id'];
}
$phpbb_seo->prepare_iurl($similar, 'topic', $similar['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$similar['forum_id']]);
$phpbb_seo->seo_opt['topic_forum_name'][$similar['topic_id']] = $similar['forum_name'];
if ($auth->acl_get('m_approve', $similar['forum_id'])) {
$similar['forum_topics'] = $similar['forum_topics_real'];
$replies = $similar['topic_replies_real'];
} else {
$similar['forum_topics'] = $similar['forum_topics'];
$replies = $similar['topic_replies'];
}
if (($replies + 1) > $phpbb_seo->seo_opt['topic_per_page']) {
$phpbb_seo->seo_opt['topic_last_page'][$similar['topic_id']] = floor($replies / $phpbb_seo->seo_opt['topic_per_page']) * $phpbb_seo->seo_opt['topic_per_page'];
}
} else {
$row['forum_topics'] = ($auth->acl_get('m_approve', $similar['forum_id'])) ? $similar['forum_topics_real'] : $similar['forum_topics'];
}
// www.phpBB-SEO.com SEO TOOLKIT END -> no dupe
Then, when you assign var:
1. For topic URL:
- Code: Select all
$similar_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $similar['forum_id'] . '&t=' . $similar['topic_id']);
2. For Latest Post URL:
- Code: Select all
$similar_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $similar['forum_id'] . '&t=' . $similar['topic_id'] . '&start=' . @intval($phpbb_seo->seo_opt['topic_last_page'][$similar['topic_id']]) ) . '#p' . $similar['topic_last_post_id'];
You can add the checking for No Dupe mod if you want.
You will also have to add to the $sql whichever variable you need to SELECT more, in this case, f.forum_topics_real and t.topic_replies_real are needed. In addition, the checking for moved_topic might not be needed.
This is simply what I have come up with and is not the official way to do this so we really need our admin to enlighten us in this. Like catching every possible problems, moved_topic, temporarily deleted topíc, etc.
Hope this helps and longing for admin

English |
French

