You are here

function advanced_forum_page in Advanced Forum 5

Same name and namespace in other branches
  1. 6.2 includes/core-overrides.inc \advanced_forum_page()
  2. 6 advanced_forum.module \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 in ./advanced_forum.module
Implementation of hook_menu().

File

./advanced_forum.module, line 946
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;
  drupal_add_css(drupal_get_path('module', 'forum') . '/forum.css');
  _advanced_forum_add_files();
  $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('forum_display', $forums, $topics, $parents, $tid, $sortby, $forum_per_page);
}