Sweet, I got it working. I changed my variable name and it worked.
1 2006-09-04 17:06
Re: Problems Integrating (5 replies, posted in PunBB 1.2 modifications, plugins and integrations)
2 2006-09-04 16:57
Re: Problems Integrating (5 replies, posted in PunBB 1.2 modifications, plugins and integrations)
I am assuming I need to add something to this effect?
define('PUN_USER', $pun_user['username']);
Then use that within my functions. Which works great. However when I try to add something like
define('PUN_GUEST', $pun_user['is_guest']);
I just get a 3
3 2006-09-04 16:45
Re: Problems Integrating (5 replies, posted in PunBB 1.2 modifications, plugins and integrations)
When I echo $pun_user['is_guest'] I get a 3
What does that mean?
4 2006-09-04 16:23
Topic: Problems Integrating (5 replies, posted in PunBB 1.2 modifications, plugins and integrations)
I have added the includes and I am able to access other functions within common.php, but for some reason I cannot access the $pun_user array.
Here is my code
$punbb_path = './forums/';
define('PUN_ROOT', "$punbb_path");
require PUN_ROOT.'include/common.php';
define('PUN_TURN_OFF_MAINT', 1); // if forums go down the site will not
define('PUN_QUIET_VISIT', 0); // update last visit when outside of the forums
function showloggedin(){
if ($pun_user['id'] > 1){
echo '<p class="loginbox">You are currently logged in as <strong>' . $pun_user['username'] . '.</strong> > <a href="' . $_SERVER['PHP_SELF'] . '?p=logout">Logout</a></p>';
}else{
echo '<p class="loginbox">You are not currently logged in. Please <a href="' . $_SERVER['PHP_SELF'] . '?p=login">login</a> or <a href="' . $_SERVER['PHP_SELF'] . '?p=register">register</a>.</p>';
}
}
I used the $pun_user['id'] to test if the user was logged in, but I am sure there is probably a better way, so that is the second part of my question. I have tried simply echoing the $pun_user['username'] with no luck. I am sure I am logged into the forums.
Any help is much appreciated.