phpbb url script and root

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

Moderator: Moderators

phpbb url script and root

Postby tweety » Sun Mar 04, 2007 5:12 pm

Code: Select all
This update is mainly here to get rid of the PHPBB_URL constant.
You should now use :

$phpbb_seo->seo_path['phpbb_script'] instead of PHPBB_SCRIPT
$phpbb_seo->seo_path['root_url'] instead of ROOT_URL
$phpbb_seo->seo_path['phpbb_url'] instead of PHPBB_URL

everywhere you'll find these in phpBB code.


Please can you all tell us what pages and mod pages are known to need updating from the old style to new
tweety
PR0
PR0
 
Posts: 94
Joined: Wed Jan 24, 2007 1:29 am

Advertisement

Postby dcz » Sun Mar 04, 2007 8:28 pm

So far, this only concern the file modified by the zero duplicate, and mx sitemaps.

You can as well follow what's advised in the mod rewrite release, eg declare the PHPBB_URL in common.php in case you already started to use it in many other files.

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

Postby tweety » Sun Mar 04, 2007 10:31 pm

do you mean

should i do

this

Code: Select all
define('PHPBB_URL', 'http://www.mysite.com/');


or this

Code: Select all
if (!defined('PHPBB_URL')) {
   define('PHPBB_URL', $phpbb_seo->seo_path['phpbb_url']);
}
tweety
PR0
PR0
 
Posts: 94
Joined: Wed Jan 24, 2007 1:29 am

Postby dcz » Mon Mar 05, 2007 10:02 am

One thing, this particular trick may only required when upgrading, you do not need it if you only installed the phpBB SEO mod rewrite 0.2.2 and the zero dupe 0.2.2.

Then, as said in the release :

It is though possible to maintain compatibility with previous version until you'll update the zero dupe and mx sitemaps.
You'll just need to add :

Code: Select all
      if (!defined('PHPBB_URL')) {
         define('PHPBB_URL', $phpbb_seo->seo_path['phpbb_url']);
      }


After :

Code: Select all
      $phpbb_seo = new phpbb_seo();



in common.php.


This will make the PHPBB_URL constant filled with phpBB URL eg -http://www.example.com/phpBB/ (obviously with the real url ;)).

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

Postby tweety » Tue Mar 06, 2007 8:47 pm

dcz wrote:One thing, this particular trick may only required when upgrading, you do not need it if you only installed the phpBB SEO mod rewrite 0.2.2 and the zero dupe 0.2.2.


i have upgraded both zero dupes and advanced, how is that different to a fresh install?

I have looked at code and it seems the same after update, or am i missing some code difference?
tweety
PR0
PR0
 
Posts: 94
Joined: Wed Jan 24, 2007 1:29 am

Postby dcz » Wed Mar 07, 2007 10:42 am

Well, upgrading is only necessary if you did not started with the last versions.

There is no update between 0.2.2 and 0.2.2 ;)

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

Postby tweety » Thu Mar 08, 2007 1:10 am

i had the older version so i upgrade

i am asking what is the difference? they both seem the same.

but my updated will not work without that

if (!defined('PHPBB_URL')) {
define('PHPBB_URL', $phpbb_seo->seo_path['phpbb_url']);
}

addition

I am reading that you suggest once upgrade is done , it is not necessary, but it is for me.

do you know why?

That is all i ask,

thank you very much
tweety
PR0
PR0
 
Posts: 94
Joined: Wed Jan 24, 2007 1:29 am

Postby dcz » Thu Mar 08, 2007 2:23 pm

This is only because the PHPBB_URL constant (containing your phpbb url) is used elsewhere in your phpBB's code. Could be you or a mod, but it's no big deal, constant are safe and handy, we got rid of this one because it would cause some problem with mxBB, as well using the same one.

There is no problem with keeping this as is. It's just something to know.

You can massively search you files to find out where, but it's not really required.

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

Postby tweety » Mon Mar 12, 2007 4:25 pm

thanks

but maybe problems

i might want to use the mxbb

so

what can i do


do i have to search files and if so this PHPBB_URL constant ??

what would i need to look for and change
tweety
PR0
PR0
 
Posts: 94
Joined: Wed Jan 24, 2007 1:29 am

Postby dcz » Mon Mar 12, 2007 6:22 pm

There should not be problem, because we check if the PHPBB_URL constant was not defined before we eventually do, and mxBB should never include the phpbb common.php, so no worries at all.

The problem was when at first, I declared this constant within the phpbb_seo class, and started it from mxBB.

From there, we decided to only deal with vars in the phpbb_seo class to insure we won't face such problems again.

Then, of course, it's always better to knwo what code you're using, so You could still download Search and Replace and mass search you forum file for PHPBB_URL ( you can match case sensitive) just to know where they where used.

It will most likely be in mx sitemaps is you used it, but could as well be in few other files if you installed older phpBB SEO mods before and never updated.

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

Postby tweety » Tue Mar 13, 2007 10:15 pm

no i have no sitemap, only your advanced mod rewrite


so please tell me what is the code is search for

and what replace it with


i use dreamweaver which has search and replace
tweety
PR0
PR0
 
Posts: 94
Joined: Wed Jan 24, 2007 1:29 am

Postby dcz » Wed Mar 14, 2007 9:55 am

From the very first post, you can replace :

Code: Select all
PHPBB_URL


with :
Code: Select all
$phpbb_seo->seo_path['phpbb_url']


buts this implies that the $phpbb_seo class is available, wich is the case within all phpBB files, but not in the function's code (constants are always available).

To add access to the $phpbb_seo class within phpBB functions, you just need to globalize it for the function. It's easier to do than to explain, if you've used the PHPBB_URL in a function, you just have to make sure you add :

Code: Select all
global $phpbb_seo;



Something like :

Code: Select all
function bla( ...) {
          global $vars ... ;
          global $phpbb_seo;


....


}


But with only the phpBB SEO mod rewrite, you should not have to replace any, at least if up to date, and same goes with the zero dupe.

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

Postby tweety » Sat Mar 17, 2007 1:28 am

if all is working now and i only use new mxbb and sitemaps extras


will i be ok?

Because i have no idea how to do this
tweety
PR0
PR0
 
Posts: 94
Joined: Wed Jan 24, 2007 1:29 am

Postby dcz » Sat Mar 17, 2007 11:57 am

Sorry, I did not get it.
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: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby tweety » Mon Mar 19, 2007 4:54 am

it does work now as it is!

so! are these changes worth the effort to find and change code?
tweety
PR0
PR0
 
Posts: 94
Joined: Wed Jan 24, 2007 1:29 am

Next

Return to phpBB2 Advanced mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests