当前位置: 首页>>代码示例>>PHP>>正文


PHP Surfer::may_mail方法代码示例

本文整理汇总了PHP中Surfer::may_mail方法的典型用法代码示例。如果您正苦于以下问题:PHP Surfer::may_mail方法的具体用法?PHP Surfer::may_mail怎么用?PHP Surfer::may_mail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Surfer的用法示例。


在下文中一共展示了Surfer::may_mail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: implode

     }
 }
 // provide details
 if (count($details)) {
     $context['text'] .= '<p class="details">' . implode(BR . "\n", $details) . '</p>';
 }
 // the full name
 if ($item['full_name']) {
     $context['text'] .= '<p>' . sprintf(i18n::s('%s: %s'), i18n::s('Full name'), $item['full_name']) . "</p>\n";
 }
 // web address, if any
 if (isset($item['web_address']) && $item['web_address']) {
     $context['text'] .= '<p>' . sprintf(i18n::s('%s: %s'), i18n::s('Web address'), Skin::build_link($item['web_address'], $item['web_address'], 'external')) . "</p>\n";
 }
 // email address - not showed to anonymous surfers for spam protection
 if (isset($item['email']) && $item['email'] && Surfer::may_mail()) {
     $label = i18n::s('E-mail address: %s %s');
     if (isset($context['with_email']) && $context['with_email'] == 'Y') {
         $url = Users::get_url($id, 'mail');
     } else {
         $url = 'mailto:' . $item['email'];
     }
     if (isset($item['with_newsletters']) && $item['with_newsletters'] == 'Y') {
         $suffix = '';
     } else {
         $suffix = i18n::s('(do not wish to receive newsletters)');
     }
     $context['text'] .= '<p>' . sprintf($label, Skin::build_link($url, $item['email'], 'email'), $suffix) . "</p>\n";
 }
 // the introduction text
 $context['text'] .= Skin::build_block($item['introduction'], 'introduction');
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:print.php

示例2: sprintf

    $url = $anchor->get_url();
    if (!strncmp($anchor->get_reference(), 'user:', 5)) {
        $url .= '#_followers';
    }
    $links[] = Skin::build_link($url, i18n::s('Done'), 'button');
    $context['text'] .= Skin::finalize_list($links, 'assistant_bar');
    // adding editors
    if (strncmp($_REQUEST['member'], 'user:', 5)) {
        if (Surfer::may_mail()) {
            $help = sprintf(i18n::s('%s if you have to assign new persons and to notify them in a single operation.'), Skin::build_link($anchor->get_url('invite'), i18n::s('Invite participants')));
            // in a side box
            $context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help');
        }
        // adding followers
    } else {
        if (Surfer::may_mail()) {
            $help = i18n::s('Each new person will be notified that you are following him.');
            // in a side box
            $context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help');
        }
    }
    // list editors
} elseif ($permitted == 'editors') {
    // the title of the page
    if (is_object($anchor)) {
        if (!strncmp($anchor->get_reference(), 'user:', 5)) {
            if (Surfer::is(intval(substr($anchor->get_reference(), 5)))) {
                $context['page_title'] = i18n::s('Persons that I am following');
            } else {
                $context['page_title'] = sprintf(i18n::s('Persons followed by %s'), $anchor->get_title());
            }
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:select.php

示例3: get_link

 /**
  * build a pretty link to a user page
  *
  * Most of the time this function will build a nice link to the user profile at this server.
  * At other time it may feature either a link to another server, or an e-mail address.
  *
  * Pseudo code:
  * [snippet]
  * If there is a user profile for this id
  *	 return a link to the related page
  * else if the user is not logged and if email addresses have to be protected
  *	 return the name string without any link (protected from spam)
  * else if a web address has been provided
  *	 return a http: link to it
  * else if an email address has been provided
  *	 return a mailto: link to it
  * else
  *	 return the name string without any link
  * [/snippet]
  *
  * @param string the user name
  * @param string the email address, or a web address
  * @param string the user id
  * @param boolean TRUE to open the link in a new window, FALSE otherwise
  * @param string an optional hovering label
  * @return a pretty link to insert in the HTML page
  *
  * @see feeds/feeds.php
  */
 public static function get_link($name, $email, $id, $new_window = FALSE, $hover = NULL)
 {
     global $context;
     if (!$name) {
         $name = i18n::s('(unknown)');
     }
     if ($id > 0 && ($url = Users::get_url($id, 'view', $name))) {
         return Skin::build_link($context['url_to_home'] . $context['url_to_root'] . $url, $name, 'user', $hover, $new_window);
     } elseif (!Surfer::may_mail()) {
         return $name;
     } elseif (preg_match('/@/', $email)) {
         return Skin::build_link($email, $name, 'email', $hover);
     } elseif (preg_match('/[:\\/]/', $email)) {
         return Skin::build_link($email, $name, NULL, $hover);
     } else {
         return $name;
     }
 }
开发者ID:rair,项目名称:yacs,代码行数:47,代码来源:users.php


注:本文中的Surfer::may_mail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。