function printError($scriptName, $startTime, $title, $error) { printHTMLheader("RUBBoS ERROR: {$title}"); print "<h2>We cannot process your request due to the following error :</h2><br>\n"; print $error; printHTMLfooter($scriptName, $startTime); }
} $i++; } } while ($i < 6) { print "<OPTION value=\"{$i}\">{$i}: 0 comment</OPTION>\n"; $i++; } print "</SELECT>    <SELECT name=display>\n" . "<OPTION value=\"0\">Main threads</OPTION>\n" . "<OPTION selected value=\"1\">Nested</OPTION>\n" . "<OPTION value=\"2\">All comments</OPTION>\n" . "</SELECT>    <input type=submit value=\"Refresh display\"></center><p>\n"; $display = 1; $filter = 0; // Display the comments $comment = mysql_query("SELECT * FROM {$comment_table} WHERE story_id={$storyId} AND parent=0 AND rating>={$filter}", $link) or die("ERROR: Query failed"); while ($comment_row = mysql_fetch_array($comment)) { print "<br><hr><br>"; $username = getUserName($comment_row["writer"], $link); print "<TABLE width=\"100%\" bgcolor=\"#CCCCFF\"><TR><TD><FONT size=\"4\" color=\"#000000\"><B><a href=\"ViewComment.php?comment_table={$comment_table}&storyId={$storyId}&commentId=" . $comment_row["id"] . "&filter={$filter}&display={$display}\">" . $comment_row["subject"] . "</a></B> </FONT> (Score:" . $comment_row["rating"] . ")</TABLE>\n"; print "<TABLE><TR><TD><B>Posted by " . $username . " on " . $comment_row["date"] . "</B><p>\n"; print "<TR><TD>" . $comment_row["comment"]; print "<TR><TD><p>[ <a href=\"PostComment.php?comment_table={$comment_table}&storyId={$storyId}&parent=" . $comment_row["id"] . "\">Reply to this</a> | " . "<a href=\"ViewComment.php?comment_table={$comment_table}&storyId={$storyId}&commentId=" . $comment_row["parent"] . "&filter={$filter}&display={$display}\">Parent</a>" . " | <a href=\"ModerateComment.php?comment_table={$comment_table}&commentId=" . $comment_row["id"] . "\">Moderate</a> ]</TABLE>\n"; if ($comment_row["childs"] > 0) { display_follow_up($comment_row[id], 1, $display, $filter, $link, $comment_table); } } mysql_free_result($result); mysql_close($link); printHTMLfooter($scriptName, $startTime); ?> </body> </html>