1 (edited by cutweed 2006-09-10 21:10)

Topic: Integration Issue with $pun_user

Hi,


I am intergrating punBB with my new website, which is developed in PHP and mostly in functions; this is where the problem begins...

with the standard protocols to include punBB user info:

-----------------------------------------------------------------------------------
$lang_common = 'English';

define('PUN_TURN_OFF_MAINT', 1);
define('PUN_QUIET_VISIT', 0);
define('PUN_ROOT', '../forum/');

require PUN_ROOT.'include/common.php';
----------------------------------------------------------------------------------

Therefore, I am facing two choices:

- whether to include this block of codes in a function and globalize $pun_user
- or to have the codes in an included file and pass the variables into the functions that I needed


I appreciate any suggestion and help,

thanks in advance,


cutweed

Re: Integration Issue with $pun_user

second is bit better as it doesn't use global variables smile

My site [PHP, Python, Linux]

Re: Integration Issue with $pun_user

Well, the second option "uses global variables" in that PunBB instanciates a number of global variables. I would still opt for it though.

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