function getTags()
{
$notice_tag = new Notice_tag;
- $query = 'select tag,count(tag) as weight from notice_tag join file_to_post on (notice_tag.notice_id=post_id) join notice on notice_id = notice.id where file_id=' . $notice_tag->escape($this->out->attachment->id) . ' group by tag order by weight desc';
+ $query = 'select tag, notice_id, count(tag) as weight from notice_tag join file_to_post on (notice_tag.notice_id=post_id) join notice on notice_id = notice.id where file_id=' . $notice_tag->escape($this->out->attachment->id) . ' group by tag order by weight desc';
$notice_tag->query($query);
return $notice_tag;
}
$namestring = implode(',', $quoted);
- $qry = 'SELECT notice_tag.tag, '.
+ $qry = 'SELECT notice_tag.tag, notice_tag.notice_id, '.
$weightexpr . ' as weight ' .
'FROM notice_tag JOIN notice ' .
'ON notice_tag.notice_id = notice.id ' .
$weightexpr = common_sql_weight('notice_tag.created', common_config('tag', 'dropoff'));
// @fixme should we use the cutoff too? Doesn't help with indexing per-user.
- $qry = 'SELECT notice_tag.tag, '.
+ $qry = 'SELECT notice_tag.tag, notice_tag.notice_id, '.
$weightexpr . ' as weight ' .
'FROM notice_tag JOIN notice ' .
'ON notice_tag.notice_id = notice.id ' .
$weightexpr = common_sql_weight('notice_tag.created', common_config('tag', 'dropoff'));
// @fixme should we use the cutoff too? Doesn't help with indexing per-user.
- $qry = 'SELECT notice_tag.tag, '.
+ $qry = 'SELECT notice_tag.tag, notice_tag.notice_id, '.
$weightexpr . ' as weight ' .
'FROM notice_tag JOIN notice ' .
'ON notice_tag.notice_id = notice.id ' .
$weightexpr = common_sql_weight('notice_tag.created', common_config('tag', 'dropoff'));
// @fixme should we use the cutoff too? Doesn't help with indexing per-user.
- $qry = 'SELECT notice_tag.tag, '.
+ $qry = 'SELECT notice_tag.tag, notice_tag.notice_id, '.
$weightexpr . ' as weight ' .
'FROM notice_tag JOIN notice ' .
'ON notice_tag.notice_id = notice.id ' .