You are here

function mailhandler_term_map in Mailhandler 6

Same name and namespace in other branches
  1. 5 mailhandler.module \mailhandler_term_map()
  2. 7 mailhandler.module \mailhandler_term_map()

Accept a taxonomy term name and replace with a tid. this belongs in taxonomy.module.

1 string reference to 'mailhandler_term_map'
mailhandler_node_process_message_commands in ./mailhandler.module

File

./mailhandler.module, line 1026
Mailhandler module code.

Code

function mailhandler_term_map(&$term, $index = array(), $vid = FALSE) {

  // provide case insensitive and trimmed map so as to maximize likelihood of successful mapping
  if ($vid) {
    $and = 'AND vid =' . db_escape_string($vid);
  }
  $term = db_result(db_query("SELECT tid FROM {term_data} WHERE LOWER('%s') LIKE LOWER(name) {$and}", trim($term)));
}