phpBB Modifications - NV recent topics

Issue on Recent Topics and SEO (new)

 

Hello,

As requested HERE, here is the corresponding tickect.

I have what seems to be an issue with the interaction of Recent Topics 1.0.6 and Ultimate SEO URL 0.6.8 on phpbb 3.0.9.

The issue is with the "unread" URL that Recent Topics is using: if the "unread" post is in a page that is not the first page of posts of the topic, then the URL does not work (as it refers to first page).

The equivalent situation in the "active_topics" search result gives a correct URL.

Example:
"Unread" URL from Recent Topics: http://www.exincastillos.es/foro/catedral-de-nuestro-senor-artifex-dominus-t4838.html&view=unread#unread - INCORRECT
"Unread" URL from Active Topics: http://www.exincastillos.es/foro/viewtopic.php?f=147&t=4838&view=unread#unread - CORRECT

Just in case this is useful to more people, here is a possible fix (works for me).

Open: includes/functions_recenttopics.php
Find
Code: Select all
function display_recent_topics($topics_per_page, $num_pages, $excluded_topics, $tpl_loopname = 'recenttopicrow', $spec_forum_id = 0, $include_subforums = true, $display_parent_forums = true)
{
   global $auth, $cache, $config, $db, $template, $user;
   global $phpbb_root_path, $phpEx;

Add after
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
   global $phpbb_seo;
// www.phpBB-SEO.com SEO TOOLKIT END


Find
Code: Select all
      $topic_id = $row['topic_id'];
      $forum_id = $row['forum_id'];

Add after
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
      $phpbb_seo->set_url($row['forum_name'], $forum_id, 'forum');
      $phpbb_seo->prepare_iurl($row, 'topic', $row['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$forum_id]);
// www.phpBB-SEO.com SEO TOOLKIT END


Find
Code: Select all
         'U_NEWEST_POST'         => $view_topic_url . '&view=unread#unread',
         'U_LAST_POST'         => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],

Replace with
Code: Select all
         // www.phpBB-SEO.com SEO TOOLKIT BEGIN
         'U_NEWEST_POST'         => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id . '&view=unread') . '#unread',
         // www.phpBB-SEO.com SEO TOOLKIT BEGIN -> no dupe
         'U_LAST_POST'         => !empty($phpbb_seo->seo_opt['no_dupe']['on']) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id . '&start=' . @intval($phpbb_seo->seo_opt['topic_last_page'][$topic_id])) . '#p' . $row['topic_last_post_id'] : append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
         // www.phpBB-SEO.com SEO TOOLKIT BEGIN -> no dupe
         // www.phpBB-SEO.com SEO TOOLKIT END


This solution is taken from a topic in the SEO forum.
I have this created as xsl to put in the contrib directory of your distribution. Let me know if you want it.

This fix still works for me on 3.0.10 with SEO Ultimate 0.7.0.
Regards,
-javiexin

Comments

No comments have been made

Ticket details