Rewriting the nv newspage mod

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

Moderator: Moderators

Rewriting the nv newspage mod

Postby frechdaxx » Mon Oct 29, 2007 6:42 pm

Hey,

I have installed your Advanced Seo Url mod, which works very well :)

But I got some questions:

When I get to the last post I get the link:
http://www.roqbar.de/post2003.html#p2003

why not http://www.roqbar.de/post2003.html ?

In the demo it is like: http://phpbb3.phpbb-seo.net/forum-de-te ... 0.html#p64

which I like much more, but I think its because of the duplicated content?

I got a little newspage on my board on:

www.roqbar.de

Its the Mod: http://www.phpbb.com/community/viewtopi ... 0&t=579245

Now I want to have some rewritten URLs in this mod, too, not the /post***.html ones, but the one to the start topic, because when google searches my root it just finds the post*** urls, which are disabled in the robots.txt anyway. Also I wanted to know generally how I can put the rewritten urls in another page or mod, for example a recent posts mod, which doesn't use your mod ;) Instructions would be very cool, maybe some on the newspage code:


[mod]
Link to the mod's release thread is enough ;)
[/mod]


Thanks a lot for your help and the great mod :)
frechdaxx
 
Posts: 20
Joined: Tue Sep 04, 2007 7:58 pm

Advertisement

Re: Rewriting the nv newspage mod

Postby dcz » Tue Oct 30, 2007 8:55 am

frechdaxx wrote:Hey,

I have installed your Advanced Seo Url mod, which works very well :)

Great ;)

frechdaxx wrote:But I got some questions:
When I get to the last post I get the link:
http://www.roqbar.de/post2003.html#p2003
why not http://www.roqbar.de/post2003.html ?


Well, it's just to position the browser window in front of the proper post. Without the anchor (#pxx), you'd always see the top of the page, even if the post is at the bottom.
Since these two are not duplicate, it's handier like this IMHO.

frechdaxx wrote:In the demo it is like: http://phpbb3.phpbb-seo.net/forum-de-te ... 0.html#p64

which I like much more, but I think its because of the duplicated content?

The no duplicate mod is the one that gets rid of post URLs.
Post url are duplicate of topic url, the only ones that matters, but it's no big deal to keep them as long as you set up your robots.txt properly.

frechdaxx wrote:I got a little newspage on my board


So for the nv newsmod, I guess that adding :
Code: Select all
   // 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;
      }
      $row['topic_title'] = censor_text($row['topic_title']);
      $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($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


After :

Code: Select all
while ($row = $db->sql_fetchrow($result))
{
   //set some default vars
   $post_id = $row['post_id'];
   $poster_id = $row['poster_id'];
   $topic_id = $row['topic_id'];
   $forum_id = $row['forum_id'];


in newspage.php will be enough to rewrite everything, the problem is the mod nevers outputs a topic or a forum url it seems.

There is an odd line in the code :
Code: Select all
      'U_NEWS'            => append_sid("{$phpbb_root_path}viewnews.$phpEx", 'news=' . $topic_id),


I can't see any viewnews.php file in the package.

++
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

Re: Rewriting the nv newspage mod

Postby frechdaxx » Tue Oct 30, 2007 6:15 pm

dcz wrote:There is an odd line in the code :
Code: Select all
      'U_NEWS'            => append_sid("{$phpbb_root_path}viewnews.$phpEx", 'news=' . $topic_id),


I can't see any viewnews.php file in the package.

++


thats because the author forgot the change that files in a new release, it must be

'U_NEWS' => append_sid("{$phpbb_root_path}newspage.$phpEx", 'news=' . $topic_id),[/code]

;)

Thanks for your great support, I really appreciate that your extensive answers :) I'll try that code now ;)

Edit: Links doesn't change at all :(

They stay like: http://www.roqbar.de/post1994.html#p1994
frechdaxx
 
Posts: 20
Joined: Tue Sep 04, 2007 7:58 pm

Postby dcz » Sat Nov 03, 2007 12:18 pm

Well, it's a rewritten link, but you can add :

Code: Select all
   // 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;
      }
      $row['topic_title'] = censor_text($row['topic_title']);
      $phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($row['topic_title']);
   }
   $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
   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'];
   }
   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


Still after :

Code: Select all
while ($row = $db->sql_fetchrow($result))
{
   //set some default vars
   $post_id = $row['post_id'];
   $poster_id = $row['poster_id'];
   $topic_id = $row['topic_id'];
   $forum_id = $row['forum_id'];


And then replace :

Code: Select all
      'U_MINI_POST'         => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . (($row['topic_type'] == POST_GLOBAL) ? '&f=' . $forum_id : '') . '#p' . $row['post_id'],


With :
Code: Select all
      // www.phpBB-SEO.com SEO TOOLKIT BEGIN
      'U_MINI_POST'         => 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['post_id'],
      // www.phpBB-SEO.com SEO TOOLKIT END


In newspage.php.

About the newspage itself, the links could be problematic if the regular topic URL is accessible too, because it would mean duplicate content.

But you can easily have them rewritten, to do so you'd need to edit the phpbb_seo_class.php file a bit.

Find :

Code: Select all
      $this->seo_ext = array( 'forum' => '.html', 'topic' => '.html', 'post' => '.html', 'user' => '.html', 'index' => (!empty($this->seo_static['index']) ? '.html' : ''), 'global_announce' => '/', 'leaders' => '.html', 'pagination' => '.html', 'gz_ext' => '');


after add :
Code: Select all
      // NV_newspage mod
      $this->seo_url['newspage'] = array();
      $this->seo_delim['newspage'] = '-n';
      $this->seo_static['newspage'] = 'news';
      $this->seo_ext['newspage'] = '.html';
      // NV_newspage mod


Find :

Code: Select all
      $this->seo_opt['rewrite_functions'] = array( 'viewtopic' => $this->seo_opt['virtual_folder'] ? 'viewtopic_uadv' : 'viewtopic_adv',
         'viewforum' => $this->seo_opt['virtual_folder'] ? 'viewforum_uadv' : 'viewforum_adv',
         'index' => 'index',
         'memberlist' => 'memberlist',
      );


After add :
Code: Select all
      // NV_newspage mod
      $this->seo_opt['rewrite_functions']['newspage'] = 'newspage';
      // NV_newspage mod


Find :

Code: Select all
   /**
   * URL rewritting for index.php
   * @access private
   */
   function index() {
      $this->path = $this->seo_path['phpbb_urlR'];
      $this->url = $this->seo_static['index'] . $this->seo_ext['index'];
      return;
   }


After add :

Code: Select all
// NV_newspage mod
   /**
   * URL rewritting for newspage.php
   * Without Virtual Folder Injection
   * @access private
   */
   function newspage() {
      $this->path = $this->seo_path['phpbb_url'];
      if ( !empty($this->get_vars['news']) && !empty($this->seo_url['topic'][$this->get_vars['news']]) ) {
         $this->url = $this->seo_url['topic'][$this->get_vars['news']] . $this->seo_delim['newspage'] . $this->get_vars['news'] . $this->seo_ext['newspage'];
         unset($this->get_vars['news']);
         return;
      }
      return;
   }
// NV_newspage mod


You'll need to add a rewriterule to your .htaccess, add :

Code: Select all
# Nv_newsmod
RewriteRule ^[a-z0-9_-]*-t([0-9]+)\.html$ /newspage.php?news=$1 [QSA,L,NC]


after :
Code: Select all
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES


Should do the trick ;)

++
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

Postby frechdaxx » Sun Nov 04, 2007 11:08 pm

Thx, I will try that tomorrow ;) Really impressive what excellent support you give
frechdaxx
 
Posts: 20
Joined: Tue Sep 04, 2007 7:58 pm

Postby dcz » Thu Nov 08, 2007 3:39 pm

You're welcome ;)

So how is it going ?

++
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

NV Newspage SEO

Postby ryudr » Sun Feb 01, 2009 7:00 pm

J'ai essayé cette modification, les liens ré écrits fonctionnent quand on tape manuellement l'adresse site.com/titre-de-la-news-t22.html mais quand on navigue sur la page newspage.php les liens ne sont pas automatiquement ré écrits.

J'ai oublié quelque chose ?
Merci encore pour cette modification, c'est génial
ryudr
 
Posts: 17
Joined: Sun Feb 01, 2009 6:57 pm

Postby SeO » Mon Feb 02, 2009 11:02 am

Merci d'utiliser le forum francophone ;)
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Re: Rewriting the nv newspage mod

Postby Gisher » Thu Mar 04, 2010 10:41 pm

Hello,
Can You write full edits for NV Newspage 1.0.2 & phpBB SEO Premod 3.0.7?
Regards
Gisher
PR0
PR0
 
Posts: 75
Joined: Sat Sep 27, 2008 8:54 am

Re: Rewriting the nv newspage mod

Postby Gisher » Wed Mar 10, 2010 12:05 pm

Is there any chance to get answer?
Gisher
PR0
PR0
 
Posts: 75
Joined: Sat Sep 27, 2008 8:54 am

Re: Rewriting the nv newspage mod

Postby SeO » Tue Mar 16, 2010 6:23 pm

What happens when you implement these : Rewriting the nv newspage mod ?
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Re: Rewriting the nv newspage mod

Postby Gisher » Sat Mar 20, 2010 12:19 am

Changes of newspage not working corectly
I'm using seo premod with zero dupe and no dupe
Also there are a lot of changes in phpbb_seo_class.php since post above
Regards
Gisher
PR0
PR0
 
Posts: 75
Joined: Sat Sep 27, 2008 8:54 am


Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 5 guests