X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FSitemap%2FSitemap_notice_count.php;h=6e0061e97b083d5c07dd7ca7769f3a8e0fe49e06;hb=5110275a38f68a52114a5f51d661ace730a9428b;hp=673417b788471ea816baf24b1451b086552fe67a;hpb=d17dd32aacd52cefef7faab99fb728a21fc6e4b3;p=quix0rs-gnu-social.git diff --git a/plugins/Sitemap/Sitemap_notice_count.php b/plugins/Sitemap/Sitemap_notice_count.php index 673417b788..6e0061e97b 100644 --- a/plugins/Sitemap/Sitemap_notice_count.php +++ b/plugins/Sitemap/Sitemap_notice_count.php @@ -153,7 +153,9 @@ class Sitemap_notice_count extends Memcached_DataObject $noticeCounts[$snc->notice_date] = $snc->notice_count; } - self::cacheSet('sitemap:notice:counts', $noticeCounts); + // Cache notice counts for 4 hours. + + self::cacheSet('sitemap:notice:counts', $noticeCounts, null, time() + 4 * 60 * 60); } return $noticeCounts; @@ -208,6 +210,7 @@ class Sitemap_notice_count extends Memcached_DataObject { $notice = new Notice(); $notice->whereAdd('created BETWEEN "'.$d.' 00:00:00" AND "'.self::incrementDay($d).' 00:00:00"'); + $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC); $n = $notice->count(); return $n;