diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/User.php | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/classes/User.php b/classes/User.php index 1772b82e0..4f46653e4 100644 --- a/classes/User.php +++ b/classes/User.php @@ -128,23 +128,17 @@ class User extends DB_DataObject return true; } - - function noticesWithFriends() { + + function noticesWithFriends($offset=0, $limit=20) { $notice = new Notice(); - $notice->selectAs(); - - $subscription = new Subscription(); + $notice->query('SELECT notice.* ' . + 'FROM notice JOIN subscription on notice.profile_id = subscription.subscribed' . + 'WHERE subscription.subscriber = ' . $this->id . + 'ORDER BY created DESC, notice.id DESC ' . + 'LIMIT ' . $offset . ', ' . $limit); - $subscription->subscriber = $this->id; - - $notice->joinAdd($subscription); - $notice->whereAdd('notice.profile_id = subscription.subscribed'); - $notice->selectAs($subscription, 'sub_%'); - - $notice->orderBy('created DESC, notice.id DESC'); - return $notice; } } |