You are here

function forum_page in Drupal 5

Same name and namespace in other branches
  1. 4 modules/forum.module \forum_page()
  2. 6 modules/forum/forum.pages.inc \forum_page()
  3. 7 modules/forum/forum.pages.inc \forum_page()

Menu callback; prints a forum listing.

1 string reference to 'forum_page'
forum_menu in modules/forum/forum.module
Implementation of hook_menu().

File

modules/forum/forum.module, line 834
Enable threaded discussions about general topics.

Code

function 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');
  $forum_per_page = variable_get('forum_per_page', 25);
  $sortby = variable_get('forum_order', 1);
  $forums = 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);
}