- $qry = 'SELECT notice.*, '.
- 'sum(exp(-(now() - fave.modified) / %s)) as weight ' .
- 'FROM notice JOIN fave ON notice.id = fave.notice_id ' .
- 'GROUP BY fave.notice_id ' .
- 'ORDER BY weight DESC';
-
- $offset = 0;
- $limit = NOTICES_PER_SECTION + 1;
-
- if (common_config('db', 'type') == 'pgsql') {
- $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
- } else {
- $qry .= ' LIMIT ' . $offset . ', ' . $limit;
+ $pop = new Popularity();
+ if (!empty($this->out->tag)) {
+ $pop->tag = $this->out->tag;