isLoggedIn())
{
apidb_header("Please login");
echo "To submit a comment for an application you must be logged in. Please login now or create a new account.","\n";
exit;
}
if( !is_numeric($aClean['iVersionId']) )
util_show_error_page('Internal Database Access Error');
if(!is_numeric($aClean['iThread']))
{
$aClean['iThread'] = 0;
}
// the user submitted his comment
if(!empty($aClean['sBody']))
{
$oComment = new Comment();
$oComment->create($aClean['sSubject'], $aClean['sBody'], $aClean['iThread'], $aClean['iVersionId']);
redirect(apidb_fullurl("appview.php?iVersionId=".$oComment->iVersionId));
// let's show the comment form
} else
{
apidb_header("Add Comment");
$mesTitle = "Post New Comment";
if($aClean['iThread'] > 0)
{
$hResult = query_parameters("SELECT * FROM appComments WHERE commentId = '?'",
$aClean['iThread']);
$oRow = mysql_fetch_object($hResult);
if($oRow)
{
$mesTitle = "Replying To ... $oRow->subject\n";
$originator = $oRow->userId;
echo html_frame_start($oRow->subject,500);
echo htmlify_urls($oRow->body), "
\n";
echo html_frame_end();
}
}
echo "