xmlsitemap_frequency($interval)
contributions/modules/xmlsitemap/xmlsitemap.module, line 370
Determine the frequency of updates to a link.
$interval: The number of seconds since last change
A string representing the update frequency according to the sitemaps.org protocol
| Name | Description |
|---|---|
| XML Sitemap | Notify search engines of site updates. |
function xmlsitemap_frequency($interval) {
$frequencies = array(
'always' => 3600,
'hourly' => 86400,
'daily' => 604800,
'weekly' => 2419200,
'monthly' => 29030400,
'yearly' => 100000000,
'never' => 0,
);
if (array_key_exists($interval, $frequencies)) {
$frequency = $interval;
}
else {
foreach ($frequencies as $frequency => $value) {
if ($interval < $value || $frequency == 'never') {
break;
}
}
}
return $frequency;
}