]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Sitemap/sitemapindex.php
Sitemap plugin no longer forces an index on user.created
[quix0rs-gnu-social.git] / plugins / Sitemap / sitemapindex.php
index a3328340fe83acd2f0e687ab1e4bb46d6d6e24ed..ab89c2156c936afd18b52f6ea5b64502bd6b80e0 100644 (file)
@@ -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 SitemapindexAction extends Action
 {
     /**
@@ -50,7 +49,6 @@ class SitemapindexAction extends Action
      *
      * @return void
      */
-
     function handle($args)
     {
         header('Content-Type: text/xml; charset=UTF-8');
@@ -58,8 +56,8 @@ class SitemapindexAction extends Action
 
         $this->elementStart('sitemapindex', array('xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9'));
 
-        $this->showUserSitemaps();
         $this->showNoticeSitemaps();
+        $this->showUserSitemaps();
 
         $this->elementEnd('sitemapindex');
 
@@ -89,7 +87,7 @@ class SitemapindexAction extends Action
 
     function showNoticeSitemaps()
     {
-        $noticeCounts = $this->getNoticeCounts();
+        $noticeCounts = Sitemap_notice_count::getAll();
 
         foreach ($noticeCounts as $dt => $cnt) {
             if ($cnt == 0) {
@@ -105,37 +103,6 @@ class SitemapindexAction extends Action
         }
     }
 
-    function getUserCounts()
-    {
-        return Sitemap_user_count::getAll();
-    }
-
-    function getNoticeCounts()
-    {
-        $noticeCounts = Notice::cacheGet('sitemap:notice:counts');
-
-        if ($noticeCounts === false) {
-
-            $notice = new Notice();
-
-            $notice->selectAdd();
-            $notice->selectAdd('date(created) as postdate, count(*) as postcount');
-            $notice->groupBy('postdate');
-
-            $notice->find();
-
-            $noticeCounts = array();
-
-            while ($notice->fetch()) {
-                $noticeCounts[$notice->postdate] = $notice->postcount;
-            }
-
-            Notice::cacheSet('sitemap:notice:counts', $noticeCounts);
-        }
-
-        return $noticeCounts;
-    }
-
     function showSitemap($prefix, $dt, $i)
     {
         list($y, $m, $d) = explode('-', $dt);