summaryrefslogtreecommitdiff
path: root/actions/tag.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/tag.php')
-rw-r--r--actions/tag.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/actions/tag.php b/actions/tag.php
index 02f3e3522..2202f9bb0 100644
--- a/actions/tag.php
+++ b/actions/tag.php
@@ -49,8 +49,18 @@ class TagAction extends Action
{
$pop = new PopularNoticeSection($this);
$pop->show();
- }
+ $notice_tag = new Notice_tag;
+ $query = 'select file_id, count(file_id) as c from notice_tag join file_to_post on post_id = notice_id where tag="' . $notice_tag->escape($this->tag) . '" group by file_id order by c desc';
+ $notice_tag->query($query);
+ $this->elementStart('ol');
+ while ($notice_tag->fetch()) {
+ $this->elementStart('li');
+ $this->element('a', array('class' => 'attachment', 'href' => common_local_url('attachment', array('attachment' => $notice_tag->file_id))), "Attachment tagged {$notice_tag->c} times");
+ $this->elementEnd('li');
+ }
+ $this->elementEnd('ol');
+ }
function title()
{