web/drupal/modules/forum/forum.pages.inc
branchdrupal
changeset 74 0ff3ba646492
equal deleted inserted replaced
73:fcf75e232c5b 74:0ff3ba646492
       
     1 <?php
       
     2 // $Id: forum.pages.inc,v 1.2.2.1 2009/07/01 20:51:55 goba Exp $
       
     3 
       
     4 /**
       
     5  * @file
       
     6  * User page callbacks for the forum module.
       
     7  */
       
     8 
       
     9 /**
       
    10  * Menu callback; prints a forum listing.
       
    11  */
       
    12 function forum_page($tid = 0) {
       
    13   if (!is_numeric($tid)) {
       
    14     return MENU_NOT_FOUND;
       
    15   }
       
    16   $tid = (int)$tid;
       
    17 
       
    18   $topics = '';
       
    19   $forum_per_page = variable_get('forum_per_page', 25);
       
    20   $sortby = variable_get('forum_order', 1);
       
    21 
       
    22   $forums = forum_get_forums($tid);
       
    23   $parents = taxonomy_get_parents_all($tid);
       
    24   if ($tid && !in_array($tid, variable_get('forum_containers', array()))) {
       
    25     $topics = forum_get_topics($tid, $sortby, $forum_per_page);
       
    26   }
       
    27 
       
    28   return theme('forums', $forums, $topics, $parents, $tid, $sortby, $forum_per_page);
       
    29 }