Just do something like this:
Assuming your current html page is "usercomments.html"
Make a new template called "usercomments" and dump all of "usercomments.html" into it.
The make a file called "usercomments.php" with the following code:
Code:
<?
require("global.php");
if ($bbuserid == 0)
{
eval("echo standarderror(\$bbtitle,\"".gettemplate("error_nopermission")."\");");
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( "echo dovars(\"" . gettemplate( "usercomments" ) . "\");" );
?>
Now when the user accesses the page, if they are logged in they see the contents of the "usercomments" template. If they arent logged in they are prompted to enter a username and password
HTH
~Chris