You are here

function site_verify_import_xmlsitemap in Site verification 6

Same name and namespace in other branches
  1. 7.2 site_verify.install \site_verify_import_xmlsitemap()
  2. 7 site_verify.install \site_verify_import_xmlsitemap()

Import data from XML sitemap engines.

2 calls to site_verify_import_xmlsitemap()
site_verify_install in ./site_verify.install
Implements hook_install().
site_verify_update_3 in ./site_verify.install

File

./site_verify.install, line 98
Install, update and uninstall functions for the site_verify module.

Code

function site_verify_import_xmlsitemap(&$ret) {
  $engines = array(
    'google',
    'bing',
    'yahoo',
  );
  foreach ($engines as $engine) {
    if ($file = db_escape_string(variable_get('xmlsitemap_engines_' . $engine . '_verify', ''))) {
      if (!db_result(db_query("SELECT 1 FROM {site_verify} WHERE engine = '%s' AND file <> '{$file}'", $engine))) {
        $file_content = db_escape_string(variable_get('xmlsitemap_engines_' . $engine . '_verify_string', ''));
        $ret[] = update_sql("INSERT INTO {site_verify} (engine, file, file_contents, meta) VALUES ('{$engine}', '{$file}', '{$file_content}', '')");
      }
    }
    variable_del('xmlsitemap_engines_' . $engine . '_verify');
    variable_del('xmlsitemap_engines_' . $engine . '_verify_string');
  }
}