You are here

function _fetch_keywords in Glossify 6

Same name and namespace in other branches
  1. 6.3 glossify.module \_fetch_keywords()

Helper function that fetches and returns an array of all keywords of a node, or just the ones for a specific method.

2 calls to _fetch_keywords()
glossify_nodeapi in ./glossify.module
Implementation of hook_nodeapi().
_fetch_affected_keywords in ./glossify.module
Helper function that fetches and returns an array of all new and old keywords of a node, depending on the method.

File

./glossify.module, line 407

Code

function _fetch_keywords($nid, $method = FALSE) {
  $q = db_query("SELECT term, method FROM {glossify} WHERE nid = %d ORDER BY term", $nid);
  $glossary = array();
  while ($r = db_fetch_array($q)) {
    if ($method) {
      if ($method == $r['method']) {
        $glossary[] = $r['term'];
      }
    }
    else {
      $glossary[$r['method']][] = $r['term'];
    }
  }
  return $glossary;
}