forum_page

Definition

forum_page($tid = 0)
modules/forum.module, line 728

Description

Menu callback; prints a forum listing.

Code

<?php
function forum_page($tid = 0) {
  global $user;

  if (module_exist('taxonomy')) {
    $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);
    }

    print theme('page', theme('forum_display', $forums, $topics, $parents, $tid, $sortby, $forum_per_page));
  }
  else {
    drupal_set_title(t('Warning'));
    print theme('page', forum_help('admin/settings/forum'));
  }
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.