本文整理汇总了PHP中getUserInfo函数的典型用法代码示例。如果您正苦于以下问题:PHP getUserInfo函数的具体用法?PHP getUserInfo怎么用?PHP getUserInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getUserInfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMyInfo
function getMyInfo()
{
if (!isset($_SESSION['SESS_USER_ID'])) {
return false;
}
return getUserInfo($_SESSION['SESS_USER_ID']);
}
示例2: GamePage
function GamePage()
{
global $base_uri;
$uid = params('user');
if (!isset($_SESSION['uid'])) {
return 0;
} else {
createToken($_SESSION['uid']);
}
$reg = 0;
$shit = 0;
if (!isset($uid) || $uid == "") {
$uid = $_SESSION['uid'];
} else {
if (!check_registration($uid)) {
$reg = 1;
}
$shit = 1;
}
$user = getUserInfo($_SESSION['access_token'], $uid, 'photo_max');
if ($reg) {
register($uid, $user['first_name'], $user['last_name']);
}
echo $user['first_name'] . " " . $user['last_name'];
echo "<img src=\"" . $user['photo_max'] . "\" /><br><br>";
if ($shit) {
echo "<a href=\"/shit/" . $_SESSION['uid'] . "/" . $uid . "/" . getToken($_SESSION['uid']) . "\">shit</a><br>";
}
$friends = getUserFriends($_SESSION['access_token'], $uid);
foreach ($friends as $friend) {
echo $friend["first_name"] . " " . $friend["last_name"] . "<br>";
echo "<a href=\"{$base_uri}/game/" . $friend['uid'] . "\"><img src=\"" . $friend["photo_50"] . "\" /></a><hr>";
}
}
示例3: appendUserInfo
function appendUserInfo(&$params, $key)
{
$user = getUserInfo();
$params[$key . '_time'] = date('Y-m-d H:i:s');
$params[$key . '_user_id'] = $user['user_id'];
$params[$key . '_user_name'] = $user['user_name'];
}
示例4: addMapView
function addMapView($ip, $mapId, $mapName, $createdBy_id)
{
$details = (array) json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
$hostname = "";
$city = "";
$region = "";
$country = "";
$org = "";
$postal = "";
$phone = "";
$loc = "0,0";
if ($details['hostname']) {
$hostname = $details['hostname'];
$city = $details['city'];
$region = $details['region'];
$country = $details['country'];
$org = $details['org'];
$postal = $details['postal'];
$phone = $details['phone'];
$loc = $details['loc'];
}
$browser = getBrowser();
$browser_name = $browser['name'];
$browser_version = $browser['version'];
$os = $browser['platform'];
$user = getUserInfo($createdBy_id);
$browser = $_SERVER['HTTP_USER_AGENT'];
$res = pg_query($this->stats_db, "INSERT INTO statistics_maps_view (ip, maps_id, maps_name, apikey, hostname, city, region, country, loc, org, postal, phone, referer_url, browser_name, browser_version, os) \n\t\t\tVALUES('" . $ip . "', " . (int) $mapId . ", '" . pg_escape_string($map_name) . "', '" . pg_escape_string($user['apikey']) . "', '" . pg_escape_string($hostname) . "', '" . pg_escape_string($city) . "', '" . pg_escape_string($region) . "', '" . pg_escape_string($country) . "', '" . pg_escape_string($loc) . "', '" . pg_escape_string($org) . "', '" . pg_escape_string($postal) . "', '" . pg_escape_string($phone) . "', '" . pg_escape_string($_SERVER['HTTP_REFERER']) . "', '" . pg_escape_string($browser_name) . "', '" . pg_escape_string($browser_version) . "', '" . pg_escape_string($os) . "'); SELECT currval(pg_get_serial_sequence('statistics_maps_view','id')) as last_insert_id;") or die(pg_last_error());
if ($d = pg_fetch_assoc($res)) {
$id = $d['last_insert_id'];
}
return $id;
}
示例5: _checkAuth
/**
* 权限验证
*/
private function _checkAuth ()
{
// 验证是否登录了
$action = $this->getParam('a');
$method = $this->getParam('m');
// 检查是否登录了
$userInfo = getUserInfo();
if (!empty($userInfo)) {
return true;
}
// 过滤权限白名单
if (in_array($action, array_keys($this->_noCheckMenu))) {
if (in_array($method, $this->_noCheckMenu[$action])) {
return true;
}
}
// 重定向到登录页
$loginUrl = url('Login', 'index', null, 'admin.php');
header("Location:{$loginUrl}");
exit;
}
示例6: getOnlineUsersInfo
function getOnlineUsersInfo($sUserId, $bInit)
{
global $aXmlTemplates;
$aSaved = getSavedUsers();
$aActive = getActiveUsers($sUserId);
$aFriends = getFriends($sUserId);
saveUsers($aActive);
$sContents = "";
if ($bInit) {
$aFullUsers = array_unique(array_merge($aActive['online'], $aFriends));
} else {
$aFullUsers = array_diff($aActive['online'], $aSaved['online'], $aFriends);
$aNewOfflineUsers = array_intersect($aSaved['online'], $aActive['offline']);
$aNewOnlineUsers = array_intersect($aSaved['offline'], $aActive['online'], $aFriends);
for ($i = 0; $i < count($aNewOfflineUsers); $i++) {
$sContents .= parseXml($aXmlTemplates['user'], $aNewOfflineUsers[$i], FALSE_VAL);
}
for ($i = 0; $i < count($aNewOnlineUsers); $i++) {
$sContents .= parseXml($aXmlTemplates['user'], $aNewOnlineUsers[$i], TRUE_VAL);
}
}
$rResult = getUsersMedia($aFullUsers);
if ($rResult != null) {
for ($i = 0; $i < mysql_num_rows($rResult); $i++) {
$aUser = mysql_fetch_assoc($rResult);
$aUserInfo = getUserInfo($aUser['ID']);
$sOnline = in_array($aUser['ID'], $aActive['online']) ? TRUE_VAL : FALSE_VAL;
$sFriend = in_array($aUser['ID'], $aFriends) ? TRUE_VAL : FALSE_VAL;
$sMusic = $aUser['CountMusic'] > 0 ? TRUE_VAL : FALSE_VAL;
$sVideo = $aUser['CountVideo'] > 0 ? TRUE_VAL : FALSE_VAL;
$sContents .= parseXml($aXmlTemplates['user'], $aUser['ID'], $aUserInfo['nick'], $aUserInfo['sex'], $aUserInfo['age'], $aUserInfo['photo'], $aUserInfo['profile'], $sOnline, $sFriend, $sMusic, $sVideo);
}
}
return makeGroup($sContents, "users");
}
示例7: OnInput
protected function OnInput()
{
parent::OnInput();
$this->title = 'Редактировать профиль';
$this->userinfo = getUserInfo($_SESSION['uid']);
$id_user = $_SESSION['uid'];
}
示例8: checkAnswer
public function checkAnswer()
{
$userInfo = getUserInfo(U('Question/index'));
$questionLogDB = M('question_log');
$userLog = $questionLogDB->where(array('open_id' => $userInfo['open_id']))->find();
if ($userLog) {
$this->redirect('Question/index');
exit;
}
$answerList = $_POST;
//p($answerList);
$trueAnswerSum = 0;
foreach ($answerList as $key => $answer) {
// p($this->question[$key]['answer']."--".$answer);
if ($this->question[$key]['answer'] == $answer) {
$trueAnswerSum++;
}
}
$userLog['open_id'] = $userInfo['open_id'];
$userLog['true_answer_sum'] = $trueAnswerSum;
$questionLogDB->data($userLog)->add();
p($userLog);
if ($trueAnswerSum == 10) {
session('to_play', 'Question');
$this->redirect('ToPlayRedPacket/index', array('action' => 'Question', 'actionId' => '1'));
}
$this->trueAnswerSum = $trueAnswerSum;
$this->redirect('Question/index');
}
示例9: user_getInfo
function user_getInfo($uid)
{
$user = getUserInfo($uid);
if ($user) {
$user['name'] = $user['uname'];
}
return $user;
}
示例10: redirectPageWithSession
function redirectPageWithSession()
{
if (isset($_SESSION[USER_INFO])) {
$user = getUserInfo();
$redirect_page = getRedirectPageByRole($user->getRole());
header("Location: {$redirect_page}");
exit;
}
}
示例11: douserinfo
function douserinfo($data, $user)
{
$sall = $user == 'Kano';
$ans = getUserInfo($user);
$pg = '<h1>Block Acclaim</h1>';
$pg .= "<table cellpadding=0 cellspacing=0 border=0>\n";
$pg .= '<thead><tr class=title>';
$pg .= '<td class=dl>User</td>';
$pg .= '<td class=dr>Blocks</td>';
if ($sall) {
$pg .= '<td class=dr>Diff</td>';
$pg .= '<td class=dr>Avg</td>';
}
$pg .= "</thead></tr>\n";
if ($ans['STATUS'] == 'ok') {
$pg .= '<tbody>';
$all = array();
$count = $ans['rows'];
for ($i = 0; $i < $count; $i++) {
if ($sall) {
$diffacc = $ans['diffacc:' . $i];
} else {
$diffacc = 0;
}
$all[] = array('blocks' => $ans['blocks:' . $i], 'username' => $ans['username:' . $i], 'diffacc' => $diffacc);
}
usort($all, 'blocksorder');
for ($i = 0; $i < $count; $i++) {
$bl = $all[$i]['blocks'];
if ($sall == false && $bl < 1) {
break;
}
if ($i % 2 == 0) {
$row = 'even';
} else {
$row = 'odd';
}
$pg .= "<tr class={$row}>";
$un = htmlspecialchars($all[$i]['username']);
$pg .= "<td class=dl>{$un}</td>";
$pg .= "<td class=dr>{$bl}</td>";
if ($sall) {
$diffacc = $all[$i]['diffacc'];
$pg .= '<td class=dr>' . difffmt($diffacc) . '</td>';
if ($bl == 0) {
$bl = 1;
}
$pg .= '<td class=dr>' . difffmt($diffacc / $bl) . '</td>';
}
$pg .= "</tr>\n";
}
$pg .= '</tbody>';
}
$pg .= "</table>\n";
return $pg;
}
示例12: _initialize
public function _initialize()
{
$adminUser = session('adminUser');
if ($adminUser) {
$userInfo['open_id'] = 0;
$userInfo['name'] = 'admin';
session('userInfo', $userInfo);
}
getUserInfo();
}
示例13: getMultiUser
/**
* [getMultiUser 多进程获取用户数据]
* @param [type] $user_list [description]
* @return [type] [description]
*/
public static function getMultiUser($user_list)
{
$ch_arr = array();
$text = array();
$len = count($user_list);
$max_size = $len > 5 ? 5 : $len;
$requestMap = array();
$mh = curl_multi_init();
for ($i = 0; $i < $max_size; $i++) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, 'http://www.zhihu.com/people/' . $user_list[$i] . '/about');
curl_setopt($ch, CURLOPT_COOKIE, self::$user_cookie);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$requestMap[$i] = $ch;
curl_multi_add_handle($mh, $ch);
}
$user_arr = array();
do {
while (($cme = curl_multi_exec($mh, $active)) == CURLM_CALL_MULTI_PERFORM) {
}
if ($cme != CURLM_OK) {
break;
}
while ($done = curl_multi_info_read($mh)) {
$info = curl_getinfo($done['handle']);
$tmp_result = curl_multi_getcontent($done['handle']);
$error = curl_error($done['handle']);
$user_arr[] = array_values(getUserInfo($tmp_result));
//保证同时有$max_size个请求在处理
if ($i < sizeof($user_list) && isset($user_list[$i]) && $i < count($user_list)) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, 'http://www.zhihu.com/people/' . $user_list[$i] . '/about');
curl_setopt($ch, CURLOPT_COOKIE, self::$user_cookie);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$requestMap[$i] = $ch;
curl_multi_add_handle($mh, $ch);
$i++;
}
curl_multi_remove_handle($mh, $done['handle']);
}
if ($active) {
curl_multi_select($mh, 10);
}
} while ($active);
curl_multi_close($mh);
return $user_arr;
}
示例14: index
/**
* 登录界面
*/
public function index ()
{
// 验证是否登录了
$userInfo = getUserInfo();
if (!empty($userInfo)) {
$url = url('Partner', 'partnerList', null, 'admin.php');
header("Location:{$url}");
exit;
}
$this->display('Admin.Login.index');
}
示例15: delCategory
function delCategory()
{
// TODO : Escape String for SQL Statement
$categoryId = $_GET[CATEGORY_ID];
$redirectPage = CATEGORY_LIST_PAGE;
$user = getUserInfo();
$role = $user->getRole();
$conn = DBConnection::getConnection($role);
if ($conn) {
$result = $conn->deleteCategory($categoryId);
header("Location: {$redirectPage}");
exit;
}
}