phpBB SEO advanced (phpBB2) - error with $phpbb_root_path

Discussions and support about the different URL Rewriting techniques for phpBB2.

Moderator: Moderators

phpBB SEO advanced (phpBB2) - error with $phpbb_root_path

Postby pozmu » Tue Nov 06, 2007 8:01 pm

Hi

I found that if $phpbb_root_path = "../../../" phpBB SEO will modify it to the form of "../" which is wrong. My temporary solution is to change it to "./../../.././" which will work, because phpBB SEO wil modify it to "../../../" which is what we want. With phpBB2 without phpBB SEO the first form of path will work correctly.

Example - temp.php:
Code: Select all
<?php
$phpbb_root_path = '../../../';

//
// prevent hacking attempts - phpBB needs this line to work
//

define ('IN_PHPBB', true);

//
// lets make a little check if your root_path is correct ;-)
//

if (!file_exists($phpbb_root_path . 'extension.inc'))
{
   die ('<tt><b>phpBB Fetch All:</b>
      $phpbb_root_path is wrong and does not point to your forum.</tt>');
}

//
// now we include (integrate) some files which we need
//

//
// this is a phpBB file
//

include_once ($phpbb_root_path . 'extension.inc');

//
// again a phpBB file
//

include_once ($phpbb_root_path . 'common.' . $phpEx);

//
// phpBB file, too
//

include_once ($phpbb_root_path . 'includes/bbcode.' . $phpEx);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$seo_topic_name = "Test topic";
$news[$i]['topic_id'] = 8;
   if ( !isset($phpbb_seo->seo_url['topic'][$news[$i]['topic_id']]) ) {
      $phpbb_seo->seo_url['topic'][$news[$i]['topic_id']] = $phpbb_seo->format_url($seo_topic_name);
   }
   
   echo append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[$i]['topic_id']);


?>



Output:
Code: Select all
../test-topic-t8.html




[ Topic moved to the correct forum. - Peter ]
pozmu
 
Posts: 2
Joined: Tue Nov 06, 2007 3:41 pm

Advertisement

Postby dcz » Thu Nov 08, 2007 4:40 pm

That's indeed a problem dealing with the way I first tried to deal with $phpbb_root_path being sent to append_sid().

This does not occur with the phpBB3 version.

As a quick fix you could use :

Code: Select all
$phpbb_seo->seo_path['phpbb_url'] . append_sid('viewtopic.php?t=' . $news[$i]['topic_id'])


instead of :

Code: Select all
append_sid($phpbb_root_path . 'viewtopic.php?t=' . $news[$i]['topic_id'])


until we back-port some of the phpBB3 versions improvements on the phpBB2 mod rewrite.

++
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 sai » Fri Jun 06, 2008 9:14 pm

Hi,

[EDIT]

For now I've resorted to an alternative script called phpBB Latest Topic Displayer. Incase anyone has the same problem as me.

[/EDIT]

Has anyone been able to get the PHPBB Fetch All / FetchAll mod to work with PHPBB v2 SEO mod?

I downloaded SEO Mod and installed today. I used this version:
http://www.hm2k.com/projects/phpbb-seo-easymod

I tried all the suggestions in this thread and scoured the net for other suggestions but can't find anything that works. I always just get the error:

phpBB Fetch All: $phpbb_root_path is wrong and does not point to your forum.


Thanks for any help.
sai
 
Posts: 1
Joined: Fri Jun 06, 2008 9:08 pm

Postby dcz » Mon Jun 09, 2008 9:03 am

sai wrote:
phpBB Fetch All: $phpbb_root_path is wrong and does not point to your forum.




It may have been the case actually, in phpBB Fetch All script, you need to configure the relative path from the script to the forum dir, by default it's "./", but you need to change it in case you phpBB Fetch All script is not in the same dir ;)
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


Return to phpBB2 mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest