diff options
author | Ian Denhardt <ian@zenhack.net> | 2010-08-13 14:48:58 -0400 |
---|---|---|
committer | Ian Denhardt <ian@zenhack.net> | 2010-08-13 14:48:58 -0400 |
commit | b1c5cb9db99993fcea7c060bffa6d5d50f22a41f (patch) | |
tree | ad18b2aecce518d44d040f59b0e706bf128f43b9 /plugins/Sitemap | |
parent | df562a1d8f4515462b190a214a4b6642f7855130 (diff) | |
parent | ae696728f5edf8972c68c17ce9ea21f07d44cbed (diff) |
Merge branch '1.0.x' of /home/ian/public_html/statusnet-enhancements
Diffstat (limited to 'plugins/Sitemap')
-rw-r--r-- | plugins/Sitemap/sitemapaction.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/Sitemap/sitemapaction.php b/plugins/Sitemap/sitemapaction.php index 45edfccc5..73b9248a3 100644 --- a/plugins/Sitemap/sitemapaction.php +++ b/plugins/Sitemap/sitemapaction.php @@ -53,6 +53,8 @@ class SitemapAction extends Action function handle($args) { + parent::handle($args); + header('Content-Type: text/xml; charset=UTF-8'); $this->startXML(); @@ -67,6 +69,27 @@ class SitemapAction extends Action $this->endXML(); } + function lastModified() + { + $y = $this->trimmed('year'); + + $m = $this->trimmed('month'); + $d = $this->trimmed('day'); + + $y += 0; + $m += 0; + $d += 0; + + $begdate = strtotime("$y-$m-$d 00:00:00"); + $enddate = $begdate + (24 * 60 * 60); + + if ($enddate < time()) { + return $enddate; + } else { + return null; + } + } + function showUrl($url, $lastMod=null, $changeFreq=null, $priority=null) { $this->elementStart('url'); |