adding a page in php to phpbb

  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

i know how to add a page to phpbb and here is what i use:

Code: [ Select ]
<?php
define('IN_PHPBB', true);

$phpbb_root_path = './'; // <--
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

include($phpbb_root_path . 'includes/page_header.'.$phpEx);
?>
  1. <?php
  2. define('IN_PHPBB', true);
  3. $phpbb_root_path = './'; // <--
  4. include($phpbb_root_path . 'extension.inc');
  5. include($phpbb_root_path . 'common.'.$phpEx);
  6. $userdata = session_pagestart($user_ip, PAGE_INDEX);
  7. init_userprefs($userdata);
  8. include($phpbb_root_path . 'includes/page_header.'.$phpEx);
  9. ?>


but i wnat to put the files in a diffrent folder but when i do that and i change the root path the style dont work
i think i am not changeing the right thing
i hope thats enuff info if ya need more tell me or a url
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

As far as I'm aware, you can't put the PHP files outside of the phpBB root path.

Most of the files that phpBB uses are called using relative paths (and not all are coded perfectly), so if you're outside of the web root, things can break easily.
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

what if i make a folder in the root path?
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Then the contents of that folder wouldn't be in the root path :)
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

what if i change it from

Code: [ Select ]
<?php
define('IN_PHPBB', true);

$phpbb_root_path = './'; // <--
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

include($phpbb_root_path . 'includes/page_header.'.$phpEx);
?>
  1. <?php
  2. define('IN_PHPBB', true);
  3. $phpbb_root_path = './'; // <--
  4. include($phpbb_root_path . 'extension.inc');
  5. include($phpbb_root_path . 'common.'.$phpEx);
  6. $userdata = session_pagestart($user_ip, PAGE_INDEX);
  7. init_userprefs($userdata);
  8. include($phpbb_root_path . 'includes/page_header.'.$phpEx);
  9. ?>



to

Code: [ Select ]
<?php
define('IN_PHPBB', true);

$phpbb_root_path = './'; // <--
include($phpbb_root_path . 'root/extension.inc');
include($phpbb_root_path . 'root/common.'.$phpEx);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

include($phpbb_root_path . 'root/includes/page_header.'.$phpEx);
?>
  1. <?php
  2. define('IN_PHPBB', true);
  3. $phpbb_root_path = './'; // <--
  4. include($phpbb_root_path . 'root/extension.inc');
  5. include($phpbb_root_path . 'root/common.'.$phpEx);
  6. $userdata = session_pagestart($user_ip, PAGE_INDEX);
  7. init_userprefs($userdata);
  8. include($phpbb_root_path . 'root/includes/page_header.'.$phpEx);
  9. ?>
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

well, you wouldn't need to add "root" in that small section of code...

Just change $phpbb_root_path to '../'; (the parent directory).

Whether that would actually work or not, I doubt it.

Plus, you'd have to go through your entire theme, and change all the relative links to hard-coded links.

It can't easily be done without editing a LOT of files.
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

*plum* i can add pages to the phpbb root and they work but there are so many that it slows down my ftp

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 79 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.