X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FSitemap%2Fsitemapaction.php;h=ef77645c3166133aeeff59eddfd43574d0a7c2e1;hb=36b331d469b6dcd1101783f21265f7be624bc58f;hp=45edfccc51a05b6a4c8f70029a83e5a79f2adfbc;hpb=5a9ff7c575fb2b23d8b7b3eaf896852bb3501b80;p=quix0rs-gnu-social.git diff --git a/plugins/Sitemap/sitemapaction.php b/plugins/Sitemap/sitemapaction.php index 45edfccc51..ef77645c31 100644 --- a/plugins/Sitemap/sitemapaction.php +++ b/plugins/Sitemap/sitemapaction.php @@ -40,7 +40,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - class SitemapAction extends Action { /** @@ -50,9 +49,10 @@ class SitemapAction extends Action * * @return void */ - function handle($args) { + parent::handle($args); + header('Content-Type: text/xml; charset=UTF-8'); $this->startXML(); @@ -67,6 +67,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');