Firstly, just add this:
PHP Code:
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
eval("\$logincode = \"".gettemplate('forumhome_logoutcode')."\";");
} else {
eval("\$logincode = \"".gettemplate('forumhome_logincode')."\";");
}
Also, make sure it appears
before the header template is called and
after functions.php, sessions.php, etc. are required.