"; print "[Close Window]"; } print 'Comment Listing'; print ''; $ili = isLoggedIn(); if ($ili == 1) { # Is logged in $id = sqlsanitize(intval(GetGlobal('rid'))); if ($id < 1) { print "I could not find that recipe. (Error Code 1)"; LinkToClose(); } else { $tmpres = DoQuery("select title from sweepstakes where id = $id", 'comment.php'); $tmptitle = trim($tmpres[0][0]); if ($tmptitle == '') { print "I could not find that recipe. (Error Code 2)"; LinkToClose(); } else { $rtitle = trim($tmptitle); # ---------------------------------------------------------------------- $tmpquery = "select mrb_users.email, mrb_comments.posted, mrb_comments.commenttext from mrb_users, mrb_comments where mrb_comments.recipeid = $id and mrb_users.userid = mrb_comments.userid order by mrb_comments.posted desc"; //$commres = DoQuery($tmpquery, 'comments.php'); $commcnt = count($commres); if (trim($commres[0][0]) == '') { $commcnt--; } if ($commcnt == 1) { print '1 COMMENT'; } else { print "$commcnt COMMENTS"; } print " on ${rtitle}:"; print '
(Most recent comments on top)

'; global $SANS; if ($commcnt < 1) { # No comments. print ""; print 'The comments on this recipe can not be displayed.   '; print ''; } else { # Some comments. print '
'; for ($cc = 0; $cc < $commcnt; $cc++) { $emailtmp = $commres[$cc][0]; $emailtmp = ereg_replace("@", "\"\"", $emailtmp); $datetmp = $commres[$cc][1]; $commenttmp = trim($commres[$cc][2]); $commenttmp = ereg_replace('^"', '', $commenttmp); $commenttmp = ereg_replace('"$', '', $commenttmp); $commenttmp = "\"${commenttmp}\""; print ""; print '"; } print '
$emailtmp - $datetmp
 '; print ''; print $commenttmp; print "

'; } print ''; print '
'; LinkToClose(); print '
'; # ---------------------------------------------------------------------- } } } else { print "You must be logged in to access this page."; LinkToClose(); } print ''; ?>