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


PHP is_foreigner函数代码示例

本文整理汇总了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;未经允许,请勿转载。