You are here

function comment_goodness_get_display_page in Comment goodness 7

Return the page number for a comment.

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

Parameters

$cid: The comment ID.

$node_type: The node type the comment is attached to.

Return value

The page number.

See also

comment_get_display_page

2 calls to comment_goodness_get_display_page()
comment_goodness_form_submit in ./comment_goodness.module
Form submit handler.
comment_goodness_permalink in ./comment_goodness.module
Redirects comment links to the correct page depending on comment settings.

File

./comment_goodness.module, line 545
Comment goodness provides newest to oldest comment sorting

Code

function comment_goodness_get_display_page($cid, $node_type) {
  $ordinal = comment_goodness_get_display_ordinal($cid, $node_type);
  $comments_per_page = variable_get('comment_default_per_page_' . $node_type, 50);
  return floor($ordinal / $comments_per_page);
}