I dont know if this is what you are searching for. I did this with my chat. When someone is not registered they receive the template: error_nopermission_loggedout if they are a member they will c the template chat:
PHP Code:
<?
require("global.php");
if ($bbuserid == 0)
{
eval("dooutput(\"".gettemplate("error_nopermission_loggedout")."\");");
exit;
}
if ($bbusername == "" || (isset($bbusername))==0)
{
$getusername=$DB_site->query_first("SELECT username FROM user WHERE userid=$bbuserid");
$username=$getusername[username];
$bbusername = $username;
}
else
{
$username = $bbusername;
}
eval("dooutput(\"".gettemplate("chat")."\");");
?>