phpBB 3.1 & hooks

General discussions Forum for everything that does not fit elswhere in the phpbb SEO forums.

Moderator: Moderators

phpBB 3.1 & hooks

Postby CentaurAtlas » Mon Jun 20, 2011 4:32 pm

I have been doing a fair amount of reading on the hook structure coming in phpBB 3.1 and made a suggestion or two for hook locations myself. I have not done so for SEO purposes yet. I believe it would be useful to hear where the phpBB SEO community would want hooks that would enable SEO URLs to be implemented in an easier fashion than currently - perhaps it would just require a few uses of the hooks and changes to .htaccess.

I believe that hooks in the following might be useful, does anyone have any to add?:
1. viewforum.php
2. viewtopic.php
3. download/file.php
4. memberlist.php
5. search.php
6. active-topics.html

I have not looked enough to say exactly where the hooks should go, but given where phpBB 3.1 is in development, now would be a good time to suggest where the hooks should go.

[You can post here if you think there is a particular location needed for an SEO hook:
http://area51.phpbb.com/phpBB/viewforum.php?f=111
]
CentaurAtlas
 
Posts: 6
Joined: Sun Dec 09, 2007 2:02 pm

Advertisement

Re: phpBB 3.1 & hooks

Postby dcz » Fri Jun 24, 2011 7:10 pm

It's not that obvious that urls rewriting could be fully hook based. Because when you consider SEO globally, you need to perform more than just url rewriting, reducing duplicate for example involves url buidling, checking and redirecting.

Also, when it comes to repeated task, hooks are not necessarily efficient. I have tested to use an append_sid hook (when it was first introduced) and the result where quite disappointing in terms of performances. The hook system was involving a lot of extra IF statement in the critical loop (where all the rewriting actually occurs) and this resulted in quite some performances loss, hence the comment in the append_sid function :
Code: Select all
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   // We bypass the hook function here, the same effect as a standalone hook, which we want, but faster ;-)
   global $phpbb_seo;
   if (!empty($phpbb_seo->seo_opt['url_rewrite'])) {
      return $phpbb_seo->url_rewrite($url, $params, $is_amp, $session_id);
   } else
   // www.phpBB-SEO.com SEO TOOLKIT END


Now talking about data collecting, hook may look like a better option, and the main two one we could think do already have an RFC (forumrow hook RFC and topicrow hook RFC), but again, I'm not sure that we'd necessarily go for it. I mean, it's of course nice to save a code change, but as you must know, proper url rewriting, and even more when talking about full SEO, both viewforum.php and viewtopic.php do need quite more code change than the one required for data (here we are speaking about titles and ids) collection, so it's likely that the small gain in code manipulation would not be relevant, especially if we consider the fact that hooks will always be heavier to handle.

Hooks are way more interesting when it comes to task that are performed once per page load, like adding links in the header or adding some features such as a portal, but url rewriting stands too close to core operation, at least IMHO, for a hook method to be fully desirable.

Though, we will as well do some major improvement to our code for 3.1, all methods will be turned static so that we will not need any global again, and few other thing that should save even a bit more code upon install.

++
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: 21383
Joined: Fri Apr 28, 2006 9:03 pm


Return to General Discussions

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 8 guests