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 Action::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 $base = $this->profile->getBestName();
46 $host = parse_url($this->profile->profileurl, PHP_URL_HOST);
47 // TRANS: Remote profile action page title.
48 // TRANS: %1$s is a username, %2$s is a hostname.
49 return sprintf(_m('%1$s on %2$s'), $base, $host);
53 * Instead of showing notices, link to the original offsite profile.
55 function showNotices()
57 $url = $this->profile->profileurl;
58 $host = parse_url($url, PHP_URL_HOST);
60 // TRANS: Message on remote profile page.
61 // TRANS: This message contains Markdown links in the form [description](link).
62 // TRANS: %1$s is a profile nickname, %2$s is a hostname, %3$s is a URL.
63 _m('This remote profile is registered on another site; see [%1$s\'s original profile page on %2$s](%3$s).'),
64 $this->profile->nickname,
67 $html = common_markup_to_html($markdown);
70 if ($this->profile->hasRole(Profile_role::SILENCED)) {
71 // TRANS: Message on blocked remote profile page.
72 $markdown = _m('Site moderators have silenced this profile, which prevents delivery of new messages to any users on this site.');
73 $this->raw(common_markup_to_html($markdown));
83 * Don't do various extra stuff, and also trim some things to avoid crawlers.
87 $this->element('meta', array('name' => 'robots',
88 'content' => 'noindex,nofollow'));
91 function showLocalNav()
93 $nav = new PublicGroupNav($this);
97 function showSections()
99 ProfileAction::showSections();
103 function showStatistics()