本文整理汇总了PHP中UserClass::get_userinfo方法的典型用法代码示例。如果您正苦于以下问题:PHP UserClass::get_userinfo方法的具体用法?PHP UserClass::get_userinfo怎么用?PHP UserClass::get_userinfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserClass
的用法示例。
在下文中一共展示了UserClass::get_userinfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: urlencode
if (!isset($_SESSION['uid'])) {
$referer_uri = urlencode('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
header('location: ' . SITE_DOMAIN . '/signin.php?referer_uri=' . $referer_uri);
exit;
}
require_once dirname(__FILE__) . '/smarty.php';
require_once dirname(__FILE__) . '/includes/mail.class.php';
require_once dirname(__FILE__) . '/includes/user.class.php';
require_once dirname(__FILE__) . '/includes/plugin.class.php';
setcookie('uid', $_SESSION['uid'], time() + 3600);
$login_uid = $_SESSION['uid'];
$_COOKIE['uid'] = $login_uid;
//获取登录用户信息
$CUser = new UserClass();
//获取登录用户名
$json_str = $CUser->get_userinfo($login_uid);
$user_obj = json_decode($json_str);
$username = $user_obj[0]->name;
//获取登录用户头像
$user_avatar = $CUser->get_avatar($login_uid);
//获取登录用户权限
$user_privilege = $CUser->get_privilege($_SESSION['uid']);
//获取站内信信息
$CMail = new MailClass($login_uid);
//获取未读站内信数量
$json_str = $CMail->get_mail_count();
$result_array = json_decode($json_str);
$unread_mail_count = $result_array->unread;
//获取站内信数组
$json_str = $CMail->get_mail_list(1);
$unread_mail_array = json_decode($json_str);
示例2: UserClass
<?php
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
require_once 'init.php';
require_once 'includes/activity.class.php';
$login_uid = $_COOKIE['uid'];
if (isset($_GET['uid'])) {
$info_uid = $_GET["uid"];
} else {
$info_uid = $login_uid;
}
$userObj = new UserClass();
$json = $userObj->get_userinfo($info_uid);
$result = json_decode($json, true);
$user_info = $result[0];
$user_info["issame"] = $info_uid == $login_uid;
$user_info['uid'] = $info_uid;
$user_info['avatar'] = $userObj->get_avatar($info_uid);
$activityObj = new ActivityClass();
for ($i = 0; $i < 10; ++$i) {
$tmp = $activityObj->get_activity('uid', $info_uid, $i);
if ($tmp == false) {
break;
}
$activity_list[] = $tmp;
}
$sql = "SELECT uid, password FROM cs_user WHERE uid=" . $info_uid . ";";
$dbObj = new DBClass();
$result = $dbObj->query($sql);
$result_info = $result->fetch_assoc();
$temp_time = (string) (time() + 24 * 3600);
示例3: get_my_list
public function get_my_list($uid)
{
$sql = "SELECT * FROM `app_lecture_info` WHERE uid = {$uid};";
$result = $this->Csdb->query($sql);
if ($result->num_rows <= 0) {
if (is_object($result)) {
$result->close();
}
return false;
} else {
$lecture_list = array();
while ($row = $result->fetch_assoc()) {
$CUser = new UserClass();
$json_str = $CUser->get_userinfo($row["uid"]);
$author = json_decode($json_str);
$row["lecture_author"] = $author[0]->name;
$row["lecture_author_avatar"] = $CUser->get_avatar($row["uid"]);
array_push($lecture_list, $row);
}
return $lecture_list;
}
}
示例4: getdata
function getdata($dbObj, $Current_Status, $dataTag)
{
switch ($dataTag) {
case "signed":
$sql = "SELECT qid, app_join_info.uid AS uid, sno, name, class, time, interviewer FROM app_join_info, app_join_queue WHERE app_join_info.uid = app_join_queue.uid AND round = " . $Current_Status . " AND app_join_queue.qstatus = 1 ORDER BY time ASC";
$result = $dbObj->query($sql);
if ($result->num_rows > 0) {
while ($com = $result->fetch_assoc()) {
$CUser = new UserClass();
$json_str = $CUser->get_userinfo($com["interviewer"]);
$user_obj = json_decode($json_str);
$com["interviewer"] = $user_obj[0]->name;
$signed[] = $com;
}
}
$sql = "SELECT qid, app_join_info.uid AS uid, sno, name, class, time FROM app_join_info, app_join_queue WHERE app_join_info.uid = app_join_queue.uid AND round = " . $Current_Status . " AND app_join_queue.qstatus = 0 ORDER BY time ASC";
$result = $dbObj->query($sql);
if ($result->num_rows > 0) {
while ($com = $result->fetch_assoc()) {
$signed[] = $com;
}
}
return json_encode($signed);
case "interviewed":
$sql = "SELECT qid, app_join_info.uid AS uid, sno, name, class, time, interviewer FROM app_join_info, app_join_queue WHERE app_join_info.uid = app_join_queue.uid AND round = " . $Current_Status . " AND app_join_queue.qstatus = 2 ORDER BY time ASC";
$result = $dbObj->query($sql);
if ($result->num_rows > 0) {
while ($com = $result->fetch_assoc()) {
$CUser = new UserClass();
$json_str = $CUser->get_userinfo($com["interviewer"]);
$user_obj = json_decode($json_str);
$com["interviewer"] = $user_obj[0]->name;
$interviewed[] = $com;
}
}
return json_encode($interviewed);
}
}
示例5: MailClass
<?php
require_once 'init.php';
if (isset($_GET['mid'])) {
$mid = $_GET['mid'];
$mailObj = new MailClass($_COOKIE['uid']);
$json_str = $mailObj->get_mail_info($mid);
$mail_info = json_decode($json_str);
if ($mail_info[0]->isdraft == 'true') {
$smarty->assign('mail_title', $mail_info[0]->title);
$smarty->assign('mail_touser', $mail_info[0]->touser);
$smarty->assign('mail_content', $mail_info[0]->content);
}
} else {
if (isset($_GET['touid'])) {
$touid = $_GET['touid'];
$userObj = new UserClass();
$json_str = $userObj->get_userinfo($touid);
$user_obj = json_decode($json_str);
$smarty->assign('mail_touser', $user_obj[0]->name);
}
}
$smarty->display('mail_edit.tpl');