You are here

nodewords_extra.install in Nodewords: D6 Meta Tags 6

Same filename and directory in other branches
  1. 6.2 nodewords_extra/nodewords_extra.install

Installation file for nodewords_extra.module.

File

nodewords_extra/nodewords_extra.install
View source
<?php

/**
 * @file
 * Installation file for nodewords_extra.module.
 */

/**
 * Implements hook_install().
 */
function nodewords_extra_install() {
  db_query("UPDATE {system} SET weight = 14 WHERE name = 'nodewords_extra' AND type = 'module'");
}

/**
 * Next update ID: 6106.
 */

/**
 * Implements hook_update_N().
 */
function nodewords_extra_update_6106() {
  $ret = array();
  if (db_table_exists('nodewords')) {
    $ret[] = update_sql("DELETE FROM {nodewords} WHERE name IN ('pics-label')");
    $ret[] = array(
      'success' => TRUE,
      'query' => 'Removed support for the defunct FOSI ICRA meta tag.',
    );
  }
  variable_del('nodewords_icra_validation_content');
  return $ret;
}

/**
 * Converts the legacy "dc." meta tags to "dcterms." metatags.
 */
function nodewords_extra_update_6107() {
  $ret = array();
  $ret[] = update_sql("UPDATE {nodewords} SET name=REPLACE(name, 'dc.', 'dcterms.') WHERE name LIKE 'dc.%'");
  return $ret;
}

/**
 * Implements hook_uninstall().
 */
function nodewords_extra_uninstall() {
  if (db_table_exists('nodewords')) {
    $metatags = array(
      'dcterms.contributor',
      'dcterms.creator',
      'dcterms.date',
      'dcterms.publisher',
      'dcterms.title',
      'geourl',
      'location',
    );
    db_query("DELETE FROM {nodewords} WHERE name IN (" . db_placeholders($metatags, 'varchar') . ")", $metatags);
  }
}

Functions

Namesort descending Description
nodewords_extra_install Implements hook_install().
nodewords_extra_uninstall Implements hook_uninstall().
nodewords_extra_update_6106 Implements hook_update_N().
nodewords_extra_update_6107 Converts the legacy "dc." meta tags to "dcterms." metatags.