<?php
// $Id: site_verification.install,v 1.1.2.14 2009/09/23 09:38:51 kiam Exp $

/**
 * @file
 * Installation file for Site verification.
 */

/**
 * Implementation of hook_install().
 */
function site_verification_install() {
  $table = db_table_exists('nodewords') ? '{nodewords}' : '{metatags}';

  db_query("DELETE FROM {" . $table . "} WHERE type = 'frontpage' AND name = 'verification_code'");
  db_query("UPDATE {system} SET weight = 10 WHERE name = 'site_verification'");
}

/**
 * Implementation of hook_update_NN().
 */
function site_verification_update_6100() {
  $ret = array();

  $ret[] = update_sql("UPDATE {system} SET weight = 10 WHERE name = 'site_verification'");

  return $ret;
}

/**
 * Implementation of hook_uninstall().
 */
function site_verification_uninstall() {
  $table = db_table_exists('nodewords') ? '{nodewords}' : '{metatags}';

  if (db_table_exists($table)) {
    $metatags = array(
      'bing_webmaster_center',
      'google_webmaster_tools',
      'yahoo_site_explorer',
    );

    db_query("DELETE FROM {" . $table . "} WHERE name IN (" . db_placeholders($metatags, 'varchar') . ")", $metatags);
  }
}
