1 comment.module comment_get_display_page($cid, $node_type)

Returns the page number for a comment.

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


int $cid: The comment ID.

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

Return value

The page number.:


core/modules/comment/comment.module, line 1703
Enables users to comment on published content.


function comment_get_display_page($cid, $node_type) {
  $ordinal = comment_get_display_ordinal($cid, $node_type);
  $type = node_type_get_type($node_type);
  $comments_per_page = $type->settings['comment_per_page'];
  return floor($ordinal / $comments_per_page);