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


PHP getspace函数代码示例

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


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

示例1: callback

 function callback($module, $method, $params)
 {
     global $_SITE_CONFIG;
     if (isset($params['uId'])) {
         $space = getspace($params['uId']);
         if ($this->_needCheckUserId($module, $method)) {
             if (!$space['uid']) {
                 $errCode = 1;
                 $errMessage = "User({$params['uId']}) Not Exists";
                 return new APIErrorResponse($errCode, $errMessage);
             }
         }
     }
     $_SITE_CONFIG['uid'] = $space['uid'];
     $_SITE_CONFIG['uname'] = $space['uname'];
     @(include_once API_ROOT . '/class/' . $module . '.class.php');
     if (!class_exists($module)) {
         $errCode = 3;
         $errMessage = "Class({$module}) Not Exists";
         return new APIErrorResponse($errCode, $errMessage);
     }
     $class = new $module();
     $response = @call_user_func_array(array(&$class, $method), $params);
     return $response;
 }
开发者ID:laiello,项目名称:thinksns-2,代码行数:25,代码来源:My.class.php

示例2: 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

示例3: empty

    if ($ms[1] != 'cp' || $ms[2] != 'sendmail') {
        $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;
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_cas_login.php

示例4: getUserSpace

 function getUserSpace($uId)
 {
     global $_G;
     $space = getspace($uId);
     if (!$space['uid']) {
         return false;
     }
     $_G['uid'] = $space['uid'];
     $_G['username'] = $space['username'];
     return true;
 }
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:11,代码来源:my.php

示例5: stream_save

function stream_save($strdata, $albumid = 0, $fileext = 'jpg', $name = '', $title = '', $delsize = 0, $from = false)
{
    global $_G, $space;
    if ($albumid < 0) {
        $albumid = 0;
    }
    $setarr = array();
    require_once libfile('class/upload');
    $upload = new discuz_upload();
    $filepath = $upload->get_target_dir('album') . $upload->get_target_filename('album') . '.' . $fileext;
    $newfilename = $_G['setting']['attachdir'] . './album/' . $filepath;
    if ($handle = fopen($newfilename, 'wb')) {
        if (fwrite($handle, $strdata) !== FALSE) {
            fclose($handle);
            $size = filesize($newfilename);
            if (empty($space)) {
                $_G['member'] = $space = getspace($_G['uid']);
                $_G['username'] = addslashes($space['username']);
            }
            $_G['member'] = $space;
            $maxspacesize = checkperm('maxspacesize');
            $maxspacesize = $maxspacesize * 1024 * 1024;
            if ($maxspacesize) {
                space_merge($space, 'common_member_count');
                space_merge($space, 'common_member_field_home');
                if ($space['attachsize'] + $size - $delsize > $maxspacesize + $space['addsize']) {
                    @unlink($newfilename);
                    return -1;
                }
            }
            if (!$upload->get_image_info($newfilename)) {
                @unlink($newfilename);
                return -2;
            }
            require_once libfile('class/image');
            $image = new image();
            $result = $image->Thumb($newfilename, NULL, 140, 140, 1);
            $thumb = empty($result) ? 0 : 1;
            $image->Watermark($newfilename);
            $pic_remote = 0;
            $album_picflag = 1;
            if (getglobal('setting/ftp/on')) {
                $ftpresult_thumb = 0;
                $ftpresult = ftpupload('album/' . $filepath);
                if ($ftpresult) {
                    if ($thumb) {
                        ftpupload('album/' . $filepath . '.thumb.jpg');
                    }
                    $pic_remote = 1;
                    $album_picflag = 2;
                } else {
                    if (getglobal('setting/ftp/mirror')) {
                        @unlink($newfilename);
                        @unlink($newfilename . '.thumb.jpg');
                        return -3;
                    }
                }
            }
            $filename = addslashes($name ? $name : substr(strrchr($filepath, '/'), 1));
            $title = getstr($title, 200, 1, 1, 1);
            if ($albumid) {
                $albumid = album_creat_by_id($albumid);
            } else {
                $albumid = 0;
            }
            $setarr = array('albumid' => $albumid, 'uid' => $_G['uid'], 'username' => $_G['username'], 'dateline' => $_G['timestamp'], 'filename' => $filename, 'postip' => $_G['clientip'], 'title' => $title, 'type' => $fileext, 'size' => $size, 'filepath' => $filepath, 'thumb' => $thumb, 'remote' => $pic_remote);
            $setarr['picid'] = DB::insert('home_pic', $setarr, 1);
            DB::query("UPDATE " . DB::table('common_member_count') . " SET attachsize=attachsize+{$size} WHERE uid='{$_G['uid']}'");
            include_once libfile('function/stat');
            updatestat('pic');
            return $setarr;
        } else {
            fclose($handle);
        }
    }
    return -3;
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:77,代码来源:function_spacecp.php

示例6: getmember

function getmember()
{
    global $_SGLOBAL, $space;
    if (empty($_SGLOBAL['member']) && $_SGLOBAL['supe_uid']) {
        if ($space['uid'] == $_SGLOBAL['supe_uid']) {
            $_SGLOBAL['member'] = $space;
        } else {
            $_SGLOBAL['member'] = getspace($_SGLOBAL['supe_uid']);
        }
    }
}
开发者ID:NaturalWill,项目名称:UCQA,代码行数:11,代码来源:function_common.php

示例7: updatetable

                if ($invitearr['email'] == $email) {
                    updatetable('spacefield', array('emailcheck' => 1), array('uid' => $newuid));
                }
                //统计更新
                include_once S_ROOT . './source/function_cp.php';
                if ($app) {
                    updatestat('appinvite');
                } else {
                    updatestat('invite');
                }
            }
            //变更记录
            if ($_SCONFIG['my_status']) {
                inserttable('userlog', array('uid' => $newuid, 'action' => 'add', 'dateline' => $_SGLOBAL['timestamp']), 0, true);
            }
            capi_showmessage_by_data('registered', 0, array("space" => getspace($space["uid"]), "m_auth" => rawurlencode($auth)));
        }
    }
    $register_rule = data_get('registerrule');
    //include template('do_register');
} elseif ($op == "checkusername") {
    $username = trim($_REQUEST['username']);
    if (empty($username)) {
        capi_showmessage_by_data('user_name_is_not_legitimate');
    }
    @(include_once S_ROOT . './uc_client/client.php');
    $ucresult = uc_user_checkname($username);
    if ($ucresult == -1) {
        capi_showmessage_by_data('user_name_is_not_legitimate');
    } elseif ($ucresult == -2) {
        capi_showmessage_by_data('include_not_registered_words');
开发者ID:NaturalWill,项目名称:UCQA,代码行数:31,代码来源:do_register.php

示例8: showmessage

 if (!checkperm('allowshare')) {
     showmessage('no_privilege_share');
 }
 cknewuser();
 $type = empty($_GET['type']) ? '' : $_GET['type'];
 $id = empty($_GET['id']) ? 0 : intval($_GET['id']);
 $note_uid = 0;
 $note_message = '';
 $note_values = array();
 $hotarr = array();
 $arr = array();
 $feed_hash_data = '';
 switch ($type) {
     case 'space':
         $feed_hash_data = "uid{$id}";
         $tospace = getspace($id);
         if (empty($tospace)) {
             showmessage('space_does_not_exist');
         }
         if (isblacklist($tospace['uid'])) {
             showmessage('is_blacklist');
         }
         $arr['itemid'] = $id;
         $arr['fromuid'] = $id;
         $arr['title_template'] = lang('spacecp', 'share_space');
         $arr['body_template'] = '<b>{username}</b><br>{reside}<br>{spacenote}';
         $arr['body_data'] = array('username' => "<a href=\"home.php?mod=space&uid={$id}\">" . $tospace['username'] . "</a>", 'reside' => $tospace['resideprovince'] . $tospace['residecity'], 'spacenote' => $tospace['spacenote']);
         loaducenter();
         $isavatar = uc_check_avatar($id);
         $arr['image'] = $isavatar ? avatar($id, 'middle', true) : UC_API . '/images/noavatar_middle.gif';
         $arr['image_link'] = "home.php?mod=space&uid={$id}";
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:31,代码来源:spacecp_share.php

示例9: showmessage

         $query = DB::query("SELECT * FROM " . DB::table('home_share') . " WHERE sid='{$id}'");
         $share = DB::fetch($query);
         if (empty($share)) {
             showmessage('sharing_does_not_exist');
         }
         $tospace = getspace($share['uid']);
         $hotarr = array('sid', $share['sid'], $share['hotuser']);
         $stattype = 'sharecomment';
         break;
     case 'pid':
         $query = DB::query("SELECT p.*, pf.hotuser\n\t\t\t\tFROM " . DB::table('home_poll') . " p\n\t\t\t\tLEFT JOIN " . DB::table('home_pollfield') . " pf ON pf.pid=p.pid\n\t\t\t\tWHERE p.pid='{$id}'");
         $poll = DB::fetch($query);
         if (empty($poll)) {
             showmessage('voting_does_not_exist');
         }
         $tospace = getspace($poll['uid']);
         if ($poll['noreply']) {
             if (!$tospace['self'] && !in_array($_G['uid'], $tospace['friends'])) {
                 showmessage('the_vote_only_allows_friends_to_comment');
             }
         }
         $hotarr = array('pid', $poll['pid'], $poll['hotuser']);
         $stattype = 'pollcomment';
         break;
     default:
         showmessage('non_normal_operation');
         break;
 }
 if (empty($tospace)) {
     showmessage('space_does_not_exist');
 }
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:31,代码来源:spacecp_comment.php

示例10: getreward

$invitepay = getreward('invitecode', 0);
if ($uid && $code) {
    $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}";
}
$jumpurl = $app ? "userapp.php?id={$app}&my_extra=invitedby_bi_{$uid}_{$code}&my_suffix=Lw%3D%3D" : 'space.php';
$space = getspace($_GET['uid']);
$arr_classfriend = array();
$usertype = '';
$sub = '';
if (empty($op)) {
    if ($_SCONFIG['closeregister']) {
        if ($_SCONFIG['closeinvite']) {
            showmessage('not_open_registration');
        } elseif (empty($invitearr)) {
            showmessage('not_open_registration_invite');
        }
    }
    checkclose();
    if (submitcheck("registersubmit")) {
        //ÒѾ­×¢²áÓû§
        if ($_SGLOBAL['supe_uid']) {
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_register.php

示例11: empty

@(include_once S_ROOT . './data/data_click.php');
$clicks = empty($_SGLOBAL['click']['tid']) ? array() : $_SGLOBAL['click']['tid'];
//分页
$page = empty($_GET['page']) ? 1 : intval($_GET['page']);
if ($page < 1) {
    $page = 1;
}
$id = empty($_GET['id']) ? 0 : intval($_GET['id']);
if ($id) {
    //话题
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('thread') . " WHERE tid='{$id}' LIMIT 1");
    if (!($thread = $_SGLOBAL['db']->fetch_array($query))) {
        showmessage('topic_does_not_exist');
    }
    //验证空间是否被锁定
    $space = getspace($thread['uid']);
    if ($space['flag'] == -1) {
        showmessage('space_has_been_locked');
    }
    realname_set($thread['uid'], $thread['username']);
    //群组信息
    $tagid = $thread['tagid'];
    if ($eventid && $event['tagid'] != $tagid) {
        showmessage('event_mtag_not_match');
    }
    if (!$eventid && $thread['eventid']) {
        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname("event") . " WHERE eventid='{$thread['eventid']}' LIMIT 1");
        $event = $_SGLOBAL['db']->fetch_array($query);
        if (empty($event)) {
            updatetable('thread', array("eventid" => 0), array("eventid" => $thread['eventid']));
        }
开发者ID:NaturalWill,项目名称:UCQA,代码行数:31,代码来源:space_thread.php

示例12: realname_set

            realname_set($value['uid'], $value['username']);
            if (empty($value['upid'])) {
                $value['upid'] = "do";
            }
            $tree->setNode($value['id'], $value['upid'], $value);
        }
        $values = $tree->getChilds("do");
        foreach ($values as $key => $id) {
            $one = $tree->getValue($id);
            $one['layer'] = $tree->getLayer($id) * 2;
            $clist[] = $one;
        }
    }
    realname_get();
} elseif ($op == 'getmood') {
    $space = empty($_SGLOBAL['supe_uid']) ? array() : getspace($_SGLOBAL['supe_uid']);
    if ($space['spacenote']) {
        $space['spacenote'] = getstr($space['spacenote'], 50);
    }
} elseif ($op == 'deluserapp') {
    if (empty($_SGLOBAL['supe_uid'])) {
        showmessage('no_privilege');
    }
    $hash = trim($_GET['hash']);
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('myinvite') . " WHERE hash='{$hash}' AND touid='{$_SGLOBAL['supe_uid']}'");
    if ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $_SGLOBAL['db']->query("DELETE FROM " . tname('myinvite') . " WHERE hash='{$hash}' AND touid='{$_SGLOBAL['supe_uid']}'");
        showmessage('do_success');
    } else {
        showmessage('no_privilege');
    }
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:31,代码来源:do_ajax.php

示例13: while

    while ($row = $_SGLOBAL['db']->fetch_array($query)) {
        if (!strcmp($row['uid'], $_GET['uid'])) {
            $space = getspace($_GET['uid']);
            if (empty($space)) {
                showmessage('space_does_not_exist');
            }
            include template("invite");
            return;
        }
    }
} else {
    if (empty($_GET['type']) && !empty($_GET['u'])) {
        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('emailinvite') . " where uid='" . $_GET['u'] . "'");
        while ($row = $_SGLOBAL['db']->fetch_array($query)) {
            if (!strcmp($row['uid'], $_GET['u'])) {
                $space = getspace($_GET['u']);
                if (empty($space)) {
                    showmessage('space_does_not_exist');
                }
                include template("invite");
                return;
            }
        }
    }
}
if (!empty($_GET['type']) && !strcmp($_GET['type'], 'mobile')) {
    $var = $_POST['var'];
    $mobile = $_POST['mobile'];
    $flag = false;
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('mobileinvite') . " WHERE uid=" . $_GET['uid'] . " and mobile=" . $mobile . " and var=" . $var);
    while ($row = $_SGLOBAL['db']->fetch_array($query)) {
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:invite.php

示例14: showmessage

} else {
    if (!checkperm('allowshare')) {
        showmessage('no_privilege');
    }
    //实名认证
    ckrealname('share');
    //新用户见习
    cknewuser();
    $type = empty($_GET['type']) ? '' : $_GET['type'];
    $id = empty($_GET['id']) ? 0 : intval($_GET['id']);
    $note_uid = 0;
    $note_message = '';
    $arr = array();
    switch ($type) {
        case 'space':
            $cspace = getspace($id);
            if (empty($cspace)) {
                showmessage('space_does_not_exist');
            }
            //黑名单
            if (isblacklist($cspace['uid'])) {
                showmessage('is_blacklist');
            }
            $arr['title_template'] = cplang('share_space');
            $arr['body_template'] = '<b>{username}</b><br>{reside}<br>{spacenote}';
            $arr['body_data'] = array('username' => "<a href=\"space.php?uid={$id}\">" . $_SN[$cspace['uid']] . "</a>", 'reside' => $cspace['resideprovince'] . $cspace['residecity'], 'spacenote' => $cspace['spacenote']);
            $arr['image'] = avatar($id, 'middle');
            $arr['image_link'] = "space.php?uid={$id}";
            //通知
            $note_uid = $id;
            $note_message = cplang('note_share_space');
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:31,代码来源:cp_share.php

示例15: count

        $rw_count = count($rws);
        for ($rw_i = 1; $rw_i < $rw_count; $rw_i = $rw_i + 2) {
            $_GET[$rws[$rw_i]] = empty($rws[$rw_i + 1]) ? '' : $rws[$rw_i + 1];
        }
    }
    unset($_GET['rewrite']);
}
//允许的方法
$acs = array('space', 'doing', 'blog', 'album', 'mtag', 'thread', 'share');
$ac = empty($_GET['ac']) || !in_array($_GET['ac'], $acs) ? 'index' : $_GET['ac'];
$theurl = "network.php?ac={$ac}";
//是否公开
if (empty($_SCONFIG['networkpublic'])) {
    checklogin();
}
$space = $_SGLOBAL['supe_uid'] ? getspace($_SGLOBAL['supe_uid']) : array();
//数据处理
include_once S_ROOT . "./source/network_{$ac}.php";
//菜单激活
$menuactives = array('network' => ' class="active"');
//应用列表
@(include_once S_ROOT . './uc_client/data/cache/apps.php');
//模板调用
$actives = array($ac => ' class="active"');
include_once template("network_{$ac}");
//判断搜索积分
function cksearchcredit($ac)
{
    global $space, $gets;
    //搜索积分
    $paycredit = creditrule('pay', 'search');
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:31,代码来源:network.php


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