function write_comment_thread($commentid, $showcomments, $orderby = "posttime", $descending = false) { validate_comment_id($commentid); $comment = get_comment($commentid); $user = get_user($comment['user']); write_comment_header($comment); write_comment_content($comment); write_comment_credits($comment); write_comment_ratings($comment); write_comment_reply_info($comment, $showcomments); write_comment_footer($comment); write_comment_reply_form($comment); write_comment_replies($comment, $showcomments, $orderby, $descending); }
function get_children_of_comment($commentid, $orderby = "posttime", $descending = false) { validate_comment_id($commentid); $con = db_connect(); $sql = "SELECT * FROM comments WHERE parent={$commentid} ORDER BY {$orderby}"; if ($descending) { $sql = $sql . " DESC"; } $result = mysql_query($sql); db_close($con); return $result; }