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


PHP realname_set函数代码示例

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


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

示例1: elseif

        } elseif ($isreply == 2) {
            $isreply = 0;
            $wheresql .= " AND temp.isreply={$isreply}";
        }
    }
    $where = " WHERE " . $wheresql . " AND temp.atdeptuid IN (" . $dept_uids . ")";
    $mpurl = "plugin.php?pluginid=complain&type=complains&uid={$uid}&uname={$uname}&message={$message}&atuname={$atuname}";
    //echo $where;exit();
    $count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(DISTINCT doid,atdeptuid) FROM " . tname('complain') . " temp" . $where), 0);
    //echo $count;exit();
    if ($count) {
        include S_ROOT . './data/powerlevel/powerlevel.php';
        $query = $_SGLOBAL['db']->query("SELECT * FROM (SELECT * FROM " . tname('complain') . " USE INDEX(id) ORDER BY id DESC) temp" . $where . " GROUP BY doid,atdeptuid ORDER BY doid DESC LIMIT {$start},{$perpage}");
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            $value['addtime'] = date("Y-m-d H:i", $value['addtime']);
            realname_set($value['uid'], $value['uname']);
            $value['atuname'] = $_POWERINFO[$value['atuid']]['department'];
            $Complains[] = $value;
        }
        $multi = multi($count, $perpage, $page, $mpurl);
        realname_get();
    }
} else {
    $tab = 0;
    $complains = array();
    $totalNum = 0;
    $isreplyNum = 0;
    $firstday = date("Y-m-01", time());
    $nowday = date("Y-m-d");
    $startDay = $_GET['starttime'] ? trim($_GET['starttime']) : $firstday;
    $endDay = $_GET['endtime'] ? trim($_GET['endtime']) : $nowday;
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:list.php

示例2: pic_get

		$count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query($sql),0);
	}
	if($count){
		if($needquery) {
			$sql = "SELECT e.* FROM $fromsql $joinsql WHERE ".implode(" AND ", $wherearr) ." ORDER BY $orderby LIMIT $start, $perpage";
		}
		$query = $_SGLOBAL['db']->query($sql);
		while($event = $_SGLOBAL['db']->fetch_array($query)){
			if($event['poster']){
				$event['pic'] = pic_get($event['poster'], $event['thumb'], $event['remote']);
			} else {
				$event['pic'] = $_SGLOBAL['eventclass'][$event['classid']]['poster'];
			}
			realname_set($event['uid'], $event['username']);
			if($view=="friend"){
				realname_set($event['fuid'], $event['fusername']);
				$fevents[$event['eventid']][] = array("fuid"=>$event['fuid'], "fusername"=>$event['fusername'], "status"=>$event['status']);
			}
			$eventlist[$event['eventid']] = $event;
		}
	}

	realname_get();

	$multi = multi($count, $perpage, $page, $theurl);
	$menu = array($view => ' class="active"');

	$_TPL['css'] = 'event';
	include template("space_event_list");
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:30,代码来源:space_event.php

示例3: showmessage

}
$password = $value[2];
//同步获取用户源
if (!($passport = getpassport($username, $password))) {
    showmessage('login_failure_please_re_login', 'do.php?ac=' . $_SCONFIG['login_action']);
}
$setarr = array('uid' => $passport['uid'], 'username' => addslashes($passport['username']), 'password' => md5("{$passport['uid']}|{$_SGLOBAL['timestamp']}"));
include_once S_ROOT . './source/function_space.php';
//开通空间
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('space') . " WHERE uid='{$setarr['uid']}'");
if (!($space = $_SGLOBAL['db']->fetch_array($query))) {
    $space = space_open($setarr['uid'], $setarr['username'], 0, $passport['email']);
}
$_SGLOBAL['member'] = $space;
//实名
realname_set($space['uid'], $space['username'], $space['name'], $space['namestatus']);
//检索当前用户
$query = $_SGLOBAL['db']->query("SELECT password FROM " . tname('member') . " WHERE uid='{$setarr['uid']}'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
    $setarr['password'] = addslashes($value['password']);
} else {
    //更新本地用户库
    inserttable('member', $setarr, 0, true);
}
//清理在线session
insertsession($setarr);
//同步登录
if ($_SCONFIG['uc_status']) {
    include_once S_ROOT . './uc_client/client.php';
    $ucsynlogin = uc_user_synlogin($setarr['uid']);
} else {
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_cas_login.php

示例4: updatetable

     updatetable('notification', array('new' => '0'), array('new' => '1', 'uid' => $_SGLOBAL['supe_uid']));
     updatetable('space', array('notenum' => 0), array('uid' => $_SGLOBAL['supe_uid']));
     $space['notenum'] = 0;
 }
 //通知类型
 $noticetypes = array('wall' => lang('wall'), 'piccomment' => lang('pic_comment'), 'blogcomment' => lang('blog_comment'), 'clickblog' => lang('clickblog'), 'clickpic' => lang('clickpic'), 'clickthread' => lang('clickthread'), 'sharecomment' => lang('share_comment'), 'sharenotice' => lang('share_notice'), 'doing' => lang('doing_comment'), 'friend' => lang('friend_notice'), 'post' => lang('thread_comment'), 'credit' => lang('credit'), 'mtag' => lang('mtag'), 'event' => lang('event'), 'eventcomment' => lang('event_comment'), 'eventmember' => lang('event_member'), 'eventmemberstatus' => lang('event_memberstatus'), 'poll' => lang('poll'), 'pollcomment' => lang('poll_comment'), 'pollinvite' => lang('poll_invite'), 'clickbwzt' => lang('clickbwzt'), 'bwztcomment' => lang('bwzt_comment'));
 $type = trim($_GET['type']);
 $typesql = $type ? "AND type='{$type}'" : '';
 $newids = array();
 $count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('notification') . " WHERE uid='{$_SGLOBAL['supe_uid']}' {$typesql}"), 0);
 if ($count) {
     //$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('notification')." WHERE uid='$_SGLOBAL[supe_uid]' $typesql ORDER BY dateline DESC LIMIT $start,$perpage");
     $query = $_SGLOBAL['db']->query("SELECT s.name,n.* FROM " . tname('notification') . " n LEFT JOIN " . tname('space') . " s ON s.uid=n.authorid WHERE n.uid='{$_SGLOBAL['supe_uid']}' {$typesql} ORDER BY n.dateline DESC LIMIT {$start},{$perpage}");
     while ($value = $_SGLOBAL['db']->fetch_array($query)) {
         if ($value['authorid']) {
             realname_set($value['authorid'], $value['author']);
             if ($value['authorid'] != $space['uid'] && $space['friends'] && !in_array($value['authorid'], $space['friends'])) {
                 $value['isfriend'] = 0;
             } else {
                 $value['isfriend'] = 1;
             }
         }
         if ($value['new']) {
             $newids[] = $value['id'];
             $value['style'] = 'color:#000;font-weight:bold;';
         } else {
             $value['style'] = '';
         }
         preg_match_all('/<a\\s+href[^\\"]+\\"([^\\"]+do\\=(\\w+)[^\\"]+id\\=(\\d+)[^\\"]+cid\\=(\\d+))\\"[^>]*>.*<\\/a>/i', $value['note'], $matches);
         $value['link'] = $matches[1][0];
         $n_do = $matches[2][0];
开发者ID:NaturalWill,项目名称:UCQA,代码行数:31,代码来源:space_notice.php

示例5: array

						showmessage('mtag_join_field_error', '', 1, array($field['title'], $maxinputnum));
					}
				}
				
				//加入群组
				$setarr = array(
					'tagid' => $tagid,
					'uid' => $_SGLOBAL['supe_uid'],
					'username' => $_SGLOBAL['supe_username']
				);
				$_SGLOBAL['db']->query("UPDATE ".tname('mtag')." SET membernum=membernum+1 WHERE tagid='$tagid'");
				inserttable('tagspace', $setarr, 0, true);
				
				//事件通知
				//实名
				realname_set($invite['fromuid'], $invite['fromusername']);
				realname_get();
				
				if(ckprivacy('mtag', 1)) {
					$fs = array();
					$fs['icon'] = 'mtag';
					
					$fs['title_template'] = cplang('feed_mtag_join_invite');
					$fs['title_data'] = array(
							'mtag' => "<a href=\"space.php?do=mtag&tagid=$tagid\">$mtag[tagname]</a>",
							'field' => "<a href=\"space.php?do=mtag&id=$mtag[fieldid]\">$mtag[title]</a>",
							'fromusername' => "<a href=\"space.php?uid=$invite[fromuid]\">{$_SN[$invite['fromuid']]}</a>"
						);
					$fs['body_template'] = '';
					$fs['body_data'] = array();
					$fs['body_general'] = '';
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:cp_mtag.php

示例6: array

$start = ($page - 1) * $perpage;
$result = array();
$space = getspace($userid, 'uid');
//$DBstarttime = time();
if ($space[feedfriend]) {
    $wheresql = "uid IN (0,{$space['feedfriend']},{$space['uid']}) and dateline>{$time}";
} else {
    $wheresql = "1";
}
$wheresql .= " and (body_template not like '%{eventname}%' and body_template not like '%{option}%') and icon in ('doing','blog','arrangement','thread','share','album')";
chdir(dirname(dirname(dirname(__FILE__))));
// go the ihome dir.
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('feed') . " USE INDEX(dateline) WHERE " . $wheresql . " ORDER BY dateline DESC LIMIT " . $start . "," . $perpage);
//$DBendtime = time();
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
    realname_set($value[uid], $value[username]);
    // start by an, modified by xuxing. 2013-3-27.
    //deal with the image size, if the picture is from ihome-self, get the thumb pic, if from foreign site, resize it.
    /*if(empty($value[image_1])){
    	      $value[image_1]='';	
    		}else if(preg_match("/attachment\/(.*)/",$value['image_1'],$matches) && (file_exists($_SC['attachdir'].'./'.$matches[1].'.thumb.jpg') || file_exists($_SC['attachdir'].'./'.$matches[1]))){
    			//echo file_exists($_SC['attachdir'].'./'.$matches[1]);exit();
    		  	if (file_exists($_SC['attachdir'].'./'.$matches[1].'.thumb.jpg')) {
    		  		$value['image_1'] = $_SCONFIG[siteallurl].'attachment/'.$matches[1].'.thumb.jpg';
    			}else{
    				$value['image_1'] = $_SCONFIG[siteallurl].'attachment/'.$matches[1];
    			}*/
    /*if (!file_exists($value['image_1'])) {
      $value['image_1']='(图片来自外网,耗费流量较多,请使用浏览器查看)';
      }*/
    /*}else{
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_getallthings.php

示例7: array

 $wherearr = array();
 $_GET['key'] = stripsearchkey($_GET['key']);
 if ($_GET['key']) {
     $wherearr[] = " fusername LIKE '%{$_GET['key']}%' ";
 }
 $_GET['group'] = isset($_GET['group']) ? intval($_GET['group']) : -1;
 if ($_GET['group'] >= 0) {
     $wherearr[] = " gid='{$_GET['group']}'";
 }
 $sql = $wherearr ? 'AND' . implode(' AND ', $wherearr) : '';
 $count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('friend') . " WHERE uid='{$_SGLOBAL['supe_uid']}' AND status='1' {$sql}"), 0);
 $fuids = array();
 if ($count) {
     $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('friend') . " WHERE uid='{$_SGLOBAL['supe_uid']}' AND status='1' {$sql} ORDER BY num DESC, dateline DESC LIMIT {$start},{$perpage}");
     while ($value = $_SGLOBAL['db']->fetch_array($query)) {
         realname_set($value['fuid'], $value['fusername']);
         $list[] = $value;
         $fuids[] = $value['fuid'];
     }
 }
 $invitearr = array();
 //Already participated in the poll
 $query = $_SGLOBAL['db']->query("SELECT uid FROM " . tname('polluser') . " WHERE uid IN (" . simplode($fuids) . ") AND pid='{$pid}'");
 while ($value = $_SGLOBAL['db']->fetch_array($query)) {
     $invitearr[$value['uid']] = $value['uid'];
 }
 // allready invited
 foreach ($uidarr as $key => $uid) {
     $invitearr[$uid] = $uid;
 }
 realname_get();
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:cp_poll.php

示例8: DB_Set_Logined

function DB_Set_Logined($uid)
{
    global $db, $_SGLOBAL, $_SN;
    // echo var_dump($_SN)."--_SN0<br>";
    $setarr = array('uid' => $uid, 'username' => '', 'password' => '');
    $query = $db->query("SELECT username,password FROM " . tname('member') . " WHERE uid='{$setarr['uid']}'");
    if ($value = $db->fetch_array($query)) {
        $setarr['username'] = addslashes($value['username']);
        $setarr['password'] = addslashes($value['password']);
    }
    $invitearr = $_SESSION['invitearr'];
    //从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
    $url_plus = $_SESSION['url_plus'];
    //从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
    $app = $_SESSION['app'];
    //从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
    $_SN = $_SESSION['SN'];
    //从会话里取出后边要用的这个变量
    // echo var_dump($invitearr)."--invitearr<br>";
    // echo var_dump($url_plus)."--url_plus<br>";
    // echo var_dump($app)."--app<br>";
    // echo var_dump($_SN)."--_SN1<br>";
    include_once S_ROOT . './source/function_space.php';
    //开通空间
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('space') . " WHERE uid='{$setarr['uid']}'");
    if (!($space = $_SGLOBAL['db']->fetch_array($query))) {
        $space = space_open($setarr['uid'], $setarr['username'], 0, $passport['email']);
    }
    $_SGLOBAL['member'] = $space;
    //实名
    realname_set($space['uid'], $space['username'], $space['name'], $space['namestatus']);
    //这里$_SN再次被赋值
    // echo var_dump($_SN)."--_SN2<br>";
    //设置cookie
    ssetcookie('auth', authcode("{$setarr['password']}\t{$setarr['uid']}", 'ENCODE'), $cookietime);
    ssetcookie('loginuser', $passport['username'], 31536000);
    ssetcookie('_refer', '');
    //同步登录
    include_once S_ROOT . './uc_client/client.php';
    $ucsynlogin = uc_user_synlogin($setarr['uid']);
    // echo var_dump($ucsynlogin)."--ucsynlogin<br>";
    //好友邀请
    if ($invitearr) {
        // echo $_SGLOBAL."--_SGLOBAL1<br>";
        // echo var_dump($_SN)."--_SN1<br>";
        // echo var_dump($invitearr['id'])."--invitearr['id']<br>";
        // echo var_dump($setarr['uid'])."--setarr['uid']<br>";
        // echo var_dump($setarr['username'])."--setarr['username']<br>";
        // echo var_dump($invitearr['uid'])."--invitearr['uid']<br>";
        // echo var_dump($invitearr['username'])."--invitearr['username']<br>";
        //成为好友
        invite_update($invitearr['id'], $setarr['uid'], $setarr['username'], $invitearr['uid'], $invitearr['username'], $app);
    }
    // echo var_dump($_SGLOBAL['supe_uid'])."--_SGLOBAL['supe_uid']<br>";
    // echo var_dump($space['uid'])."--space['uid']<br>";
    //判断用户是否设置了头像
    $_SGLOBAL['supe_uid'] = $space['uid'];
    $reward = $setarr = array();
    $experience = $credit = 0;
    $avatar_exists = ckavatar($space['uid']);
    if ($avatar_exists) {
        if (!$space['avatar']) {
            //奖励积分
            $reward = getreward('setavatar', 0);
            $credit = $reward['credit'];
            $experience = $reward['experience'];
            if ($credit) {
                $setarr['credit'] = "credit=credit+{$credit}";
            }
            if ($experience) {
                $setarr['experience'] = "experience=experience+{$experience}";
            }
            $setarr['avatar'] = 'avatar=1';
            $setarr['updatetime'] = "updatetime={$_SGLOBAL['timestamp']}";
        }
    } else {
        if ($space['avatar']) {
            $setarr['avatar'] = 'avatar=0';
        }
    }
    if (empty($_POST['refer'])) {
        $_POST['refer'] = 'space.php?do=home';
    }
    realname_get();
    showmessage('login_success', $app ? "userapp.php?id={$app}" : $_POST['refer'], 1, array($ucsynlogin));
}
开发者ID:AlexChien,项目名称:ey_uhome,代码行数:86,代码来源:OpenID.func.php

示例9: tname

//应该要除去同班同学
//	if(empty($fdr)) {
$query = $_SGLOBAL['db']->query("SELECT academy FROM " . tname('baseprofile') . " WHERE uid=" . $space['uid'] . " AND academy IS NOT NULL LIMIT 1 ");
if ($academy = $_SGLOBAL['db']->result($query)) {
    $query = $_SGLOBAL['db']->query("SELECT uid FROM " . tname('baseprofile') . " WHERE\tacademy='{$academy}' AND isactive = 1 LIMIT 10 ");
    while ($academymate = $_SGLOBAL['db']->fetch_array($query)) {
        if (!in_array($academymate[uid], $space[friends])) {
            realname_set($academymate['uid']);
            $fdr[$academymate['uid']] = $academymate;
        }
    }
}
//	if (empty($fdr))
//		{
//依据spaceinfo来的~
$query = $_SGLOBAL['db']->query("SELECT subtitle FROM " . tname('spaceinfo') . " WHERE uid=" . $space['uid'] . " AND subtitle iS NOT NULL LIMIT 1 ");
if ($subtitle = $_SGLOBAL['db']->result($query)) {
    $query = $_SGLOBAL['db']->query("SELECT uid FROM " . tname('spaceinfo') . " WHERE\tsubtitle='{$subtitle}' LIMIT 10 ");
    while ($acdsf = $_SGLOBAL['db']->fetch_array($query)) {
        if (!in_array($acdsf[uid], $space[friends])) {
            realname_set($acdsf['uid']);
            $fdr[$acdsf['uid']] = $acdsf;
        }
    }
}
//		}
//	}
$reclist = $fdr;
if (is_array($reclist)) {
    shuffle($reclist);
}
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:space_friendrecommend.php

示例10: empty

<?php 
/*
     do_getthepic.php获得相册内某个图片的相关信息
     Add by am@ihome.2012-12-17  11:07
*/
include_once '../data_oauth_check.php';
include_once '../../../common.php';
//$picid= 193;
$picid = empty($_POST['picid']) ? 0 : intval($_POST['picid']);
$result = array();
$wheresql = "a.albumid = p.albumid and p.picid = {$picid}";
$query = $_SGLOBAL['db']->query("SELECT p.albumid,p.uid,p.dateline,p.title,p.filepath,p.filename,p.albumid,a.albumname,p.username FROM " . tname('album') . " a , " . tname('pic') . " p  WHERE " . $wheresql);
while ($album = $_SGLOBAL['db']->fetch_array($query)) {
    $pic[] = $album;
    realname_set($album['uid'], $album['username']);
}
realname_get();
foreach ($pic as $album) {
    $result[] = array('pic_userpic' => avatar($album['uid'], small), 'pic_username' => $_SN[$album['uid']], 'pic_userid' => $album[uid], 'pic_time' => $album[dateline], 'pic_note' => $album[title], 'pic_url' => $album[filepath], 'pic_name' => $album[filename], 'pic_albumid' => $album[albumid], 'pic_album' => $album[albumname]);
}
$result = json_encode($result);
$result = preg_replace("#\\\\u([0-9a-f]{4})#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $result);
echo $result;
exit;
开发者ID:shiyake,项目名称:php-ihome,代码行数:24,代码来源:do_getthepic.php

示例11: mkfeed

        }
        $a_value = mkfeed($a_value, $actors);
        $list['app'][] = $a_value;
    }
}
$_SGLOBAL['news_list'] = $list;
if (!empty($_GET['show'])) {
    include_once template(cp_feed_news);
    exit;
}
//获得最新10条已处理的诉求信息
$complainQuery = $_SGLOBAL['db']->query("select * from " . tname("complain_op") . " order by dateline DESC LIMIT 10");
while ($complain = $_SGLOBAL['db']->fetch_array($complainQuery)) {
    $complain['dateline'] = date("Y-m-d H:i", $complain['dateline']);
    if (!$complain['uid']) {
        realname_set($complain['uid'], $complain['username']);
    } elseif (empty($_SN[$complain['uid']])) {
        $_SN[$complain['uid']] = getUsername($complain['uid'], $_SGLOBAL['db']);
    }
    $Complains[] = $complain;
}
$isLeader = FALSE;
$dept_uids = '0';
$dept_uids .= getBaseDepartmentID($_SGLOBAL[supe_uid]);
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('complain_uid') . " WHERE uid={$_SGLOBAL['supe_uid']}");
if ($value = $_SGLOBAL['db']->fetch_array($query) || $dept_uids != '0') {
    $isLeader = TRUE;
}
//获得个性模板
$templates = $default_template = array();
$tpl_dir = sreaddir(S_ROOT . './template');
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:space_feed.php

示例12: regiter_user_to_uchome

function regiter_user_to_uchome()
{
    global $_SCONFIG, $_SGLOBAL, $_SN, $openid_identifier, $setarr, $email, $username, $newuid;
    // echo var_dump($_SCONFIG)."--_SCONFIG<br/>";
    // echo var_dump($_SGLOBAL)."--_SGLOBAL<br/>";
    // echo var_dump($setarr)."--setarr<br/>";
    $invitearr = $_SESSION['invitearr'];
    //从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
    $url_plus = $_SESSION['url_plus'];
    //从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
    $app = $_SESSION['app'];
    //从会话里将已有帐户登录时的邀请信息取出,不用从通行证返回信息里取
    $_SN = $_SESSION['SN'];
    //从会话里取出后边要用的这个变量
    // echo var_dump($invitearr)."--invitearr<br>";
    // echo var_dump($url_plus)."--url_plus<br>";
    // echo var_dump($app)."--app<br>";
    // echo var_dump($_SN)."--_SN1<br>";
    // echo var_dump($_SESSION['jumpurl'])."--_SESSION['jumpurl']<br/>";
    //开通空间
    // echo var_dump($_SGLOBAL['db'])."--_SGLOBAL['db']<br/>";
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('space') . " WHERE uid='{$setarr['uid']}'");
    // echo var_dump($query)."--query<br/>";
    include S_ROOT . './source/function_space.php';
    if (!($space = $_SGLOBAL['db']->fetch_array($query))) {
        $space = space_open($setarr['uid'], $setarr['username'], 0, $email);
    }
    // echo var_dump($space)."--space<br/>";
    // breakpoint();
    $_SGLOBAL['member'] = $space;
    // echo var_dump($_SGLOBAL['member'])."--_SGLOBAL['member']<br/>";
    //实名
    realname_set($space['uid'], $space['username'], $space['name'], $space['namestatus']);
    //这里$_SN再次被赋值
    // echo var_dump($_SN)."--_SNn2<br>";
    //检索当前用户
    $query = $_SGLOBAL['db']->query("SELECT password FROM " . tname('member') . " WHERE uid='{$setarr['uid']}'");
    if ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $setarr['password'] = addslashes($value['password']);
    } else {
        //更新本地用户库
        inserttable('member', $setarr, 0, true);
    }
    // 关联uid和openid
    //$db->query("INSERT INTO {$tablepre}user_openids VALUES (null,$newuid,'$openid_identifier')");//openid自带的db链接
    $openids = array('uid' => $setarr['uid'], 'url' => $openid_identifier);
    inserttable('user_openids', $openids, 0, true);
    //uchome的db链接
    // showmessage($openidlang['msg_bind_ok'],$plugin_url);//绑定成功
    //默认好友
    $flog = $inserts = $fuids = $pokes = array();
    echo var_dump($_SCONFIG['defaultfusername']) . "--_SCONFIG['defaultfusername']<br/>";
    if (!empty($_SCONFIG['defaultfusername'])) {
        $query = $_SGLOBAL['db']->query("SELECT uid,username FROM " . tname('space') . " WHERE username IN (" . simplode(explode(',', $_SCONFIG['defaultfusername'])) . ")");
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            $value = saddslashes($value);
            $fuids[] = $value['uid'];
            $inserts[] = "('{$newuid}','{$value['uid']}','{$value['username']}','1','{$_SGLOBAL['timestamp']}')";
            //$inserts[] = "('$value[uid]','$newuid','$username','1','$_SGLOBAL[timestamp]')";
            $inserts[] = "('{$value['uid']}','{$newuid}','{$setarr['username']}','1','{$_SGLOBAL['timestamp']}')";
            $pokes[] = "('{$newuid}','{$value['uid']}','{$value['username']}','" . addslashes($_SCONFIG['defaultpoke']) . "','{$_SGLOBAL['timestamp']}')";
            //添加好友变更记录
            $flog[] = "('{$value['uid']}','{$newuid}','add','{$_SGLOBAL['timestamp']}')";
        }
        /////////
        if ($inserts) {
            $_SGLOBAL['db']->query("REPLACE INTO " . tname('friend') . " (uid,fuid,fusername,status,dateline) VALUES " . implode(',', $inserts));
            $_SGLOBAL['db']->query("REPLACE INTO " . tname('poke') . " (uid,fromuid,fromusername,note,dateline) VALUES " . implode(',', $pokes));
            $_SGLOBAL['db']->query("REPLACE INTO " . tname('friendlog') . " (uid,fuid,action,dateline) VALUES " . implode(',', $flog));
            //添加到附加表
            $friendstr = empty($fuids) ? '' : implode(',', $fuids);
            updatetable('space', array('friendnum' => count($fuids), 'pokenum' => count($pokes)), array('uid' => $newuid));
            updatetable('spacefield', array('friend' => $friendstr, 'feedfriend' => $friendstr), array('uid' => $newuid));
            //更新默认用户好友缓存
            include_once S_ROOT . './source/function_cp.php';
            foreach ($fuids as $fuid) {
                friend_cache($fuid);
            }
        }
    }
    //清理在线session
    insertsession($setarr);
    //设置cookie
    ssetcookie('auth', authcode("{$setarr['password']}\t{$setarr['uid']}", 'ENCODE'), 2592000);
    ssetcookie('loginuser', $username, 31536000);
    ssetcookie('_refer', '');
    // echo var_dump($invitearr)."--invitearr<br/>";
    //好友邀请
    if ($invitearr) {
        //成为好友
        invite_update($invitearr['id'], $setarr['uid'], $setarr['username'], $invitearr['uid'], $invitearr['username'], $app);
        //统计更新
        include_once S_ROOT . './source/function_cp.php';
        if ($app) {
            updatestat('appinvite');
        } else {
            updatestat('invite');
        }
    }
    $_SGLOBAL['supe_uid'] = $space['uid'];
//.........这里部分代码省略.........
开发者ID:AlexChien,项目名称:ey_uhome,代码行数:101,代码来源:OpenID.inc.php

示例13: empty

$perpage = 20;
$page = empty($_GET['page']) ? 1 : intval($_GET['page']);
if ($page < 1) {
    $page = 1;
}
$start = ($page - 1) * $perpage;
$result = array();
$query = $_SGLOBAL['db']->query("SELECT f.fusername, s.name, s.namestatus, s.groupid, s.uid, sf.note \r\n                                     FROM " . tname('friend') . " f , " . tname('spacefield') . " sf , " . tname('space') . " s\r\n                                     WHERE s.uid = f.fuid\r\n                                     AND f.fuid = sf.uid\r\n                                     AND f.uid =" . $userid . "\r\n                                     AND f.status = '1' AND groupid=3 LIMIT {$start},{$perpage}");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
    //将好友状态中的图片进行绝对路径化。 by xuxing start<img src=\"image\/face\/24.gif\" class=\"face\">
    preg_match_all("#[<]img\\s+src[=]\"(.*)\".*[>]#U", $value['note'], $matches, PREG_SET_ORDER);
    foreach ($matches as $item) {
        $TmpString = $item[1];
        $HrefString = $_SCONFIG[siteallurl] . $item[1];
        //echo "----matchstring: $MatchString----tmpstring: $TmpString----username: $HrefString\n";
        $value['note'] = str_replace($TmpString, $HrefString, $value['note']);
    }
    //将公告中的图片进行绝对路径化。 by xuxing end
    $publist[] = $value;
    realname_set($value['uid'], $value[name]);
}
realname_get();
if ($publist) {
    foreach ($publist as $value) {
        $result[] = array('pub_thumb_pic' => avatar($value[uid], middle), 'pub_name' => $_SN[$value[uid]], 'pub_id' => $value[uid], 'pub_last_message' => $value[note]);
    }
}
$result = json_encode($result);
$result = preg_replace("#\\\\u([0-9a-f]{4})#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $result);
echo $result;
exit;
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_getpubliclist.php

示例14: ckstart

    //检查开始数
    ckstart($start, $perpage);
    if ($perpage > 100) {
        $count = 1;
        $selectsql = 'feedid';
    } else {
        $count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('feed') . " WHERE {$wheresql}"), 0);
        $selectsql = '*';
    }
    $mpurl .= '&perpage=' . $perpage;
    $perpages = array($perpage => ' selected');
    $list = array();
    $multi = '';
    $managebatch = checkperm('managebatch');
    $allowbatch = true;
    if ($count) {
        $query = $_SGLOBAL['db']->query("SELECT {$selectsql} FROM " . tname('feed') . " WHERE {$wheresql} {$ordersql} LIMIT {$start},{$perpage}");
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            realname_set($value['uid'], $value['username'], $value['username'], 1);
            if (!$managebatch && $value['uid'] != $_SGLOBAL['supe_uid']) {
                $allowbatch = false;
            }
            $list[] = $value;
        }
        $multi = multi($count, $perpage, $page, $mpurl);
    }
    if ($perpage > 100) {
        $count = count($list);
    }
    realname_get();
}
开发者ID:NaturalWill,项目名称:UCQA,代码行数:31,代码来源:admincp_feed.php

示例15: getcount

	//赠送
	$count = getcount('show', array('uid'=>$fuid));
	if($count) {
		$_SGLOBAL['db']->query("UPDATE ".tname('show')." SET credit=credit+$showcredit WHERE uid='$fuid'");
	} else {
		inserttable('show', array('uid'=>$fuid, 'username'=>$_POST['fusername'], 'credit'=>$showcredit), 0, true);
	}
	
	//减少自己的积分
	$_SGLOBAL['db']->query("UPDATE ".tname('space')." SET credit=credit-$showcredit WHERE uid='$space[uid]'");
	
	//给好友通知
	notification_add($fuid, 'credit', cplang('note_showcredit', array($showcredit)));
	
	//实名
	realname_set($fuid, $_POST['fusername']);
	realname_get();
	
	//feed
	if(ckprivacy('show', 1)) {
		feed_add('show', cplang('feed_showcredit'), array(
			'fusername'=>"<a href=\"space.php?uid=$fuid\">{$_SN[$fuid]}</a>",
			'credit'=>$showcredit));
	}
	
	showmessage('showcredit_friend_do_success', "space.php?do=top");
	
} elseif(submitcheck('showsubmit')) {
	
	$showcredit = intval($_POST['showcredit']);
	if($showcredit > $space['credit']) $showcredit = $space['credit'];
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:cp_top.php


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