本文整理汇总了PHP中common_markup_to_html函数的典型用法代码示例。如果您正苦于以下问题:PHP common_markup_to_html函数的具体用法?PHP common_markup_to_html怎么用?PHP common_markup_to_html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了common_markup_to_html函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showPageNotice
function showPageNotice()
{
$notice = sprintf(_('%%%%site.name%%%% groups let you find and talk with ' . 'people of similar interests. After you join a group ' . 'you can send messages to all other members using the ' . 'syntax "!groupname". Don\'t see a group you like? Try ' . '[searching for one](%%%%action.groupsearch%%%%) or ' . '[start your own](%%%%action.newgroup%%%%)!'));
$this->elementStart('div', 'instructions');
$this->raw(common_markup_to_html($notice));
$this->elementEnd('div');
}
示例2: showNotices
/**
* Instead of showing notices, link to the original offsite profile.
*/
function showNotices()
{
$url = $this->profile->profileurl;
$host = parse_url($url, PHP_URL_HOST);
$markdown = sprintf(_m('This remote profile is registered on another site; see [%1$s\'s original profile page on %2$s](%3$s).'), $this->profile->nickname, $host, $url);
$html = common_markup_to_html($markdown);
$this->raw($html);
if ($this->profile->hasRole(Profile_role::SILENCED)) {
// TRANS: Message on blocked remote profile page.
$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));
} else {
$pnl = null;
if (Event::handle('ShowStreamNoticeList', array($this->notice, $this, &$pnl))) {
$pnl = new ProfileNoticeList($this->notice, $this);
}
$cnt = $pnl->show();
if (0 == $cnt) {
$this->showEmptyListMessage();
}
$args = array('id' => $this->profile->id);
if (!empty($this->tag)) {
$args['tag'] = $this->tag;
}
$this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'remoteprofile', $args);
}
}
示例3: showResults
function showResults($q, $page)
{
$user_group = new User_group();
$user_group->limit(($page - 1) * GROUPS_PER_PAGE, GROUPS_PER_PAGE + 1);
$wheres = array('nickname', 'fullname', 'homepage', 'description', 'location');
foreach ($wheres as $where) {
$where_q = "{$where} like '%" . trim($user_group->escape($q), '\'') . '%\'';
$user_group->whereAdd($where_q, 'OR');
}
$cnt = $user_group->find();
if ($cnt > 0) {
$terms = preg_split('/[\\s,]+/', $q);
$results = new GroupSearchResults($user_group, $terms, $this);
$results->show();
$user_group->free();
$this->pagination($page > 1, $cnt > GROUPS_PER_PAGE, $page, 'groupsearch', array('q' => $q));
} else {
$this->element('p', 'error', _('No results.'));
$this->searchSuggestions($q);
if (common_logged_in()) {
$message = _('If you can\'t find the group you\'re looking for, you can [create it](%%action.newgroup%%) yourself.');
} else {
$message = _('Why not [register an account](%%action.register%%) and [create the group](%%action.newgroup%%) yourself!');
}
$this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message));
$this->elementEnd('div');
$user_group->free();
}
}
示例4: showEmptyList
function showEmptyList()
{
$message = sprintf(_('This is %1$s\'s event stream, but %1$s hasn\'t received any events yet.'), $this->target->getNickname()) . ' ';
$this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message));
$this->elementEnd('div');
}
示例5: showPageNotice
function showPageNotice()
{
$instr = $this->getInstructions();
$output = common_markup_to_html($instr);
$this->elementStart('div', 'instructions');
$this->raw($output);
$this->elementEnd('div');
}
示例6: showPageNotice
function showPageNotice()
{
if ($this->err) {
$this->element('div', 'error', $this->err);
} else {
$inst = _('To subscribe, you can [login](%%action.login%%),' . ' or [register](%%action.register%%) a new ' . ' account. If you already have an account ' . ' on a [compatible microblogging site](%%doc.openmublog%%), ' . ' enter your profile URL below.');
$output = common_markup_to_html($inst);
$this->elementStart('div', 'instructions');
$this->raw($output);
$this->elementEnd('div');
}
}
示例7: showPageNotice
function showPageNotice()
{
if ($this->error) {
$this->element('div', array('class' => 'error'), $this->error);
} else {
$instr = $this->getInstructions();
$output = common_markup_to_html($instr);
$this->elementStart('div', 'instructions');
$this->raw($output);
$this->elementEnd('div');
}
}
示例8: showEmptyList
function showEmptyList()
{
$message = _('No one has posted a notice with a [hashtag](%%doc.tags%%) yet.') . ' ';
if (common_logged_in()) {
$message .= _('Be the first to post one!');
} else {
$message .= _('Why not [register an account](%%action.register%%) and be the first to post one!');
}
$this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message));
$this->elementEnd('div');
}
示例9: showNotices
/**
* Instead of showing notices, link to the original offsite profile.
*/
function showNotices()
{
$url = $this->profile->profileurl;
$host = parse_url($url, PHP_URL_HOST);
$markdown = sprintf(_m('This remote profile is registered on another site; see [%s\'s original profile page on %s](%s).'), $this->profile->nickname, $host, $url);
$html = common_markup_to_html($markdown);
$this->raw($html);
if ($this->profile->hasRole(Profile_role::SILENCED)) {
$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));
}
}
示例10: onEndShowPageNotice
function onEndShowPageNotice($action)
{
$name = $action->trimmed('action');
switch ($name) {
case 'login':
$instr = '(Have an account with CAS? ' . 'Try our [CAS login]' . '(%%action.caslogin%%)!)';
break;
default:
return true;
}
$output = common_markup_to_html($instr);
$action->raw($output);
return true;
}
示例11: onStartRegistrationFormData
function onStartRegistrationFormData($action)
{
$instr = 'Note you will initially be "sandboxed" so your posts will not appear in the public timeline.';
if (isset($this->contact)) {
$contactuser = User::staticGet('nickname', $this->contact);
if (!empty($contactuser)) {
$contactlink = "@<a href=\"{$contactuser->uri}\">{$contactuser->nickname}</a>";
$instr = $instr . " Send a message to {$contactlink} to speed up the unsandboxing process.";
}
}
$output = common_markup_to_html($instr);
$action->elementStart('div', 'instructions');
$action->raw($output);
$action->elementEnd('div');
}
示例12: showTop
function showTop($arr = null)
{
$error = null;
if ($arr) {
$error = $arr[1];
}
if (!empty($error)) {
$this->element('p', 'error', $error);
} else {
$instr = $this->getInstructions();
$output = common_markup_to_html($instr);
$this->elementStart('div', 'instructions');
$this->raw($output);
$this->elementEnd('div');
}
}
示例13: onEndShowPageNotice
function onEndShowPageNotice($action)
{
$name = $action->trimmed('action');
switch ($name) {
case 'login':
// TRANS: Invitation to users with a CAS account to log in using the service.
// TRANS: "[CAS login]" is a link description. (%%action.caslogin%%) is the URL.
// TRANS: These two elements may not be separated.
$instr = _m('(Have an account with CAS? ' . 'Try our [CAS login](%%action.caslogin%%)!)');
break;
default:
return true;
}
$output = common_markup_to_html($instr);
$action->raw($output);
return true;
}
示例14: onStartRegistrationFormData
function onStartRegistrationFormData($action)
{
// TRANS: User instructions after registration.
$instr = _m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline.');
if (isset($this->contact)) {
$contactuser = User::staticGet('nickname', $this->contact);
if (!empty($contactuser)) {
$contactlink = "@<a href=\"{$contactuser->uri}\">{$contactuser->nickname}</a>";
// TRANS: User instructions after registration.
// TRANS: %s is a clickable e-mailaddress.
$instr = sprintf(_m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline. ' . 'Send a message to %s to speed up the unsandboxing process.'), $contactlink);
}
}
$output = common_markup_to_html($instr);
$action->elementStart('div', 'instructions');
$action->raw($output);
$action->elementEnd('div');
}
示例15: onStartRegistrationFormData
function onStartRegistrationFormData($action)
{
// TRANS: User instructions after registration.
$instr = _m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline.');
if (isset($this->contact)) {
$contactuser = User::getKV('nickname', $this->contact);
if ($contactuser instanceof User) {
$contactlink = sprintf('@<a href="%s">%s</a>', htmlspecialchars($contactuser->getProfile()->getUrl()), htmlspecialchars($contactuser->getProfile()->getNickname()));
// TRANS: User instructions after registration.
// TRANS: %s is a clickable OStatus profile URL.
$instr = sprintf(_m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline. ' . 'Send a message to %s to speed up the unsandboxing process.'), $contactlink);
}
}
$output = common_markup_to_html($instr);
$action->elementStart('div', 'instructions');
$action->raw($output);
$action->elementEnd('div');
}