Rhodes wrote:Well what I want is briefly the following: I have a site and a forum. I now want to include my forum into that side so that it looks like if the forum was displayed there in an iframe, but without using iframes. Therefore I wanted to hook into $template->display($handle, $include_once = true); so that my site header, footer and sidemenu is displayed as if it was done by $themplate->display().
For this, you could adjust the overall_header and footer within the phpBB template...
Dealing with changes to templates and so on I want to care for later, for now it would be nice if I only get an "hello" displayed above the forum header. With that I could at least imagine how to get the html for the divs from my site to bring it into phpBB's templatesystem.
The hook(s) is/are meant for executing external code from within the hooked function, not "using" the functions per se. Hooking the template->display() method is usually needed if you need to "bend" assigned variables or add/change assigned loops (for example someone could add a new "hand-made" forum using hooks). If you just want to "use" the template engine you need to use the template engine within your site.
Anyway... to hook template->display you would only need to embed phpBB into your site (with the code i posted above), register your hook (as explained within the doc) and then do the code magic from within your function which get called once template->display() is executed. But your approach is completely wrong for what you want to achive.
Authentication I want too, but I saw that there is an auth api what I planned to dig into later after I solved the displaying of the forum into my site.
No, the auth api is different (naming conflict for this doc, may be confusing). You need to have a look at includes/auth/*
So if one assumes my site is an application then yes I want to include phpBB into my application.
Never assume something.
![Wink ;)](./images/smilies/icon_e_wink.svg)
But if you want to see your site as an application, with it's own template engine, it's own authentication, permissions, session handling, etc. - then yes, it may be an application. But still, the goal need to fit too.
First of all, i would try to solve your "blank page" problem. With the code above (putting it into test.php within your sites folder and having phpBB within the phpbb folder one beneath [Adjust the path if needed] and executing yoursite/test.php should display the board index as if you called phpbb directly). This also leads to one essential problem in application integration. You usually always have to entry points - the board and the application. Therefore, it is suggested to put some files on "do not access mode".
![Wink ;)](./images/smilies/icon_e_wink.svg)
Some did this by making the apparent phpBB files inaccessible and routing pages through one of their site pages, for example:
Code: Select all
mysitecode/
board/
board_installation_hidden/
within board you would have the "router", within the site your site and within board_installation_hidden the sole boards code (without the need to ever really touch it).
As you can see by the above, it is not as easy as it sounds.
![Wink ;)](./images/smilies/icon_e_wink.svg)
And therefore not a shame if this is not crystal clear to you.