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 $this->serverError(_('User has no profile.'));
22 $user = User::staticGet('id', $this->profile->id);
24 // This is a local user -- send to their regular profile.
25 $url = common_local_url('showstream', array('nickname' => $user->nickname));
26 common_redirect($url);
30 $this->tag = $this->trimmed('tag');
31 $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
32 common_set_returnto($this->selfUrl());
36 function handle($args)
44 // maybe fixed in 0.9.x
45 if (!empty($this->profile->fullname)) {
46 $base = $this->profile->fullname . ' (' . $this->profile->nickname . ') ';
48 $base = $this->profile->nickname;
50 $host = parse_url($this->profile->profileurl, PHP_URL_HOST);
51 return sprintf(_m('%s on %s'), $base, $host);
55 * Instead of showing notices, link to the original offsite profile.
57 function showNotices()
59 $url = $this->profile->profileurl;
60 $host = parse_url($url, PHP_URL_HOST);
62 _m('This remote profile is registered on another site; see [%s\'s original profile page on %s](%s).'),
63 $this->profile->nickname,
66 $html = common_markup_to_html($markdown);
69 if ($this->profile->hasRole(Profile_role::SILENCED)) {
70 $markdown = _m('Site moderators have silenced this profile, which prevents delivery of new messages to any users on this site.');
71 $this->raw(common_markup_to_html($markdown));
81 * Don't do various extra stuff, and also trim some things to avoid crawlers.
85 $this->element('meta', array('name' => 'robots',
86 'content' => 'noindex,nofollow'));
89 function showLocalNav()
91 $nav = new PublicGroupNav($this);
95 function showSections()
97 ProfileAction::showSections();
101 function showStatistics()