- function nextUrl()
- {
- if ($this->notice->fetch()) {
- return array(common_local_url('shownotice', array('notice' => $this->notice->id)),
- common_date_w3dtf($this->notice->created),
- null,
- null);
- } else {
- return null;
+ $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
+
+ $notice->orderBy('created');
+
+ $offset = ($i-1) * SitemapPlugin::NOTICES_PER_MAP;
+ $limit = SitemapPlugin::NOTICES_PER_MAP;
+
+ $notice->limit($offset, $limit);
+
+ $notice->find();
+
+ $n = array();
+
+ while ($notice->fetch()) {
+ $n[] = array($notice->id, $notice->created);
+ }
+
+ $c = Cache::instance();
+
+ if (!empty($c)) {
+ $c->set(Cache::key("sitemap:notice:$y:$m:$d:$i"),
+ $n,
+ Cache::COMPRESSED,
+ ((time() > $theend) ? (time() + 90 * 24 * 60 * 60) : (time() + 5 * 60)));
+ }