You are here

function nodewords_load_tags in Nodewords: D6 Meta Tags 6.3

Same name and namespace in other branches
  1. 6 nodewords.module \nodewords_load_tags()
  2. 6.2 nodewords.module \nodewords_load_tags()

Load tags from table.

Parameters

$options: An array of options.

Return value

An array of meta tags data as saved in the database table.

7 calls to nodewords_load_tags()
nodewords_admin_form_taxonomy_form_term_alter in nodewords_admin/nodewords_admin.module
Implements hook_form_FORM_ID_alter().
nodewords_admin_form_taxonomy_form_vocabulary_alter in nodewords_admin/nodewords_admin.module
Implements hook_form_FORM_ID_alter().
nodewords_admin_tags_edit_form in nodewords_admin/nodewords_admin.admin.inc
Meta tags edit form.
nodewords_nodeapi in ./nodewords.module
Implements hook_nodeapi().
nodewords_preprocess_page in ./nodewords.module
Implements hook_preprocess_page().

... See full list

File

./nodewords.module, line 560
Implement an version that other modules can use to add meta tags.

Code

function nodewords_load_tags(array $options = array()) {
  global $language;
  $tags = array();
  $options += array(
    'language' => $language->language,
  ) + _nodewords_get_default_metatags_type();
  $tags_info = nodewords_get_possible_tags();
  $result = _nodewords_get_tags_data_query($options);
  while ($row = db_fetch_object($result)) {
    if (isset($tags_info[$row->name])) {
      $tags[$row->name] = unserialize($row->content);
    }
  }
  if (empty($tags) && $options['type'] == NODEWORDS_TYPE_TERM) {
    $id = db_result(db_query_range('SELECT vid FROM {term_data} WHERE tid = %d', $options['id'], 0, 1));
    if ($id !== FALSE) {
      $options['type'] = NODEWORDS_TYPE_VOCABULARY;
      $options['id'] = $id;
      return nodewords_load_tags($options);
    }
  }
  return $tags;
}