fixup tag display code

darcs-hash:20080928181503-5ed1f-4a4046000646530b8462f06d0cfc0d2fe862dc48.gz
This commit is contained in:
Evan Prodromou 2008-09-28 14:15:03 -04:00
parent fc7f32e35d
commit ddf2dce601

View File

@ -159,23 +159,17 @@ class TagAction extends StreamAction {
function show_notices($tag) { function show_notices($tag) {
$notices = Notice_tag::getStream($tag, (($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1); $cnt = 0;
$notice = Notice_tag::getStream($tag, (($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
if ($cnt > 0) {
if ($notice) {
common_element_start('ul', array('id' => 'notices')); common_element_start('ul', array('id' => 'notices'));
for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) { while ($notice->fetch()) {
if ($tags->fetch()) { $cnt++;
$notice = new Notice(); if ($cnt > NOTICES_PER_PAGE) {
$notice->id = $tags->notice_id;
$result = $notice->find(true);
if (!$result) {
continue;
}
$this->show_notice($notice);
} else {
// shouldn't happen!
break; break;
} }
$this->show_notice($notice);
} }
common_element_end('ul'); common_element_end('ul');
} }