Problem with NV Recent Post

phpBB3 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting forums and topic titles in their URLs.

Moderator: Moderators

Postby IPB_Refugee » Tue Sep 16, 2008 2:04 am

Hi,

unfortunately this issue has not been solved yet.

You can download the latest version of the MOD here:

http://www.flying-bits.org/viewtopic.php?f=9&t=35

And this is my functions_recenttopics.php:

http://home.twin.at/wolfgang/functions_recenttopics.txt

The links to the first unread post and to the latest post in a topic do not work.

Examples:

Link to the first unread post: http://www.example.com/testthema-t5.htm ... ead#unread
Link to the latest post: http://www.example.com/testthema-t5.html&p=7#p7

Both links lead to a 404 error. A final solution regarding this issue would be fine. :)

I think the only problem is this part of code in functions_recenttopics.php:

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'],


But after reading this topic, I am not sure. I have to admit it: You confuse me. :D

Best regards
Wolfgang
User avatar
IPB_Refugee
PR0
PR0
 
Posts: 82
Joined: Thu Jul 24, 2008 2:18 pm

Advertisement

Postby IPB_Refugee » Wed Sep 17, 2008 6:43 pm

Here is my solution that seems to work correctly (I have Advanced Kexword URLs, No Dupe, Zero Dupe,...):

Take a vanilla functions_recenttopics.php.

FIND

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


AFTER, ADD:

Code: Select all
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
      if ($row['topic_type'] == POST_GLOBAL) {
         $phpbb_seo->seo_opt['topic_type'][$topic_id] = POST_GLOBAL;
      }
      $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url(censor_text($row['topic_title']));
   }
   if ( empty($phpbb_seo->seo_url['forum'][$forum_id]) ) {
      $phpbb_seo->seo_url['forum'][$forum_id] = $phpbb_seo->set_url($row['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']);
   }
   // 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
/*      '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'],
*/
      // 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'         => $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


Second part is phpBB-seo.com's original code taken from viewforum.php.

Regards
Wolfgang
User avatar
IPB_Refugee
PR0
PR0
 
Posts: 82
Joined: Thu Jul 24, 2008 2:18 pm

Problem with version 1.01 !!!!!!!!

Postby apitsch » Fri Sep 19, 2008 6:51 am

Hi Wolfgang,
thanks for your solution that works perfectly on my site. But one last problem with the actually version 1.01 of that mod. In this new version you have on the index the option to choose the next x pages of the recent topic. Have a look to the index page of this new version: http://www.flying-bits.org/index.php

If you choose the next 5 for example on my site the originally path of the mod without is "/index.php?start=5". With phpbb-seo and this installed mod I got the url "/page8.html" and that wokred not for me. Do you have also a solution for this problem ?

Thanks...

Andreas
apitsch
 
Posts: 1
Joined: Fri Sep 19, 2008 6:33 am

Postby dcz » Sat Sep 20, 2008 11:33 am

Great job IPB_Refugee ;)

For the pagination, if it shows /page8.html, then the url rewriting is working, you just need a rewriterules to handle these.

Something like :

Code: Select all
RewriteRule ^/?(page([0-9]+)\.html)?$ index.php?start=$2 [QSA,L,NC]


For when this is used on index.php ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21219
Joined: Fri Apr 28, 2006 9:03 pm

last Post doesn't work with more then 1 Page / Thread

Postby CharlieM » Sat Nov 22, 2008 12:03 am

Hi @ all,

I've installed in my Forum phpBB3_no_dupeV0-4-2 and apllied the Code from IPB_Refugee.

It works well so far, but if there are more then 2 pages i can't go to the last Post, it starts at the first Post.

If I disable the no_dupe_mod the NV-Last_Topic 1.0.1 works well :(

Sample:
the actually last post is:
http://Forum/Topic/Title-t280-210.html#p4769

Via last Post i go the URL=> starts @ the first Post
http://Forum/Topic/Title-t280.html#p4769

Can U help me please?

THX!

functions_recenttopics.zip
CharlieM
 
Posts: 12
Joined: Sun Nov 16, 2008 9:49 pm

Postby SeO » Sat Nov 22, 2008 8:35 am

If you are indeed using the no duplicate mod, then add :
Code: Select all
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN -> no dupe
      if ($phpbb_seo->seo_opt['no_dupe']['on']) {
         if (($replies + 1) > $phpbb_seo->seo_opt['topic_per_page']) {
            $phpbb_seo->seo_opt['topic_last_page'][$topic_id] = floor($replies / $phpbb_seo->seo_opt['topic_per_page']) * $phpbb_seo->seo_opt['topic_per_page'];
         }
      }
      // www.phpBB-SEO.com SEO TOOLKIT END -> no dupe


after :
Code: Select all
   $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];


And you'll get the proper last page url ;)
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby CharlieM » Sat Nov 22, 2008 9:19 am

SPECIAL THX @SEO

Image

It works great :!:
CharlieM
 
Posts: 12
Joined: Sun Nov 16, 2008 9:49 pm

Postby mk1200 » Fri Jan 23, 2009 1:42 am

Code: Select all
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN -> no dupe
      if ($phpbb_seo->seo_opt['no_dupe']['on']) {
         if (($replies + 1) > $phpbb_seo->seo_opt['topic_per_page']) {
            $phpbb_seo->seo_opt['topic_last_page'][$topic_id] = floor($replies / $phpbb_seo->seo_opt['topic_per_page']) * $phpbb_seo->seo_opt['topic_per_page'];
         }
      }
      // www.phpBB-SEO.com SEO TOOLKIT END -> no dupe


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'         => $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 is blowing my error logger up: Undefined index: no_dupe

It shows up for both lines of code. Where do I define no_dupe?

Also, the first section of code might be useless. I didn't notice any change in recent topics, just less errors.

I have 3 SEO mods installed.
adv_phpbb3_mod_rewriteV0-4-8
gym_sitemapsV2-0-RC3
phpBB3-SEO-Zero-dupe_V0.4.8

If I remove all of the code, the errors stop, but the "View the latest post link" in the Last Post column points to forums.html
mk1200
 
Posts: 24
Joined: Sun Dec 21, 2008 2:30 am

Postby SeO » Fri Jan 23, 2009 7:14 pm

To use the no_dupe part, you need the no duplicate mod ;)
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby mk1200 » Fri Jan 23, 2009 7:21 pm

Does it really matter if I use a standard functions_recenttopics.php file?

All of the links show up as the old style, but the functionality according to the user is perfect.

Will that hurt me in any way related to SEO?
mk1200
 
Posts: 24
Joined: Sun Dec 21, 2008 2:30 am

Postby SeO » Fri Jan 23, 2009 7:41 pm

Well, even if you run the zero duplicate wich at least makes sure that this would not produce any duplicate, it's still better to display the correct url from the begining.

You don't need to install the no dupe to have rewritten urls, it's only for the post ones. So you can use the first part of the patch.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby mk1200 » Fri Jan 23, 2009 8:10 pm

So you can use the first part of the patch.


I'm using the 1st part, but the View latest post link goes to a 404.
mk1200
 
Posts: 24
Joined: Sun Dec 21, 2008 2:30 am

Postby SeO » Sat Jan 24, 2009 9:46 am

How does its url looks like ?
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby mk1200 » Sat Jan 24, 2009 1:42 pm

If I'm only using the first part of the patch, the main link looks like this:

http://www.boxerforums.com/barking-t17692.html

View first unread post :http://www.boxerforums.com/barking-t17692.html&view=unread#unread (404)

View the latest post :http://www.boxerforums.com/barking-t17692.html&p=239372#p239372 (404)
mk1200
 
Posts: 24
Joined: Sun Dec 21, 2008 2:30 am

Postby SeO » Mon Jan 26, 2009 8:43 am

Hense the code change in this post :
http://www.phpbb-seo.com/boards/advance ... html#20291

;)
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

PreviousNext

Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 5 guests