You are here

nodewords_basic.install in Nodewords: D6 Meta Tags 6.3

Install, update and uninstall functions for the Basic meta tags module.

File

nodewords_basic/nodewords_basic.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the Basic meta tags module.
 */

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

/**
 * Implements hook_update_N().
 */
function nodewords_basic_update_6300() {
  $ret = array();
  $ret[] = update_sql("UPDATE nodewords SET content = REPLACE(content, 'indexfollow', 'index,follow') WHERE name='robots';");
  $ret[] = update_sql("UPDATE nodewords SET content = REPLACE(content, 'indexnofollow', 'index,nofollow') WHERE name='robots';");
  $ret[] = update_sql("UPDATE nodewords SET content = REPLACE(content, 'noindexfollow', 'noindex,follow') WHERE name='robots';");
  $ret[] = update_sql("UPDATE nodewords SET content = REPLACE(content, 'noindexnofollow', 'noindex,nofollow') WHERE name='robots';");
  return $ret;
}

/**
 * Implements hook_uninstall().
 */
function nodewords_basic_uninstall() {
  if (db_table_exists('nodewords')) {
    $metatags = array(
      'abstract',
      'canonical',
      'copyright',
      'description',
      'keywords',
      'revisit-after',
      'robots',
    );
    db_query("DELETE FROM {nodewords} WHERE name IN (" . db_placeholders($metatags, 'varchar') . ")", $metatags);
  }
  variable_del('nodewords_list_robots_index_follow');
  variable_del('nodewords_list_robots_value');
}