comment_get_display_page

Versions
mediamosa-21
comment_get_display_page($cid, $node_type)

Return the page number for a comment.

Finds the correct page number for a comment taking into account display and paging settings.

Parameters

$cid The comment ID.

$node_type The node type the comment is attached to.

Return value

The page number.

▾ 2 functions call comment_get_display_page()

comment_form_submit in modules/comment/comment.module
Process comment form submissions; prepare the comment, store it, and set a redirection target.
comment_permalink in modules/comment/comment.module
Redirects comment links to the correct page depending on comment settings.

Code

modules/comment/comment.module, line 1686

<?php
function comment_get_display_page($cid, $node_type) {
  $ordinal = comment_get_display_ordinal($cid, $node_type);
  $comments_per_page = variable_get('comment_default_per_page_' . $node_type, 50);
  return floor($ordinal / $comments_per_page);
}
?>