Commit 17627967 authored by Earnie Boyd's avatar Earnie Boyd

#510076 The sitemap is not being submitted.

parent 59d2997c
$Id$
XML sitemap 6.x-1, 2009-07-24
-----------------------------------
#510076 The sitemap is not being submitted.
XML sitemap 6.x-1, 2009-07-16
-----------------------------------
#516876 Deleted items not removed from sitemap.
......
......@@ -19,25 +19,19 @@
* Implementation of hook_cron().
*/
function xmlsitemap_engines_cron() {
if (!variable_get('site_offline', 0) && (variable_get('xmlsitemap_engines_cron_submit_frequency', 3600) > 0 || variable_get('xmlsitemap_sitemap_is_changed', FALSE))) {
if ((REQUEST_TIME - variable_get('xmlsitemap_engines_cron_timestamp_submit', REQUEST_TIME)) >= variable_get('xmlsitemap_engines_cron_submit_frequency', 3600)) {
xmlsitemap_engines_ping_sitemap();
variable_set('xmlsitemap_sitemap_is_changed', FALSE);
variable_set('xmlsitemap_engines_cron_timestamp_submit', REQUEST_TIME);
}
if (variable_get('site_offline', 0)) {
return;
}
}
/**
* Implementation of hook_init().
*/
function xmlsitemap_engines_init() {
if (!variable_get('site_offline', 0) &&
arg(0) != 'batch' &&
variable_get('xmlsitemap_engines_submit', FALSE) &&
variable_get('xmlsitemap_sitemap_is_changed', FALSE)) {
$frequency = variable_get('xmlsitemap_engines_cron_submit_frequency', 3600);
$last_ping = variable_get('xmlsitemap_engines_cron_timestamp_submit', 0);
$submit_on_change = variable_get('xmlsitemap_engines_submit', FALSE);
$content_changed = variable_get('xmlsitemap_sitemap_is_changed', FALSE);
$ping_engines = ($submit_on_change && $content_changed) ||
((REQUEST_TIME - $last_ping) >= $frequency);
if ($ping_engines) {
xmlsitemap_engines_ping_sitemap();
variable_set('xmlsitemap_sitemap_is_changed', FALSE);
variable_set('xmlsitemap_engines_cron_timestamp_submit', REQUEST_TIME);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment