function render_post_comments($comments, $userID = null) { foreach ($comments as $row) { render_single_comment($row, $userID); } }
$newComment = BuckysComment::getComment($commentID); $newCount = BuckysComment::getPostCommentsCount($postID); render_result_xml(array('newcomment' => render_single_comment($newComment, $userID, true), 'count' => $newCount > 1 ? $newCount . " comments" : $newCount . " comment")); exit; } } //Getting More Comments if ($_POST['action'] == 'get-comments') { $postID = $_POST['postID']; $lastDate = $_POST['last']; $comments = BuckysComment::getPostComments($postID, $lastDate); //Show Results header('Content-type: application/xml'); $commentsHTML = ''; foreach ($comments as $comment) { $commentsHTML .= render_single_comment($comment, $userID, true); $lastDate = $comment['posted_date']; } $result = array('comment' => $commentsHTML); render_result_xml(array('comment' => $commentsHTML, 'lastdate' => $lastDate, 'hasmore' => $commentsHTML != '' && BuckysComment::hasMoreComments($postID, $lastDate) ? 'yes' : 'no')); } } else { if ($_GET['action']) { //Delete Post if ($_GET['action'] == 'delete-comment') { if (!$userID) { echo MSG_INVALID_REQUEST; exit; } $postID = $_GET['postID']; $commentID = $_GET['commentID'];