Topic: Integration of Search, Log-in

I'm looking to integrate punBB into a site I'm developing - the two major things I need to do are put a punBB search box on each page, and show the user if they're logged in (and give them a link to login/registration), on non-punBB pages of my site. Is there a simple way to do this?

Re: Integration of Search, Log-in

Oh, and one more question: If I'm modifying the header template (main.tpl) and using my own code - how do I make it display  'login' and 'register' only if the user is not logged in? I know there's PHP code to do it, but can't seem to find much info

Re: Integration of Search, Log-in

Check out the integration documentation and the search box topic.

Looking for a certain modification for your forum? Please take a look here before posting.

4

Re: Integration of Search, Log-in

i've been trying to integrate punBB stuff on to other pages on my website. the forum is at /discussion/, and my PUN_ROOT is set to './'

if i go in to the /my/ directory, and try and link back by putting in

define('PUN_ROOT', './discussion/');
require PUN_ROOT.'include/common.php';

it doesn't work, despite the "integration docs" saying this. if i change the /discussion/index.php (the punbb homepage) to './discussion/' from './', it just tanks, giving the following response:

response from /my/

Warning: require(./discussion/include/common.php) [function.require]: failed to open stream: No such file or directory in /home/main/public_html/my/index.php on line 6

Fatal error: require() [function.require]: Failed opening required './discussion/include/common.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/main/public_html/my/index.php on line 6

response from /discussions/ with PUN_ROOT set other than './'

Warning: require(./discussion/include/common.php) [function.require]: failed to open stream: No such file or directory in /home/main/public_html/discussion/index.php on line 27

Fatal error: require() [function.require]: Failed opening required './discussion/include/common.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/main/public_html/discussion/index.php on line 27

this is confusing the hell out of me, i can't grasp how PUN_ROOT is expected to work, and why it's not. it seems like it should be an absolute from the / of the site, but it doesn't function this way. and something's locked so that anything outside of /discussion/ can't talk to punBB.

all i want to do is have a line on each page (in all the different directories, such as /my/, /watch/, /create/, and so on), that says 'you're logged in', or 'you aren't logged in'. with a few extra links of course... plus i installed and spent 22hrs customising punBB so i could use the authentication and base user management for the whole site! eep.

i hope someone can help clear all this up for moose! thanks in advance smile

Re: Integration of Search, Log-in

PUN_ROOT is the relative path from the folder the file is in to the forum folder.
So if the file is in /my/ and the forum is in /discussion/, the PUN_ROOT is ../discussion/