summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-09-28 14:15:03 -0400
committerEvan Prodromou <evan@controlyourself.ca>2008-09-28 14:15:03 -0400
commitddf2dce601e312fc06b38cb0dfb15857ff98ff7f (patch)
tree52a4ea47d2c5907b00bda918308d561d88107054
parentfc7f32e35d9c77037921fb4a6e40b7ca32baeb79 (diff)
fixup tag display code
darcs-hash:20080928181503-5ed1f-4a4046000646530b8462f06d0cfc0d2fe862dc48.gz
-rw-r--r--actions/tag.php22
1 files changed, 8 insertions, 14 deletions
diff --git a/actions/tag.php b/actions/tag.php
index 8b5548e45..177aee603 100644
--- a/actions/tag.php
+++ b/actions/tag.php
@@ -159,23 +159,17 @@ class TagAction extends StreamAction {
function show_notices($tag) {
- $notices = Notice_tag::getStream($tag, (($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
-
- if ($cnt > 0) {
+ $cnt = 0;
+ $notice = Notice_tag::getStream($tag, (($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
+
+ if ($notice) {
common_element_start('ul', array('id' => 'notices'));
- for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) {
- if ($tags->fetch()) {
- $notice = new Notice();
- $notice->id = $tags->notice_id;
- $result = $notice->find(true);
- if (!$result) {
- continue;
- }
- $this->show_notice($notice);
- } else {
- // shouldn't happen!
+ while ($notice->fetch()) {
+ $cnt++;
+ if ($cnt > NOTICES_PER_PAGE) {
break;
}
+ $this->show_notice($notice);
}
common_element_end('ul');
}