_forum_get_vid

Versions
4.6 – 5
_forum_get_vid()

Returns the vocabulary id for forum navigation.

▾ 5 functions call _forum_get_vid()

forum_form_container in modules/forum.module
Returns a form for adding a container to the forum vocabulary
forum_form_forum in modules/forum.module
Returns a form for adding a forum to the forum vocabulary
forum_overview in modules/forum.module
Returns an overview list of existing forums and containers
forum_taxonomy in modules/forum.module
Implementation of hook_taxonomy().
_forum_parent_select in modules/forum.module
Returns a select box for available parent terms

Code

modules/forum.module, line 269

<?php
function _forum_get_vid() {
  $vid = variable_get('forum_nav_vocabulary', '');
  if (empty($vid)) {
    // Check to see if a forum vocabulary exists
    $vid = db_result(db_query("SELECT vid FROM {vocabulary} WHERE module='%s'", 'forum'));
    if (!$vid) {
      $vocabulary = taxonomy_save_vocabulary(array('name' => 'Forums', 'multiple' => 0, 'required' => 1, 'hierarchy' => 1, 'relations' => 0, 'module' => 'forum', 'nodes' => array('forum')));
      $vid = $vocabulary['vid'];
    }
    variable_set('forum_nav_vocabulary', $vid);
  }

  return $vid;
}
?>
Login or register to post comments
 
 

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.