* @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
{
/**
*
* @return void
*/
-
function handle($args)
{
header('Content-Type: text/xml; charset=UTF-8');
$this->elementStart('sitemapindex', array('xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9'));
- $this->showUserSitemaps();
$this->showNoticeSitemaps();
+ $this->showUserSitemaps();
$this->elementEnd('sitemapindex');
function showNoticeSitemaps()
{
- $noticeCounts = $this->getNoticeCounts();
+ $noticeCounts = Sitemap_notice_count::getAll();
foreach ($noticeCounts as $dt => $cnt) {
if ($cnt == 0) {
}
}
- 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);