/[drupal]/contributions/modules/taxonomy_menu/taxonomy_menu.database.inc
ViewVC logotype

Diff of /contributions/modules/taxonomy_menu/taxonomy_menu.database.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.16, Sat Oct 31 20:15:22 2009 UTC revision 1.1.2.17, Thu Nov 5 01:48:36 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2    
3  // $Id: taxonomy_menu.database.inc,v 1.1.2.15 2009/10/31 18:39:33 indytechcook Exp $  // $Id: taxonomy_menu.database.inc,v 1.1.2.16 2009/10/31 20:15:22 indytechcook Exp $
4    
5  /**  /**
6   * @file   * @file
7   * Database functions   * Database functions
8   *   *
9   * @author Neil Hastings      <http://drupal.org/user/245817>   * @author Neil Hastings      <http://drupal.org/user/245817>
10   * @author Mark Theunissen    <http://drupal.org/user/108606>   * @author Mark Theunissen    <http://drupal.org/user/108606>
11   * @author Afief Halumi       <http://drupal.org/user/237472>   * @author Afief Halumi       <http://drupal.org/user/237472>
# Line 69  function _taxonomy_menu_delete_all($vid) Line 69  function _taxonomy_menu_delete_all($vid)
69    
70  /**  /**
71   * Get an array of the tid's related to the node   * Get an array of the tid's related to the node
72   *   *
73   * @param $nid   * @param $nid
74   * @return array of tids   * @return array of tids
75   */   */
# Line 84  function _taxonomy_menu_get_node_terms($ Line 84  function _taxonomy_menu_get_node_terms($
84    
85  /**  /**
86   * Get an array of the tid's from the parent   * Get an array of the tid's from the parent
87   *   *
88   * @param $tid   * @param $tid
89   * @return array of tid   * @return array of tid
90   */   */
# Line 94  function _taxonomy_menu_get_parents($tid Line 94  function _taxonomy_menu_get_parents($tid
94    foreach ($result as $key => $item) {    foreach ($result as $key => $item) {
95      $output[] = $key;      $output[] = $key;
96    }    }
97    return $output;    return $output;
98  }  }
99    
100  /**  /**
# Line 124  function _taxonomy_menu_get_terms($vid) Line 124  function _taxonomy_menu_get_terms($vid)
124    
125  /**  /**
126   * used to get the count without children   * used to get the count without children
127   *   *
128   * @param $tid   * @param $tid
129   */   */
130  function _taxonomy_menu_term_count($tid) {  function _taxonomy_menu_term_count($tid) {
# Line 150  function _taxonomy_menu_get_tid($mlid) { Line 150  function _taxonomy_menu_get_tid($mlid) {
150  function _taxonomy_menu_get_item($mlid) {  function _taxonomy_menu_get_item($mlid) {
151    return db_fetch_array(db_query('SELECT tid, vid FROM {taxonomy_menu} WHERE mlid = %d', $mlid));    return db_fetch_array(db_query('SELECT tid, vid FROM {taxonomy_menu} WHERE mlid = %d', $mlid));
152  }  }
153    
154    /**
155     * Get the vocabulary for a tid
156     * @param $tid array of tids
157     * @return $vid
158     */
159    function _taxonomy_menu_get_vid_by_tid($tid) {
160      $tids = implode(',', $tid);
161      $result = db_query("SELECT vid FROM {term_data} WHERE tid in (%s)", $tids);
162      $vids = array();
163      while ($data = db_fetch_object($result)) {
164        $vids[$data->vid] = $data->vid;
165      }
166      return $vids;
167    }

Legend:
Removed from v.1.1.2.16  
changed lines
  Added in v.1.1.2.17

  ViewVC Help
Powered by ViewVC 1.1.2