X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fapitimelineuser.php;h=14c62a52e7db10f8e0e31f266571dccd71c83161;hb=f8764c02c97c175e7084b743d0af7c47c066ea88;hp=81e23116b73ba145d79afc8be2f8b404fda325e3;hpb=559918826a714c1ee2ecdc49dcfc2b67451a9864;p=quix0rs-gnu-social.git diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index 81e23116b7..14c62a52e7 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -21,6 +21,12 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author mac65 + * @author Mike Cochrane + * @author Robin Millette * @author Zach Copley * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 @@ -31,7 +37,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/apibareauth.php'; +require_once INSTALLDIR . '/lib/apibareauth.php'; /** * Returns the most recent notices (default 20) posted by the authenticating @@ -40,6 +46,12 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To + * @author mac65 + * @author Mike Cochrane + * @author Robin Millette * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ @@ -48,7 +60,6 @@ require_once INSTALLDIR.'/lib/apibareauth.php'; class ApiTimelineUserAction extends ApiBareAuthAction { - var $user = null; var $notices = null; /** @@ -64,16 +75,10 @@ class ApiTimelineUserAction extends ApiBareAuthAction { parent::prepare($args); - $this->page = (int)$this->arg('page', 1); - $this->count = (int)$this->arg('count', 20); - $this->max_id = (int)$this->arg('max_id', 0); - $this->since_id = (int)$this->arg('since_id', 0); - $this->since = $this->arg('since'); - $this->user = $this->getTargetUser($this->arg('id')); if (empty($this->user)) { - $this->clientError(_('No such user!'), 404, $this->format); + $this->clientError(_('No such user.'), 404, $this->format); return; } @@ -107,6 +112,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction function showTimeline() { $profile = $this->user->getProfile(); + $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); $sitename = common_config('site', 'name'); $title = sprintf(_("%s timeline"), $this->user->nickname); @@ -120,6 +126,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction _('Updates from %1$s on %2$s!'), $this->user->nickname, $sitename ); + $logo = ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE); // FriendFeed's SUP protocol // Also added RSS and Atom feeds @@ -129,12 +136,12 @@ class ApiTimelineUserAction extends ApiBareAuthAction switch($this->format) { case 'xml': - $this->show_xml_timeline($this->notices); + $this->showXmlTimeline($this->notices); break; case 'rss': - $this->show_rss_timeline( + $this->showRssTimeline( $this->notices, $title, $link, - $subtitle, $suplink + $subtitle, $suplink, $logo ); break; case 'atom': @@ -146,13 +153,13 @@ class ApiTimelineUserAction extends ApiBareAuthAction $selfuri = common_root_url() . 'api/statuses/user_timeline.atom'; } - $this->show_atom_timeline( + $this->showAtomTimeline( $this->notices, $title, $id, $link, - $subtitle, $suplink, $selfuri + $subtitle, $suplink, $selfuri, $logo ); break; case 'json': - $this->show_json_timeline($this->notices); + $this->showJsonTimeline($this->notices); break; default: $this->clientError(_('API method not found!'), $code = 404);