Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

php include in default.master

edited January 2011 in Vanilla 2.0 - 2.8
First, thanks for the great software. I just discovered it after struggling for too long trying to get phpbb to really integrate with the rest of my site. I'm loving it.

I'm trying to include the header and sidebar menu from the rest of my site into my default.master template with simple code like this:
<?php include("../../../../header.inc"); ?>
But nothing renders and I get no errors. If I paste the xhtml from header.inc into that same spot it looks great. What's the right way to do this?

I should note that I'm adapting the theme "clean" which seems to use views with a .php extension as opposed to the .tpl views in BrandFriendly.

Thanks!

Comments

  • edited January 2011
    It turns out nothing complicated is going on. If I use an absolute path to the file I want to include, the include works as expected.
    <?php include("/path/to/site/root/includes/header.inc"); ?>

    For some reason I can't get any version of a relative path (as in the original question) to work, but that's ok. I'm back on track! thanks again for the top notch platform
  • you may refer what have defined in bootstrap.php
    <?php include PATH_LOCAL_ROOT.'/includes/header.inc'; ?>

Sign In or Register to comment.