xmlsitemap_node_frequency($node)
contributions/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module, line 95
Calculate the change frequency of a node.
$node: Data for a node retrieved by _xmlsitemap_node_links().
Number of seconds between updates
| Name | Description |
|---|---|
| XML Sitemap | Notify search engines of site updates. |
function xmlsitemap_node_frequency($node) {
$age = time() - $node->changed;
if (variable_get('xmlsitemap_node_count_comments', TRUE)) {
$age = time() - max($node->changed, $node->last_comment_timestamp);
$interval = 0;
if (!empty($node->previously_changed) && isset($node->previous_comment)) {
$interval = min($node->changed, $node->last_comment_timestamp) - max($node->previously_changed, $node->previous_comment);
}
elseif (!empty($node->previously_changed)) {
$interval = min($node->changed, $node->last_comment_timestamp) - $node->previously_changed;
}
elseif (isset($node->previous_comment)) {
$interval = min($node->changed, $node->last_comment_timestamp) - $node->previous_comment;
}
}
else {
$interval = empty($node->previously_changed) ? 0 : $node->changed - $node->previously_changed;
}
return max($age, $interval);
}