You are here

function advanced_forum_get_last_page in Advanced Forum 6.2

Same name and namespace in other branches
  1. 5 advanced_forum.module \advanced_forum_get_last_page()
  2. 6 advanced_forum.module \advanced_forum_get_last_page()
  3. 7.2 advanced_forum.module \advanced_forum_get_last_page()

Returns the page number of the last page starting at 0 like the pager does.

1 call to advanced_forum_get_last_page()
advanced_forum_last_post_link in ./advanced_forum.module
Get a link to the last post in a topic.

File

./advanced_forum.module, line 1013
Enables the look and feel of other popular forum software.

Code

function advanced_forum_get_last_page($node) {
  $comments_per_page = _comment_get_display_setting('comments_per_page', $node);
  $comment_count = $node->comment_count;
  $last_page = ceil($comment_count / $comments_per_page) - 1;
  return $last_page;
}