web/drupal/modules/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.install
branchdrupal
changeset 74 0ff3ba646492
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/drupal/modules/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.install	Fri Aug 21 16:26:26 2009 +0000
@@ -0,0 +1,107 @@
+<?php
+// $Id: xmlsitemap_engines.install,v 1.3.2.23 2009/07/16 14:34:36 earnie Exp $
+
+
+/**
+ * @file
+ * Installation file for XML sitemap engines.
+ */
+
+/*****************************************************************************
+ * Drupal hooks.
+ ****************************************************************************/
+
+/**
+ * Implementation of hook_install().
+ */
+function xmlsitemap_engines_install() {
+  db_query("UPDATE {system} SET weight = 15 WHERE name = 'xmlsitemap_engines'");
+  variable_set('xmlsitemap_engines_cron_timestamp_submit', 0);
+}
+
+/**
+ * Implementation of hook_update_N().
+ */
+function xmlsitemap_engines_update_6100() {
+  $ret[] = update_sql("DELETE FROM {variable} WHERE name = 'xmlsitemap_engines_cron_submit_delay'");
+  $variables = array(
+    'ask_url' => 'http://submissions.ask.com/ping?sitemap=[sitemap]',
+    'google_url' => 'http://www.google.com/webmasters/tools/ping?sitemap=[sitemap]',
+    'morover_url' => 'http://api.moreover.com/ping?u=[sitemap]',
+    'live_url' => 'http://webmaster.live.com/ping.aspx?siteMap=[sitemap]',
+    'yahoo_url' => 'http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=[sitemap]',
+  );
+  foreach ($variables as $variable => $value) {
+    variable_set('xmlsitemap_engines_'. $variable, $value);
+  }
+  variable_set('xmlsitemap_engines_cron_submit_frequency', 3600);
+  $ret[] = array(
+    'success' => TRUE,
+    'query' => 'Updated the module settings successfully.',
+  );
+  return $ret;
+}
+
+/**
+ * Implementation of hook_update_N().
+ */
+function xmlsitemap_engines_update_6106() {
+  $variables = array(
+    'submit',
+    'log_access',
+    'cron_submit_frequency',
+    'cron_submit_delay',
+  );
+  foreach ($variables as $variable) {
+    $ret[] = @update_sql("UPDATE {variable} SET name = 'xmlsitemap_engines_{$variable}' WHERE name = 'xmlsitemap_{$variable}'");
+    $ret[] = update_sql("DELETE FROM {variable} WHERE name = 'xmlsitemap_{$variable}'");
+  }
+  $ret[] = update_sql("UPDATE {system} SET weight = 15 WHERE name = 'xmlsitemap_engines'");
+  return $ret;
+}
+
+/**
+ * Update variables from Live Search to Bing.
+ */
+function xmlsitemap_engines_update_6107() {
+  $variables = array(
+    'submit' => FALSE,
+    'url' => 'http://webmaster.live.com/ping.aspx?siteMap=[sitemap]',
+    'verify' => '',
+    'verify_string' => '',
+  );
+  foreach ($variables as $variable => $default) {
+    $value = variable_get('xmlsitemap_engines_live_' . $variable, $default);
+    if ($variable == 'url' && $value == $default) {
+      $value = 'http://www.bing.com/webmaster/ping.aspx?siteMap=[sitemap]';
+    }
+    variable_set('xmlsitemap_engines_bing_' . $variable, $value);
+    variable_del('xmlsitemap_engines_live_' . $variable);
+  }
+  return array();
+}
+
+/**
+ * Set last submitted timestamp variable if non existent.
+ */
+function xmlsitemap_engines_update_6108() {
+  $ret = array();
+  $submitted = variable_get('xmlsitemap_engines_cron_timestamp_submit', FALSE);
+  if (!$submitted) {
+    variable_set('xmlsitemap_engines_cron_timestamp_submit', 0);
+    $t = get_t();
+    $ret[] = array(
+      'success' => TRUE,
+      'query' => $t('Variable "xmlsitemap_engines_cron_timestamp_submit" has been created.'),
+    );
+  }
+  return $ret;
+}
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function xmlsitemap_engines_uninstall() {
+  db_query("DELETE FROM {variable} WHERE name LIKE 'xmlsitemap\_engines\_'");
+}
+