3 * To change this template, choose Tools | Templates
4 * and open the template in the editor.
7 class RemoteProfileAction extends ShowstreamAction
9 function prepare($args)
11 OwnerDesignAction::prepare($args); // skip the ProfileAction code and replace it...
13 $id = $this->arg('id');
15 $this->profile = Profile::staticGet('id', $id);
17 if (!$this->profile) {
18 // TRANS: Error message displayed when referring to a user without a profile.
19 $this->serverError(_m('User has no profile.'));
23 $user = User::staticGet('id', $this->profile->id);
25 // This is a local user -- send to their regular profile.
26 $url = common_local_url('showstream', array('nickname' => $user->nickname));
27 common_redirect($url);
31 $this->tag = $this->trimmed('tag');
32 $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
33 common_set_returnto($this->selfUrl());
37 function handle($args)
45 // maybe fixed in 0.9.x
46 if (!empty($this->profile->fullname)) {
47 $base = $this->profile->fullname . ' (' . $this->profile->nickname . ') ';
49 $base = $this->profile->nickname;
51 $host = parse_url($this->profile->profileurl, PHP_URL_HOST);
52 return sprintf(_m('%s on %s'), $base, $host);
56 * Instead of showing notices, link to the original offsite profile.
58 function showNotices()
60 $url = $this->profile->profileurl;
61 $host = parse_url($url, PHP_URL_HOST);
63 _m('This remote profile is registered on another site; see [%s\'s original profile page on %s](%s).'),
64 $this->profile->nickname,
67 $html = common_markup_to_html($markdown);
70 if ($this->profile->hasRole(Profile_role::SILENCED)) {
71 $markdown = _m('Site moderators have silenced this profile, which prevents delivery of new messages to any users on this site.');
72 $this->raw(common_markup_to_html($markdown));
82 * Don't do various extra stuff, and also trim some things to avoid crawlers.
86 $this->element('meta', array('name' => 'robots',
87 'content' => 'noindex,nofollow'));
90 function showLocalNav()
92 $nav = new PublicGroupNav($this);
96 function showSections()
98 ProfileAction::showSections();
102 function showStatistics()