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 ]

English |
French
