$commenter = $usrdata['userid']; $gameid = $ID; $comment = clean($_POST['comment']); $date = time(); if($autoapprovecomments == 1){ $approved = 1; }else{ $approved = 0; } $db->query(sprintf('INSERT INTO dd_comments SET gameid=\'%u\', commenter=\'%u\', comment=\'%s\', date=\'%u\', approved=\'%u\' ', $ID, $commenter, $comment, $date, $approved)); if($autoapprovecomments == 1){ $msgcom = 'Comment Posted.'; }else{ $msgcom = 'Comment Posted, Awaiting admin approval.'; } echo '<div class=\'msg\'>'.$msgcom.'</div><br />';}
if(!isset($userid)){ echo 'Please login first.'; exit;}if($_SESSION['ALREADYCOMMENTED'] != $ID){ $commenter = $usrdata['userid']; $gameid = $ID; $comment = clean($_POST['comment']); $date = time(); if($autoapprovecomments == 1){ $approved = 1; }else{ $approved = 0; } $db->query(sprintf('INSERT INTO dd_comments SET gameid=\'%u\', commenter=\'%u\', comment=\'%s\', date=\'%u\', approved=\'%u\' ', $ID, $commenter, $comment, $date, $approved)); if($autoapprovecomments == 1){ $msgcom = 'Comment Posted.'; }else{ $msgcom = 'Comment Posted, Awaiting admin approval.'; } echo '<div class=\'msg\'>'.$msgcom.'</div><br />'; $_SESSION['ALREADYCOMMENTED'] = $ID;}}