Commit 9e670466 authored by Earnie Boyd's avatar Earnie Boyd

#548064 Sitemap is submitted on every cron run with "update when new content"

        and no new content is added.
parent 909c58ba
......@@ -3,6 +3,8 @@ $Id$
XML sitemap 6.x-1, 2009-08-21
-----------------------------------
#550578 Update #6106: Update in {variable} table failed.
#548064 Sitemap is submitted on every cron run with "update when new content"
and no new content is added.
XML sitemap 6.x-1, 2009-08-19
-----------------------------------
......
......@@ -69,6 +69,7 @@ function xmlsitemap_node_cron() {
WHERE xn.nid IS NULL
AND n.status <> 0";
$result = db_query_range($sql, 0, $limit);
$sitemap_changed = FALSE;
while ($node = db_fetch_object($result)) {
if (module_exists('comment')) {
$maxcomments = (integer) db_result(db_query('SELECT MAX(comment_count) FROM {node_comment_statistics}'));
......@@ -88,8 +89,9 @@ function xmlsitemap_node_cron() {
$row->comment_ratio = $comments / $maxcomments;
}
drupal_write_record('xmlsitemap_node', $row);
$sitemap_changed = TRUE;
}
if ($result) {
if ($sitemap_changed) {
xmlsitemap_flag_sitemap();
}
}
......
......@@ -24,14 +24,16 @@ function xmlsitemap_taxonomy_cron() {
LEFT JOIN {xmlsitemap_taxonomy} xt ON xt.tid = t.tid
WHERE xt.tid IS NULL";
$result = db_query_range($sql, 0, $limit);
$sitemap_changed = FALSE;
while ($term = db_fetch_object($result)) {
$row = new stdClass();
$row->tid = $term->tid;
$row->vid = $term->vid;
$row->changed = REQUEST_TIME;
drupal_write_record('xmlsitemap_taxonomy', $row);
$sitemap_changed = TRUE;
}
if ($result) {
if ($sitemap_changed) {
xmlsitemap_flag_sitemap();
}
}
......
......@@ -26,14 +26,16 @@ function xmlsitemap_user_cron() {
AND u.uid <> 0
AND u.status <> 0";
$result = db_query_range($sql, 0, $limit);
$sitemap_changed = FALSE;
while ($account = db_fetch_object($result)) {
$row = new stdClass();
$row->uid = $account->uid;
$row->changed = !empty($account->access) ? $account->access : REQUEST_TIME;
$row->previously_changed = $account->created;
drupal_write_record('xmlsitemap_user', $row);
$sitemap_changed = TRUE;
}
if ($result) {
if ($sitemap_changed) {
xmlsitemap_flag_sitemap();
}
}
......
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