X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fallrss.php;h=9cbfe8dc8f2c58b5d4829bc8b7433cc039c8f891;hb=ba3ca4f6bbf203b810f26ca061087fcad28218e5;hp=7aab423b2725d8100c4494e92be62c9edfae5eb3;hpb=735b8ddc676cc7d85ca4256994755e61ea6023a1;p=quix0rs-gnu-social.git diff --git a/actions/allrss.php b/actions/allrss.php index 7aab423b27..9cbfe8dc8f 100644 --- a/actions/allrss.php +++ b/actions/allrss.php @@ -30,51 +30,41 @@ class AllrssAction extends Rss10Action { function init() { $nickname = $this->trimmed('nickname'); $this->user = User::staticGet('nickname', $nickname); - + if (!$this->user) { - common_user_error(_t('No such nickname.')); + common_user_error(_('No such user.')); return false; } else { return true; } } - - function get_notices($limit=0) { - - $user = $this->user; - $notices = array(); - - $notice = DB_DataObject::factory('notice'); - $notice->whereAdd('EXISTS (SELECT subscribed from subscription where subscriber = '.$profile->id.' and subscribed = notice.profile_id)', 'OR'); - $notice->whereAdd('profile_id = ' . $user->id, 'OR'); + function get_notices($limit=0) { - $notice->orderBy('created DESC'); - if ($limit != 0) { - $notice->limit(0, $limit); - } - $notice->find(); + $user = $this->user; + $notice = $user->noticesWithFriends(0, $limit); + while ($notice->fetch()) { $notices[] = clone($notice); } - + return $notices; } - + function get_channel() { $user = $this->user; $c = array('url' => common_local_url('allrss', - array('nickname' => + array('nickname' => $user->nickname)), - 'title' => $user->nickname . _t(' and friends'), + 'title' => sprintf(_('%s and friends'), $user->nickname), 'link' => common_local_url('all', array('nickname' => $user->nickname)), - 'description' => _t('Microblog feed for ') . $user->nickname); + 'description' => sprintf(_('Feed for friends of %s'), $user->nickname)); return $c; } - + function get_image() { $user = $this->user; $profile = $user->getProfile();