shorter replies rss

darcs-hash:20080707072754-84dde-861d5d2b0a75097042e8f8c13a80c68ba3a0edba.gz
This commit is contained in:
Evan Prodromou 2008-07-07 03:27:54 -04:00
parent 88ea4ddd2d
commit 33f0d97cf6

View File

@ -45,7 +45,7 @@ class RepliesrssAction extends Rss10Action {
$notices = array(); $notices = array();
$reply = new Reply(); $reply = new Reply();
$reply->profile_id = $this->user->id; $reply->profile_id = $user->id;
$reply->orderBy('modified DESC'); $reply->orderBy('modified DESC');
if ($limit) { if ($limit) {
$reply->limit(0, $limit); $reply->limit(0, $limit);
@ -53,20 +53,15 @@ class RepliesrssAction extends Rss10Action {
$cnt = $reply->find(); $cnt = $reply->find();
if ($cnt > 0) { if ($cnt) {
for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) { while ($reply->fetch()) {
if ($reply->fetch()) { $notice = new Notice();
$notice = new Notice(); $notice->id = $reply->notice_id;
$notice->id = $reply->notice_id; $result = $notice->find(true);
$result = $notice->find(true); if (!$result) {
if (!$result) { continue;
continue;
}
$notices[] = clone($notice);
} else {
// shouldn't happen!
break;
} }
$notices[] = clone($notice);
} }
} }