You are here

function advanced_forum_page in Advanced Forum 6

Same name and namespace in other branches
  1. 5 advanced_forum.module \advanced_forum_page()
  2. 6.2 includes/core-overrides.inc \advanced_forum_page()
  3. 7.2 includes/core-overrides.inc \advanced_forum_page()

Menu callback; prints a forum listing.

This is copied from the forum module and adapted.

1 string reference to 'advanced_forum_page'
advanced_forum_menu_alter in ./advanced_forum.module
Implementation of hook_menu_alter().

File

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

Code

function advanced_forum_page($tid = 0) {
  if (!is_numeric($tid)) {
    return MENU_NOT_FOUND;
  }
  $tid = (int) $tid;
  _advanced_forum_add_files();
  $topics = '';
  $forum_per_page = variable_get('forum_per_page', 25);
  $sortby = variable_get('forum_order', 1);
  $forums = advanced_forum_get_forums($tid);
  $parents = taxonomy_get_parents_all($tid);
  if ($tid && !in_array($tid, variable_get('forum_containers', array()))) {
    $topics = forum_get_topics($tid, $sortby, $forum_per_page);
  }
  return theme('forums', $forums, $topics, $parents, $tid, $sortby, $forum_per_page);
}