You are here

function biblio_get_keyword_by_name in Bibliography Module 6

Same name and namespace in other branches
  1. 6.2 includes/biblio.keywords.inc \biblio_get_keyword_by_name()
  2. 7 includes/biblio.keywords.inc \biblio_get_keyword_by_name()
  3. 7.2 includes/biblio.keywords.inc \biblio_get_keyword_by_name()

Parameters

$name:

Return value

array of keywords

1 call to biblio_get_keyword_by_name()
biblio_insert_keywords in ./biblio.keywords.inc

File

./biblio.keywords.inc, line 27

Code

function biblio_get_keyword_by_name($name) {
  static $keywords = array();
  if (!($kid = array_search($name, $keywords))) {
    $term = db_fetch_object(db_query("SELECT * FROM {biblio_keyword_data} k WHERE LOWER(k.word) = LOWER('%s')", trim($name)));
    if ($term) {
      $keywords[$term->kid] = $term;
      return $keywords[$term->kid];
    }
    else {
      return FALSE;
    }
  }
  return $keywords[$kid];
}