1

Topic: What produces the 'message' page after registration?

I'm trying to use PunBB registration as registration for my main site. So PunBB is in a folder called 'forum' and I'm trying to make script files like register.php work on the root level.

I managed to get most of it working, but when I register the 'Thank you for registering...' message is output on a very ugly html page that apparantly attempts to pull the header and footer from the 'forum' folder. I get this error:

Warning: include(../common/footer.php) [function.include]: failed to open stream: No such file or directory in /home/mysite/public_html/forum/footer.php on line 102

Warning: include() [function.include]: Failed opening '../common/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mysite/public_html/forum/footer.php on line 102

Apparently the line below from register.php produces the ugly html file:

        message($lang_register['Reg e-mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);

Where does 'message' get its template or header/footer from? How can I force it to use my own customized punheader.php and punfooter.php?

Re: What produces the 'message' page after registration?

`message` is a function in PunBB's include/functions.php file. It includes PunBB's header and footer, just like other PunBB pages.

3 (edited by Peter 2007-03-05 00:18)

Re: What produces the 'message' page after registration?

guardian34 wrote:

`message` is a function in PunBB's include/functions.php file. It includes PunBB's header and footer, just like other PunBB pages.

OK, I had to make this change to let register.php use a customized function.php file:

define('PUN_ROOT', 'forum/');
require 'common/pun/common.php';

Re: What produces the 'message' page after registration?

Why not just

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

5 (edited by Peter 2007-03-05 03:00)

Re: What produces the 'message' page after registration?

Smartys wrote:

Why not just

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

Because the regular PUN_ROOT common.php and function.php files call the regular PUN_ROOT headers and footers, which doesn't work when you have the register.php at the root and the PunBB installation in a forum folder one level up.

Replacing Pun's headers and footers is annoyingly problematic as it is, because they contain so much required code. It makes it very complicated to integrate PunBB in another site.

Re: What produces the 'message' page after registration?

I'm confused: if you have a forum set up at ./forum/, then you'll have ./forum/header.php, which will load fine hmm

7

Re: What produces the 'message' page after registration?

Smartys wrote:

I'm confused: if you have a forum set up at ./forum/, then you'll have ./forum/header.php, which will load fine hmm

I have the forum at ./forum, but registration.php at the root.

Re: What produces the 'message' page after registration?

Which I assume is the file you're using this in. Plain PunBB will work fine with that. However, I realized reading your error that you hardcoded the path to your common footer in PunBB's footer.php, which is what's causing your error. smile

9 (edited by Peter 2007-03-05 16:54)

Re: What produces the 'message' page after registration?

Smartys wrote:

Which I assume is the file you're using this in. Plain PunBB will work fine with that. However, I realized reading your error that you hardcoded the path to your common footer in PunBB's footer.php, which is what's causing your error. smile

I know, I shouldn't have included that in my post. It confuses the issue. I still don't want register.php to get PunBB's regular header and footer. Anyway the stylesheet link was missing or didn't work either. Not sure if that was caused by another edit I had made.

I'm now using require 'common/pun/common.php'; to get message to include customized versions of the PunBB code.

Sure PunBB works best if you keep all the code as it is, but to integrate it into a site can require to pull the code apart and that's where it gets messy. I wish there was a lite version of PunBB without all the language files code and better seperation of php and html.