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


PHP space_key函数代码示例

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


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

示例1: getinvite

function getinvite()
{
    global $_G;
    $result = array();
    $cookies = empty($_G['cookie']['invite_auth']) ? array() : explode(',', $_G['cookie']['invite_auth']);
    $cookiecount = count($cookies);
    if ($cookiecount == 2) {
        $id = intval($cookies[0]);
        $code = $cookies[1];
        $query = DB::query("SELECT * FROM " . DB::table('common_invite') . " WHERE id='{$id}'");
        if ($invite = DB::fetch($query)) {
            if ($invite['code'] == $code && empty($invite['fuid']) && (empty($invite['endtime']) || $_G['timestamp'] < $invite['endtime'])) {
                $result['uid'] = $invite['uid'];
                $result['id'] = $invite['id'];
                $result['appid'] = $invite['appid'];
            }
        }
    } elseif ($cookiecount == 3) {
        $uid = intval($cookies[0]);
        $code = $cookies[1];
        $appid = intval($cookies[2]);
        $invite_code = space_key($uid, $appid);
        if ($code == $invite_code) {
            $result['uid'] = $uid;
            $result['appid'] = $appid;
        }
    }
    if ($result['uid']) {
        $member = getuserbyuid($result['uid']);
        $result['username'] = $member['username'];
    } else {
        dsetcookie('invite_auth', '', -86400 * 365);
    }
    return $result;
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:35,代码来源:member.php

示例2: empty

        $refer = '';
    }
}
if (empty($refer)) {
    $refer = 'space.php?do=home';
}
//好友邀请
$uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']);
$code = empty($_GET['code']) ? '' : $_GET['code'];
$app = empty($_GET['app']) ? '' : intval($_GET['app']);
$invite = empty($_GET['invite']) ? '' : $_GET['invite'];
$invitearr = array();
$reward = getreward('invitecode', 0);
if ($uid && $code && !$reward['credit']) {
    $m_space = getspace($uid);
    if ($code == space_key($m_space, $app)) {
        //验证通过
        $invitearr['uid'] = $uid;
        $invitearr['username'] = $m_space['username'];
    }
    $url_plus = "uid={$uid}&app={$app}&code={$code}";
} elseif ($uid && $invite) {
    include_once S_ROOT . './source/function_cp.php';
    $invitearr = invite_get($uid, $invite);
    $url_plus = "uid={$uid}&invite={$invite}";
}
if ($_SCONFIG['seccode_login']) {
    include_once S_ROOT . './source/function_cp.php';
    if (!ckseccode($_POST['seccode'])) {
        $_SGLOBAL['input_seccode'] = 1;
        include template('do_login');
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_cas_login.php

示例3: exit

<?php

/*
	[UCenter Home] (C) 2007-2008 Comsenz Inc.
	$Id: cp_friend.php 13178 2009-08-17 02:36:39Z liguode $
*/
if (!defined('IN_UCHOME')) {
    exit('Access Denied');
}
$op = empty($_GET['op']) ? '' : $_GET['op'];
$uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']);
$space['key'] = space_key($space);
$actives = array($op => ' class="active"');
if ($op == 'add') {
    if (!checkperm('allowfriend')) {
        ckspacelog();
        showmessage('no_privilege');
    }
    //检测用户
    if ($uid == $_SGLOBAL['supe_uid']) {
        showmessage('friend_self_error');
    }
    if ($space['friends'] && in_array($uid, $space['friends'])) {
        showmessage('you_have_friends');
    }
    //实名认证
    ckrealname('friend');
    $tospace = getspace($uid);
    if (empty($tospace)) {
        showmessage('space_does_not_exist');
    }
开发者ID:NaturalWill,项目名称:UCQA,代码行数:31,代码来源:cp_friend.php

示例4: getinvite

function getinvite()
{
    global $_G;
    if ($_G['setting']['regstatus'] == 1) {
        return array();
    }
    $result = array();
    $cookies = empty($_G['cookie']['invite_auth']) ? array() : explode(',', $_G['cookie']['invite_auth']);
    $cookiecount = count($cookies);
    $_GET['invitecode'] = trim($_GET['invitecode']);
    if ($cookiecount == 2 || $_GET['invitecode']) {
        $id = intval($cookies[0]);
        $code = trim($cookies[1]);
        if ($_GET['invitecode']) {
            $invite = C::t('common_invite')->fetch_by_code($_GET['invitecode']);
            $code = trim($_GET['invitecode']);
        } else {
            $invite = C::t('common_invite')->fetch($id);
        }
        if (!empty($invite)) {
            if ($invite['code'] == $code && empty($invite['fuid']) && (empty($invite['endtime']) || $_G['timestamp'] < $invite['endtime'])) {
                $result['uid'] = $invite['uid'];
                $result['id'] = $invite['id'];
                $result['appid'] = $invite['appid'];
            }
        }
    } elseif ($cookiecount == 3) {
        $uid = intval($cookies[0]);
        $code = trim($cookies[1]);
        $appid = intval($cookies[2]);
        $invite_code = space_key($uid, $appid);
        if ($code == $invite_code) {
            $inviteprice = 0;
            $member = getuserbyuid($uid);
            if ($member) {
                $usergroup = C::t('common_usergroup')->fetch($member['groupid']);
                $inviteprice = $usergroup['inviteprice'];
            }
            if ($inviteprice > 0) {
                return array();
            }
            $result['uid'] = $uid;
            $result['appid'] = $appid;
        }
    }
    if ($result['uid']) {
        $member = getuserbyuid($result['uid']);
        $result['username'] = $member['username'];
    } else {
        dsetcookie('invite_auth', '');
    }
    return $result;
}
开发者ID:tang86,项目名称:discuz-utf8,代码行数:53,代码来源:function_member.php

示例5: showmessage

    if (empty($invite) || $invite['code'] != $_GET['c']) {
        showmessage('invite_code_error', '', array(), array('return' => true));
    }
    if ($invite['fuid'] && $invite['fuid'] != $_G['uid']) {
        showmessage('invite_code_fuid', '', array(), array('return' => true));
    }
    if ($invite['endtime'] && $_G['timestamp'] > $invite['endtime']) {
        C::t('common_invite')->delete($id);
        showmessage('invite_code_endtime_error', '', array(), array('return' => true));
    }
    $appid = $invite['appid'];
    $uid = $invite['uid'];
    $cookievar = "{$id},{$invite['code']}";
} elseif ($uid) {
    $id = 0;
    $invite_code = space_key($uid, $appid);
    if ($_GET['c'] != $invite_code) {
        showmessage('invite_code_error', '', array(), array('return' => true));
    }
    $inviteuser = getuserbyuid($uid);
    loadcache('usergroup_' . $inviteuser['groupid']);
    if (!empty($_G['cache']['usergroup_' . $inviteuser['groupid']]) && $_G['cache']['usergroup_' . $inviteuser['groupid']]['inviteprice']) {
        showmessage('invite_code_error', '', array(), array('return' => true));
    }
    $cookievar = "{$uid},{$invite_code},{$appid}";
} else {
    showmessage('invite_code_error', '', array(), array('return' => true));
}
$userapp = array();
if ($appid) {
    $userapp = C::t('common_myapp')->fetch($appid);
开发者ID:lemonstory,项目名称:bbs,代码行数:31,代码来源:home_invite.php

示例6: exit

/*
	[UCenter Home] (C) 2007-2008 Comsenz Inc.
	$Id: cp_invite.php 12971 2009-07-31 07:04:02Z liguode $
*/
if (!defined('IN_UCHOME')) {
    exit('Access Denied');
}
$siteurl = getsiteurl();
$maxcount = 50;
//最多好友邀请
$reward = getreward('invitecode', 0);
$appid = empty($_GET['app']) ? 0 : intval($_GET['app']);
$inviteapp = $invite_code = '';
if (empty($reward['credit']) || $appid) {
    $reward['credit'] = 0;
    $invite_code = space_key($space, $appid);
}
$siteurl = getsiteurl();
$spaceurl = $siteurl . 'space.php?uid=' . $_SGLOBAL['supe_uid'];
$mailvar = array("<a href=\"{$spaceurl}\">" . avatar($space['uid'], 'middle') . "</a><br>" . $_SN[$space['uid']], $_SN[$space['uid']], $_SCONFIG['sitename'], '', '', $spaceurl, '');
//取出相应的应用
$appinfo = array();
if ($appid) {
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('myapp') . " WHERE appid='{$appid}'");
    $appinfo = $_SGLOBAL['db']->fetch_array($query);
    if ($appinfo) {
        $inviteapp = "&amp;app={$appid}";
        $mailvar[6] = $appinfo['appname'];
    } else {
        $appid = 0;
    }
开发者ID:AlexChien,项目名称:ey_uhome,代码行数:31,代码来源:cp_invite.php

示例7: exit

<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: spacecp_friend.php 19808 2011-01-19 04:26:01Z zhengqingpeng $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
require_once libfile('function/friend');
$op = empty($_GET['op']) ? '' : $_GET['op'];
$uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']);
$space['key'] = space_key($space['uid']);
$actives = array($op => ' class="a"');
if ($op == 'add') {
    if (!checkperm('allowfriend')) {
        showmessage('no_privilege');
    }
    if ($uid == $_G['uid']) {
        showmessage('friend_self_error');
    }
    if (friend_check($uid)) {
        showmessage('you_have_friends');
    }
    $tospace = getspace($uid);
    if (empty($tospace)) {
        showmessage('space_does_not_exist');
    }
    if (isblacklist($tospace['uid'])) {
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:spacecp_friend.php

示例8: getinvite

function getinvite()
{
    global $_G;
    if ($_G['setting']['regstatus'] == 1) {
        return array();
    }
    $result = array();
    $cookies = empty($_G['cookie']['invite_auth']) ? array() : explode(',', $_G['cookie']['invite_auth']);
    $cookiecount = count($cookies);
    if ($cookiecount == 2 || $_G['gp_invitecode']) {
        $id = intval($cookies[0]);
        $code = $cookies[1];
        if ($_G['gp_invitecode']) {
            $query = DB::query("SELECT * FROM " . DB::table('common_invite') . " WHERE code='{$_G['gp_invitecode']}'");
            $code = $_G['gp_invitecode'];
        } else {
            $query = DB::query("SELECT * FROM " . DB::table('common_invite') . " WHERE id='{$id}'");
        }
        if ($invite = DB::fetch($query)) {
            if ($invite['code'] == $code && empty($invite['fuid']) && (empty($invite['endtime']) || $_G['timestamp'] < $invite['endtime'])) {
                $result['uid'] = $invite['uid'];
                $result['id'] = $invite['id'];
                $result['appid'] = $invite['appid'];
            }
        }
    } elseif ($cookiecount == 3) {
        $uid = intval($cookies[0]);
        $code = $cookies[1];
        $appid = intval($cookies[2]);
        $invite_code = space_key($uid, $appid);
        if ($code == $invite_code) {
            $groupid = DB::result_first("SELECT groupid FROM " . DB::table('common_member') . " WHERE uid='{$uid}'");
            $inviteprice = DB::result_first("SELECT inviteprice FROM " . DB::table('common_usergroup') . " WHERE groupid='{$groupid}'");
            if ($inviteprice > 0) {
                return array();
            }
            $result['uid'] = $uid;
            $result['appid'] = $appid;
        }
    }
    if ($result['uid']) {
        $member = getuserbyuid($result['uid']);
        $result['username'] = $member['username'];
    } else {
        dsetcookie('invite_auth', '');
    }
    return $result;
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:48,代码来源:function_member.php

示例9: getinvite

    $invite['uid'] = $_GET['u'];
    $theurl = "invite.php?u={$_GET['u']}&app={$_GET['app']}&c={$_GET['c']}";
    $url_plus = "uid={$invite['uid']}&app={$_GET['app']}&code={$_GET['c']}";
} else {
    $invite = getinvite($get);
    $theurl = "invite.php?{$get}";
    $url_plus = "uid={$invite['uid']}&invite={$invite['code']}";
}
//Get Invited member
$space = getspace($invite['uid']);
if (empty($space)) {
    showmessage('space_does_not_exist');
}
//Check the invite code
if ($_GET['u'] && empty($reward['credit'])) {
    if ($_GET['c'] != space_key($space, $_GET['app'])) {
        showmessage('invite_code_error');
    }
}
//Check for self-invite
if ($space['self']) {
    showmessage('should_not_invite_your_own');
}
$space['isfriend'] = 0;
if ($_SGLOBAL['supe_uid'] && $space['friends'] && in_array($_SGLOBAL['supe_uid'], $space['friends'])) {
    $space['isfriend'] = 1;
    //Is a friend
}
$jumpurl = $_GET['app'] ? "userapp.php?id={$_GET['app']}&my_extra=invitedby_bi_{$_GET['u']}_{$_GET['c']}&my_suffix=Lw%3D%3D" : "space.php?uid={$space['uid']}";
if ($space['isfriend']) {
    showmessage('you_have_friends', $jumpurl, 1);
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:invite.php

示例10: showmessage

if ($space) {
    //验证空间是否被锁定
    if ($space['flag'] == -1) {
        showmessage('space_has_been_locked');
    }
    //验证空间是否被锁定
    if ($space['flag'] == -2) {
        include_once template("space_check_bot");
        exit;
    }
    $query = $_SGLOBAL['db']->query('SELECT groupid from ' . tname('space') . ' WHERE uid=' . $_SGLOBAL['supe_uid']);
    if ($res = $_SGLOBAL['db']->fetch_array($query)) {
        $_SGLOBAL['mygroupid'] = $res['groupid'];
    }
    //隐私检查
    if (empty($isinvite) || $isinvite < 0 && $code != space_key($space, $_GET['app'])) {
        //游客
        if (empty($_SCONFIG['networkpublic'])) {
            checklogin();
            //需要登录
        }
        ////////////////////////是否为粉丝,是则按好友处理///////////////////////////////////////////
        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('space') . " WHERE uid={$uid}");
        $value = $_SGLOBAL['db']->fetch_array($query);
        $aud = explode(",", $value['aud']);
        $flag = in_array($_SGLOBAL['supe_uid'], $aud);
        if ($_SGLOBAL['mygroupid'] == 3) {
            $flag = 1;
        }
        /////////////////////////////////////////////////////////////////////////////////
        if (!ckprivacy($do) && !$flag) {
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:space.php

示例11: getinviteurl

function getinviteurl($inviteid, $invitecode, $appid)
{
    global $_G;
    if ($inviteid && $invitecode) {
        $inviteurl = getsiteurl() . "home.php?mod=invite&amp;id={$inviteid}&amp;c={$invitecode}";
    } else {
        $invite_code = space_key($_G['uid'], $appid);
        $inviteapp = $appid ? "&amp;app={$appid}" : '';
        $inviteurl = getsiteurl() . "home.php?mod=invite&amp;u={$_G['uid']}&amp;c={$invite_code}{$inviteapp}";
    }
    return $inviteurl;
}
开发者ID:softhui,项目名称:discuz,代码行数:12,代码来源:spacecp_invite.php

示例12: eycp_register_to_ucenter

function eycp_register_to_ucenter($openid, $login, $email, $nickname)
{
    /////////////////////////////////////
    //好友邀请数据预处理
    include_once S_ROOT . './source/function_cp.php';
    $uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']);
    $code = empty($_GET['code']) ? '' : $_GET['code'];
    $app = empty($_GET['app']) ? '' : intval($_GET['app']);
    $invite = empty($_GET['invite']) ? '' : $_GET['invite'];
    $invitearr = array();
    $reward = getreward('invitecode', 0);
    $pay = $app ? 0 : $reward['credit'];
    if ($uid && $code && !$pay) {
        //邀请玩应用home就不给奖励了?
        $m_space = getspace($uid);
        //$_SN在此被赋值
        // echo var_dump($_SN)."--_SN在getspace这个函数中赋值了...<br>";
        // echo var_dump($_SESSION['SN'])."--_SESSION['SN']<br>";
        // echo var_dump($m_space['uid'])."--m_space['uid']<br>";
        // echo var_dump($app)."--app<br>";
        // echo var_dump($code)."--code<br>";
        // echo var_dump($_SCONFIG['sitekey']).'--sitekey<br>';
        // echo space_key($m_space, $app)."--space_key<br>";
        if ($code == space_key($m_space, $app)) {
            //验证通过
            $invitearr['uid'] = $uid;
            $invitearr['username'] = $m_space['username'];
        }
        $url_plus = "uid={$uid}&app={$app}&code={$code}";
        // echo var_dump($uid)."--uid<br>";
        // echo var_dump($m_space['username'])."--m_space['username']<br>";
        // echo var_dump($invitearr)."--_invitearr1<br>";
        // echo var_dump($url_plus)."--url_plus1<br>";
    } elseif ($uid && $invite) {
        include_once S_ROOT . './source/function_cp.php';
        $invitearr = invite_get($uid, $invite);
        $url_plus = "uid={$uid}&invite={$invite}";
        // echo var_dump($invitearr)."--_invitearr2<br>";
    }
    $jumpurl = $app ? "userapp.php?id={$app}&my_extra=invitedby_bi_{$uid}_{$code}&my_suffix=Lw%3D%3D" : 'space.php?do=home';
    //好友邀请数据预处理结束
    /////////////////////////////////////
    /////////////////////////////////////
    //注册到ucenter
    // 不采用uhome及ucenter自己的登录机制,所以随机填个它的密码
    $password = md5("{$newuid}|{$_SGLOBAL['timestamp']}");
    //本地密码随机生成
    //用ucenter api注册新用户
    include S_ROOT . './uc_client/client.php';
    $newuid = uc_user_register($login, $password, $email);
    // echo var_dump($newuid)."--newuid<br/>";
    // breakpoint();
    if ($newuid <= 0) {
        if ($newuid == -1) {
            showmessage('user_name_is_not_legitimate');
        } elseif ($newuid == -2) {
            showmessage('include_not_registered_words');
        } elseif ($newuid == -3) {
            // showmessage('user_name_already_exists');
            // 如果已经在ucenter存在先通过discuz注册的用户,则为他开通uchome
            //同步获取用户源
            if (!($passport = get_passport_by_login($login))) {
                showmessage('login_failure_please_re_login', 'OpenID.call.php');
            }
            // echo var_dump($passport)."--passport<br/>";
            $setarr = array('uid' => $passport['uid'], 'username' => addslashes($passport['username']), 'password' => md5("{$passport['uid']}|{$_SGLOBAL['timestamp']}"));
            // echo var_dump($setarr)."--setarr<br/>";
            // echo var_dump($email)."--email<br/>";
            ey_regiter_user_to_uchome($setarr, $openid, $login, $email, $nickname, $invitearr, $url_plus, $app, $jumpurl);
        } elseif ($newuid == -4) {
            showmessage('email_format_is_wrong');
        } elseif ($newuid == -5) {
            showmessage('email_not_registered');
        } elseif ($newuid == -6) {
            showmessage('email_has_been_registered');
        } else {
            showmessage('register_error');
        }
    } else {
        $setarr = array('uid' => $newuid, 'username' => $login, 'password' => md5("{$newuid}|{$_SGLOBAL['timestamp']}"));
        ey_regiter_user_to_uchome($setarr, $openid, $login, $email, $nickname, $invitearr, $url_plus, $app, $jumpurl);
    }
}
开发者ID:AlexChien,项目名称:ey_uhome,代码行数:83,代码来源:function_common.php


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