Topic: punBB more integration-friendly

Some small hacks that could be added to vanilla punBB.

header.php
change:

<link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />

to:

<link rel="stylesheet" type="text/css" href="<?PHP echo PUN_ROOT.'/'; ?>style/<?php echo $pun_user['style'].'.css' ?>" />

CSS is visible for punbb pages included from outsite the forum (like in a script).


register.php
- form ACTION could be changed to:

<?PHP
        IF(ereg('\?', $_SERVER['REQUEST_URI']))
            {
            $act = $_SERVER['REQUEST_URI'].'&';
            }
        else
            {
            $act = $_SERVER['REQUEST_URI'].'?';
            }
        ?>
        <form id="register" method="post" action="<?PHP echo $act; ?>action=register" onsubmit="this.register.disabled=true;if(process_form(this)){return true;}else{this.register.disabled=false;return false;}">

(instead register.php?action=register)
and

require PUN_ROOT.'include/common.php';

to:

require_once PUN_ROOT.'include/common.php';

Allows adding registration in the integrated script smile in your CMS/Script add:

include_once PUN_ROOT.'register.php';

and you will have punBB registration - it will look like punBB but it will "use" the script links like "index.php?mod=user&act=register" for my RkCMF

My site [PHP, Python, Linux]

Re: punBB more integration-friendly

the PUN_ROOT in header.php causes problems if you have a different local fodler structure to external folder structure, e.g. including via a subdomain cos they are just in separate folders on the server

Re: punBB more integration-friendly

try using the base url, (dont know it off hand) cuz it will go direct to the file url.

Re: punBB more integration-friendly

The first thing has been dealt with in PunBB 1.3. It outputs the <base> tag in the HTML head.

"Programming is like sex: one mistake and you have to support it for the rest of your life."