• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_foreigner函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_foreigner函数的典型用法代码示例。如果您正苦于以下问题:PHP is_foreigner函数的具体用法?PHP is_foreigner怎么用?PHP is_foreigner使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: is_member

/**
 * @brief Test whether a given identity is a member of the Hubzilla.
 *
 * @param string $s;
 *    xchan_hash of the identity in question
 * @returns boolean true or false
 */
function is_member($s)
{
    return is_foreigner($s) ? false : true;
}
开发者ID:23n,项目名称:hubzilla,代码行数:11,代码来源:identity.php


示例2: theme_attachments

function theme_attachments(&$item)
{
    $arr = json_decode_plus($item['attach']);
    if (is_array($arr) && count($arr)) {
        $attaches = array();
        foreach ($arr as $r) {
            $icon = '';
            $icontype = substr($r['type'], 0, strpos($r['type'], '/'));
            /**
             * @FIXME This should probably be a giant "if" statement in the
             * template so that we don't have icon names embedded in php code.
             */
            switch ($icontype) {
                case 'video':
                    $icon = 'icon-facetime-video';
                    break;
                case 'audio':
                    $icon = 'icon-volume-up';
                    break;
                case 'image':
                    $icon = 'icon-picture';
                    break;
                case 'text':
                    $icon = 'icon-align-justify';
                    break;
                default:
                    $icon = 'icon-question';
                    break;
            }
            $title = htmlspecialchars($r['title'], ENT_COMPAT, 'UTF-8');
            if (!$title) {
                $title = t('unknown.???');
            }
            $title .= ' ' . $r['length'] . ' ' . t('bytes');
            require_once 'include/identity.php';
            if (is_foreigner($item['author_xchan'])) {
                $url = $r['href'];
            } else {
                $url = z_root() . '/magic?f=&hash=' . $item['author_xchan'] . '&dest=' . $r['href'] . '/' . $r['revision'];
            }
            $s .= '<a href="' . $url . '" title="' . $title . '" class="attachlink"  >' . $icon . '</a>';
            $attaches[] = array('title' => $title, 'url' => $url, 'icon' => $icon);
        }
    }
    $s = replace_macros(get_markup_template('item_attach.tpl'), array('$attaches' => $attaches));
    return $s;
}
开发者ID:einervonvielen,项目名称:redmatrix,代码行数:47,代码来源:text.php


示例3: theme_attachments

function theme_attachments(&$item)
{
    $arr = json_decode_plus($item['attach']);
    if (is_array($arr) && count($arr)) {
        $attaches = array();
        foreach ($arr as $r) {
            $icon = getIconFromType($r['type']);
            $label = $r['title'] ? urldecode(htmlspecialchars($r['title'], ENT_COMPAT, 'UTF-8')) : t('Unknown Attachment');
            //some feeds provide an attachment where title an empty space
            if ($label == ' ') {
                $label = t('Unknown Attachment');
            }
            $title = t('Size') . ' ' . ($r['length'] ? userReadableSize($r['length']) : t('unknown'));
            require_once 'include/identity.php';
            if (is_foreigner($item['author_xchan'])) {
                $url = $r['href'];
            } else {
                $url = z_root() . '/magic?f=&hash=' . $item['author_xchan'] . '&dest=' . $r['href'] . '/' . $r['revision'];
            }
            //$s .= '<a href="' . $url . '" title="' . $title . '" class="attachlink"  >' . $icon . '</a>';
            $attaches[] = array('label' => $label, 'url' => $url, 'icon' => $icon, 'title' => $title);
        }
        $s = replace_macros(get_markup_template('item_attach.tpl'), array('$attaches' => $attaches));
    }
    return $s;
}
开发者ID:23n,项目名称:hubzilla,代码行数:26,代码来源:text.php


示例4: scopes_sql

/**
 * Remote visitors also need to be checked against the public_scope parameter if item_private is set.
 * This function checks the various permutations of that field for any which apply to this observer.
 * 
 */
function scopes_sql($uid, $observer)
{
    $str = " and ( public_policy = 'authenticated' ";
    if (!is_foreigner($observer)) {
        $str .= " or public_policy = 'network: red' ";
    }
    if (local_channel()) {
        $str .= " or public_policy = 'site: " . App::get_hostname() . "' ";
    }
    $ab = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1", dbesc($observer), intval($uid));
    if (!$ab) {
        return $str . " ) ";
    }
    if ($ab[0]['abook_pending']) {
        $str .= " or public_policy = 'any connections' ";
    }
    $str .= " or public_policy = 'contacts' ) ";
    return $str;
}
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:24,代码来源:security.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_freeze函数代码示例发布时间:2022-05-15
下一篇:
PHP is_foreachable函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap