diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-07-22 12:02:13 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-07-22 12:02:13 -0400 |
commit | 64ed01f0aff569da2fd4ed589df9ed4ee9852cb7 (patch) | |
tree | d385c10c3aef1408bf62fc9003bb2d697536e299 /actions/allrss.php | |
parent | ab1f2ff9d07088c7a3607ee6d05b1042d735960d (diff) |
centralize and optimize with-friends query
darcs-hash:20080722160213-84dde-2e466b9cc4601a8cb7237770a7df17a2f9dcadb9.gz
Diffstat (limited to 'actions/allrss.php')
-rw-r--r-- | actions/allrss.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/actions/allrss.php b/actions/allrss.php index 26e3f5241..a64b47641 100644 --- a/actions/allrss.php +++ b/actions/allrss.php @@ -42,17 +42,13 @@ class AllrssAction extends Rss10Action { function get_notices($limit=0) { $user = $this->user; - $notices = array(); - - $notice = DB_DataObject::factory('notice'); - - $notice->whereAdd('EXISTS (SELECT subscribed from subscription where subscriber = '.$user->id.' and subscribed = notice.profile_id)', 'OR'); - $notice->whereAdd('profile_id = ' . $user->id, 'OR'); - - $notice->orderBy('created DESC, notice.id DESC'); + + $notice = $user->noticesWithFriends(); + if ($limit != 0) { $notice->limit(0, $limit); } + $notice->find(); while ($notice->fetch()) { |