PHPBB在新目录中添加自定义页面

时间:2013-07-31 08:30:42

标签: phpbb phpbb3

我的PHPBB版本已安装在我网站的/board

我正在尝试在名为store的新目录中创建一个自定义页面,该文件名为decals.php

decals.php

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

page_header('Store - Decals');

$template->set_filenames(array(
    'body' => 'store_decals_body.html',
));

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();

?>

store_decals_body.html已上传到我的styles目录,似乎无法使mysite.com/board/store/decals.php正常工作。它总是把我带到mysite.com/board

我在这里忽略了什么吗?

1 个答案:

答案 0 :(得分:1)

如果您在子目录中有PHP文件,请相应地更改根路径:

$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';