Drupal taxonomy term function

<?php
/**
 * Get for l_keywords from vocabulary to
 * dropbox in widget
 *
 */
function _get_l_keywords() {

   
$vid = cdt_keywordlink_get_vocabulary();
   
$pole = array();
   
$items = array();
   
$terms = taxonomy_get_tree($vid);

      if(
$result = db_query('SELECT * FROM {term_data} WHERE vid = %d', $vid)) {

        while (
$data = db_fetch_object($result)) {
         
$matches[$data->tid] =  check_plain($data->name);
        }
      }

      if (
count($matches) > 0) {
          return
$matches;
      }else{
         
drupal_set_message("There is no l_keywords registered in the cdt_keywordlink vocabulary.", "warning", FALSE);
      }
}




/**
 * Get vocabulary created by this module
 *
 */
function cdt_keywordlink_get_vocabulary() {

      if (
$result = db_query('SELECT * FROM {vocabulary} WHERE module LIKE "cdt_keywordlink"')) {
         
$vocabulary_result = db_fetch_array($result);
      }

      if (
is_numeric($vocabulary_result['vid'])) {
          return
$vocabulary_result['vid'];
      }else{
         
drupal_set_message("Can't find the vocabulary the cdt_keywordlink module created.", "warning", FALSE);
          return
FALSE;
      }

}
?>
Knowledge keywords: