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


PHP get_my_address函数代码示例

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


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

示例1: rmagic_init

function rmagic_init(&$a)
{
    if (local_channel()) {
        goaway(z_root());
    }
    $me = get_my_address();
    if ($me) {
        $r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1", dbesc($me));
        if ($r) {
            if ($r[0]['hubloc_url'] === z_root()) {
                goaway(z_root() . '/login');
            }
            $dest = z_root() . '/' . str_replace('zid=', 'zid_=', get_app()->query_string);
            goaway($r[0]['hubloc_url'] . '/magic' . '?f=&dest=' . $dest);
        }
    }
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:17,代码来源:rmagic.php

示例2: zid

/**
 * @brief Adds a zid parameter to a url.
 *
 * @param string $s
 *   The url to accept the zid
 * @param boolean $address
 *   $address to use instead of session environment
 * @return string
 *
 * @hooks 'zid'
 *      string url - url to accept zid
 *      string zid - urlencoded zid
 *      string result - the return string we calculated, change it if you want to return something else
 */
function zid($s, $address = '')
{
    if (!strlen($s) || strpos($s, 'zid=')) {
        return $s;
    }
    $has_params = strpos($s, '?') ? true : false;
    $num_slashes = substr_count($s, '/');
    if (!$has_params) {
        $has_params = strpos($s, '&') ? true : false;
    }
    $achar = strpos($s, '?') ? '&' : '?';
    $mine = get_my_url();
    $myaddr = $address ? $address : get_my_address();
    /** @FIXME checking against our own channel url is no longer reliable. We may have a lot
     * of urls attached to out channel. Should probably match against our site, since we
     * will not need to remote authenticate on our own site anyway.
     */
    if ($mine && $myaddr && !link_compare($mine, $s)) {
        $zurl = $s . ($num_slashes >= 3 ? '' : '/') . $achar . 'zid=' . urlencode($myaddr);
    } else {
        $zurl = $s;
    }
    $arr = array('url' => $s, 'zid' => urlencode($myaddr), 'result' => $zurl);
    call_hooks('zid', $arr);
    return $arr['result'];
}
开发者ID:23n,项目名称:hubzilla,代码行数:40,代码来源:identity.php

示例3: build_pagehead

 function build_pagehead()
 {
     $user_scalable = local_channel() ? get_pconfig(local_channel(), 'system', 'user_scalable') : 1;
     if ($user_scalable === false) {
         $user_scalable = 1;
     }
     $interval = local_channel() ? get_pconfig(local_channel(), 'system', 'update_interval') : 80000;
     if ($interval < 10000) {
         $interval = 80000;
     }
     if (!x($this->page, 'title')) {
         $this->page['title'] = $this->config['system']['sitename'];
     }
     /* put the head template at the beginning of page['htmlhead']
      * since the code added by the modules frequently depends on it
      * being first
      */
     $tpl = get_markup_template('head.tpl');
     $this->page['htmlhead'] = replace_macros($tpl, array('$user_scalable' => $user_scalable, '$baseurl' => $this->get_baseurl(), '$local_channel' => local_channel(), '$generator' => PLATFORM_NAME . ' ' . RED_VERSION, '$update_interval' => $interval, '$icon' => head_get_icon(), '$head_css' => head_get_css(), '$head_js' => head_get_js(), '$js_strings' => js_strings(), '$zid' => get_my_address(), '$channel_id' => $this->profile['uid'])) . $this->page['htmlhead'];
     // always put main.js at the end
     $this->page['htmlhead'] .= head_get_main_js();
 }
开发者ID:HaakonME,项目名称:redmatrix,代码行数:22,代码来源:boot.php

示例4: build_pagehead

 public static function build_pagehead()
 {
     $user_scalable = local_channel() ? get_pconfig(local_channel(), 'system', 'user_scalable') : 1;
     if ($user_scalable === false) {
         $user_scalable = 1;
     }
     $preload_images = local_channel() ? get_pconfig(local_channel(), 'system', 'preload_images') : 0;
     if ($preload_images === false) {
         $preload_images = 0;
     }
     $interval = local_channel() ? get_pconfig(local_channel(), 'system', 'update_interval') : 80000;
     if ($interval < 10000) {
         $interval = 80000;
     }
     if (!x(self::$page, 'title')) {
         self::$page['title'] = self::$config['system']['sitename'];
     }
     if (!self::$meta->get_field('og:title')) {
         self::$meta->set('og:title', self::$page['title']);
     }
     self::$meta->set('generator', Zotlabs\Lib\System::get_platform_name());
     /* put the head template at the beginning of page['htmlhead']
      * since the code added by the modules frequently depends on it
      * being first
      */
     $tpl = get_markup_template('head.tpl');
     self::$page['htmlhead'] = replace_macros($tpl, array('$preload_images' => $preload_images, '$user_scalable' => $user_scalable, '$query' => urlencode(self::$query_string), '$baseurl' => self::get_baseurl(), '$local_channel' => local_channel(), '$metas' => self::$meta->get(), '$update_interval' => $interval, 'osearch' => sprintf(t('Search %1$s (%2$s)', 'opensearch'), Zotlabs\Lib\System::get_site_name(), t('$Projectname', 'opensearch')), '$icon' => head_get_icon(), '$head_css' => head_get_css(), '$head_js' => head_get_js(), '$js_strings' => js_strings(), '$zid' => get_my_address(), '$channel_id' => self::$profile['uid'])) . self::$page['htmlhead'];
     // always put main.js at the end
     self::$page['htmlhead'] .= head_get_main_js();
 }
开发者ID:einervonvielen,项目名称:hubzilla,代码行数:30,代码来源:boot.php


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