summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-05-31 07:50:27 -0700
committerEvan Prodromou <evan@status.net>2010-06-01 13:52:28 -0700
commit1066b264247811ec9371ff2f473f5d7f2a6dd98a (patch)
treeb080b57b7fffff0576a891ad19e88bb2b3a3b7c7
parentd78dfd627e558804c1ce79c69f586db29fa6c0fa (diff)
use sitemap_notice_count in sitemap index
-rw-r--r--plugins/Sitemap/sitemapindex.php37
1 files changed, 4 insertions, 33 deletions
diff --git a/plugins/Sitemap/sitemapindex.php b/plugins/Sitemap/sitemapindex.php
index a3328340f..5150b1aeb 100644
--- a/plugins/Sitemap/sitemapindex.php
+++ b/plugins/Sitemap/sitemapindex.php
@@ -58,8 +58,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 +89,9 @@ class SitemapindexAction extends Action
function showNoticeSitemaps()
{
- $noticeCounts = $this->getNoticeCounts();
+ $noticeCounts = Sitemap_notice_count::getAll();
+
+ common_debug(sprintf("Got %d notice counts", count($noticeCounts)));
foreach ($noticeCounts as $dt => $cnt) {
if ($cnt == 0) {
@@ -105,37 +107,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);