$_SESSION['liberty_comments_display_mode'] = $comments_display_style; } if (!empty($_REQUEST['comment_page']) || !empty($_REQUEST['post_comment_request'])) { $comments_at_top_of_page = 'y'; } $commentOffset = !empty($_REQUEST['comment_page']) ? ($_REQUEST['comment_page'] - 1) * $maxComments : 0; if (empty($gComment)) { $gComment = new LibertyComment(); } $currentPage = !empty($_REQUEST['comment_page']) ? $_REQUEST['comment_page'] : 1; if ($currentPage < 1) { $currentPage = 1; } # logic to support displaying a single comment -- used when we need a URL pointing to a comment if (!empty($_REQUEST['view_comment_id'])) { $commentOffset = $gComment->getNumComments_upto($_REQUEST['view_comment_id']); # echo "commentOffset =$commentOffset= maxComments=$maxComments=\n"; $comments_sort_mode = 'commentDate_asc'; $comments_display_style = 'flat'; $comments_at_top_of_page = 'y'; $maxComments = 1; $currentPage = ceil($commentOffset + 1 / $maxComments); } else { $commentOffset = ($currentPage - 1) * $maxComments; } // $commentsParentId is the content_id which the comment tree is attached to if (!@BitBase::verifyId($commentsParentId)) { $comments = array(); $numComments = 0; } else { if (@BitBase::verifyId($commentsParentIds)) {