2010-11-16 08:34:12 +09:00
|
|
|
<?php
|
2011-04-26 02:12:26 +09:00
|
|
|
/*
|
2010-11-16 08:34:12 +09:00
|
|
|
* To change this template, choose Tools | Templates
|
|
|
|
* and open the template in the editor.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class RemoteProfileAction extends ShowstreamAction
|
|
|
|
{
|
|
|
|
function title()
|
|
|
|
{
|
2013-10-09 04:08:02 +09:00
|
|
|
$base = $this->target->getBestName();
|
|
|
|
$host = parse_url($this->target->profileurl, PHP_URL_HOST);
|
2011-04-26 02:12:26 +09:00
|
|
|
// TRANS: Remote profile action page title.
|
|
|
|
// TRANS: %1$s is a username, %2$s is a hostname.
|
|
|
|
return sprintf(_m('%1$s on %2$s'), $base, $host);
|
2010-11-16 08:34:12 +09:00
|
|
|
}
|
|
|
|
|
2010-11-16 08:57:57 +09:00
|
|
|
/**
|
|
|
|
* Instead of showing notices, link to the original offsite profile.
|
|
|
|
*/
|
|
|
|
function showNotices()
|
2010-11-16 08:34:12 +09:00
|
|
|
{
|
2013-10-09 04:08:02 +09:00
|
|
|
$url = $this->target->profileurl;
|
2010-11-16 08:57:57 +09:00
|
|
|
$host = parse_url($url, PHP_URL_HOST);
|
|
|
|
$markdown = sprintf(
|
2011-04-26 02:12:26 +09:00
|
|
|
// TRANS: Message on remote profile page.
|
|
|
|
// TRANS: This message contains Markdown links in the form [description](link).
|
|
|
|
// TRANS: %1$s is a profile nickname, %2$s is a hostname, %3$s is a URL.
|
|
|
|
_m('This remote profile is registered on another site; see [%1$s\'s original profile page on %2$s](%3$s).'),
|
2013-10-09 04:08:02 +09:00
|
|
|
$this->target->nickname,
|
2010-11-16 08:57:57 +09:00
|
|
|
$host,
|
|
|
|
$url);
|
|
|
|
$html = common_markup_to_html($markdown);
|
|
|
|
$this->raw($html);
|
2010-11-16 09:12:16 +09:00
|
|
|
|
2013-10-09 04:08:02 +09:00
|
|
|
if ($this->target->hasRole(Profile_role::SILENCED)) {
|
2011-04-26 02:12:26 +09:00
|
|
|
// TRANS: Message on blocked remote profile page.
|
2010-11-16 09:12:16 +09:00
|
|
|
$markdown = _m('Site moderators have silenced this profile, which prevents delivery of new messages to any users on this site.');
|
|
|
|
$this->raw(common_markup_to_html($markdown));
|
2012-08-28 04:02:53 +09:00
|
|
|
}else{
|
|
|
|
|
2015-03-13 00:33:34 +09:00
|
|
|
$pnl = new NoticeList($this->notice, $this);
|
2012-08-28 04:02:53 +09:00
|
|
|
$cnt = $pnl->show();
|
|
|
|
if (0 == $cnt) {
|
|
|
|
$this->showEmptyListMessage();
|
|
|
|
}
|
|
|
|
|
2013-10-09 04:08:02 +09:00
|
|
|
$args = array('id' => $this->target->id);
|
2012-08-28 04:02:53 +09:00
|
|
|
if (!empty($this->tag))
|
|
|
|
{
|
|
|
|
$args['tag'] = $this->tag;
|
|
|
|
}
|
|
|
|
$this->pagination($this->page>1, $cnt>NOTICES_PER_PAGE, $this->page,
|
|
|
|
'remoteprofile', $args);
|
|
|
|
|
2010-11-16 09:12:16 +09:00
|
|
|
}
|
2010-11-16 08:34:12 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
function getFeeds()
|
|
|
|
{
|
|
|
|
// none
|
|
|
|
}
|
|
|
|
|
2010-11-16 09:12:16 +09:00
|
|
|
/**
|
|
|
|
* Don't do various extra stuff, and also trim some things to avoid crawlers.
|
|
|
|
*/
|
2010-11-16 08:34:12 +09:00
|
|
|
function extraHead()
|
|
|
|
{
|
2010-11-16 09:12:16 +09:00
|
|
|
$this->element('meta', array('name' => 'robots',
|
|
|
|
'content' => 'noindex,nofollow'));
|
2010-11-16 08:34:12 +09:00
|
|
|
}
|
2010-11-16 08:57:57 +09:00
|
|
|
|
2010-11-16 08:34:12 +09:00
|
|
|
function showLocalNav()
|
|
|
|
{
|
2012-08-28 07:25:53 +09:00
|
|
|
// skip
|
2010-11-16 08:34:12 +09:00
|
|
|
}
|
2010-11-16 08:57:57 +09:00
|
|
|
|
2010-11-16 08:34:12 +09:00
|
|
|
function showSections()
|
|
|
|
{
|
2012-08-28 02:41:28 +09:00
|
|
|
// skip
|
2010-11-16 08:34:12 +09:00
|
|
|
}
|
|
|
|
|
2010-11-16 09:38:18 +09:00
|
|
|
function showStatistics()
|
|
|
|
{
|
|
|
|
// skip
|
|
|
|
}
|
2011-04-26 02:12:26 +09:00
|
|
|
}
|