本文整理汇总了PHP中getuser函数的典型用法代码示例。如果您正苦于以下问题:PHP getuser函数的具体用法?PHP getuser怎么用?PHP getuser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getuser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shownews
function shownews($id)
{
global $list_prefix, $NEWS, $MAIN;
$sql = "SELECT * FROM " . $list_prefix . "news WHERE id = '" . $id . "';";
$result = db_query($sql);
$rows = db_num_rows($result);
if ($rows != 0) {
$row = db_fetch_array($result);
$postedby = getuser($row['posted_by']);
//lets insert the prayerrequest into our working copy of this template.
$WORK = insert_into_template($NEWS, "{NEWSTITLE}", stripslashes($row['news_title']));
$WORK = insert_into_template($WORK, "{TEASER}", stripslashes($row['teaser']));
$WORK = insert_into_template($WORK, "{NEWSID}", $row['id']);
$WORK = insert_into_template($WORK, "{POSTEDBY}", $postedby);
$WORK = insert_into_template($WORK, "{BYLINE}", $row['byline']);
$WORK = insert_into_template($WORK, "{DATE}", date("m/d/Y", $row['date']));
$WORK = insert_into_template($WORK, "{CATEGORY}", getcatname($row['category']));
$WORK = insert_into_template($WORK, "{NEWS}", stripslashes($row['news']));
$i++;
//now lets add this request to the CONTENT.
$WORK = insert_into_template($MAIN, "{CONTENT}", $WORK);
$WORK = filltemplate($WORK, striphtml($row['news_title']));
printf("%s", striptemplate($WORK));
}
}
示例2: forum_notify
function forum_notify()
{
global $form, $db, $tab, $login, $threadid, $postid, $thisthread, $thisboard, $httpurl, $sendmail;
$userq = $db->query_str("SELECT * FROM {$tab['forum_notify']} WHERE threadid='{$threadid}' AND userid!='{$login['id']}'");
while ($notify = $db->fetch_array($userq)) {
$user = getuser($notify[userid]);
eval("\$mail[header] = \"" . gettemplate("forum.notify.mail.header") . "\";");
eval("\$mail[subject] = \"" . gettemplate("forum.notify.mail.subject") . "\";");
eval("\$mail[body] = \"" . gettemplate("forum.notify.mail.body") . "\";");
$sendmail->mail($user[user_email], $mail[subject], $mail[body], $mail[header]);
}
}
示例3: all_action
function all_action()
{
global $session;
$uid = $session->get('uid');
//前20个推荐的采集
$pins = bidcms_encode(getallpins());
$userinfo = array();
if ($uid > 0) {
$userinfo = getuser($uid, 0, 1);
}
include template('index_all');
}
示例4: getarticles
function getarticles($perpage)
{
global $list_prefix;
$ARTICLES = loadtmplate("articles.mod");
$CONTENT = "";
//lets calculate our query
$sql = "SELECT * FROM " . $list_prefix . "articles ORDER BY `date` DESC LIMIT 0," . $perpage . ";";
//now lets show the prayerlist entries.
$result = db_query($sql);
if ($result) {
$rows = db_num_rows($result);
} else {
$rows = 0;
}
if ($rows != 0) {
$j = 0;
while ($j < $rows) {
//lets fetch our prayer request from the database.
$row = db_fetch_array($result);
$postedby = getuser($row['posted_by']);
//lets insert the prayerrequest into our working copy of this template.
$WORK = insert_into_template($ARTICLES, "{ARTICLETITLE}", stripslashes($row['article_title']));
$WORK = insert_into_template($WORK, "{TEASER}", stripslashes($row['teaser']));
$WORK = insert_into_template($WORK, "{ARTICLEID}", $row['id']);
$WORK = insert_into_template($WORK, "{POSTEDBY}", $postedby);
$WORK = insert_into_template($WORK, "{BYLINE}", $row['byline']);
$WORK = insert_into_template($WORK, "{DATE}", date("m/d/Y", $row['date']));
$WORK = insert_into_template($WORK, "{CATEGORY}", getcatname($row['category']));
$j++;
//now lets add this request to the CONTENT.
$CONTENT .= $WORK;
}
} else {
$CONTENT .= "There are no active articles at this time.<BR>\r\n";
}
//when we output this lets make sure that the output is stripped of any template elements that are not used.
return striptemplate($CONTENT);
}
示例5: getuser
<?php
include "../lib/mainfunc.php";
$bid = @$_GET['bid'];
$tid = @$_GET['tid'];
$page = @$_GET['p'];
$see_lz = @$_GET['see_lz'];
$users = getuser();
$currentuser = $users['username'];
if (!$page) {
$page = 1;
}
if (!$bid) {
$bid = 1;
}
if (!$tid) {
$tid = 1;
}
$data = mainfunc(array("bid" => $bid, "tid" => $tid, "p" => $page, "see_lz" => $see_lz), null);
$tdata = mainfunc(array("bid" => $bid, "tid" => $tid, "ask" => "tidinfo"));
$floordata = "";
if ($see_lz != "") {
$floordata = mainfunc(array("bid" => $bid, "tid" => $tid, "ask" => "getlznum"));
$floordata = $floordata[0];
}
if (count($tdata) == 0) {
$tdata = null;
} else {
$tdata = $tdata[0];
}
if ($floordata != "") {
示例6: getuser
include 'function.php';
?>
<?php
include 'header.php';
?>
<div class='container'>
<?php
$pid = $_GET['pid'];
if (isset($_GET['uid']) && !empty($_GET['uid'])) {
$uid = $_GET['uid'];
} else {
$uid = $_SESSION['myid'];
}
$myid = $_SESSION['myid'];
$username = getuser($uid, 'user_name');
?>
<h3><?php
echo $username;
?>
</h3>
<?php
$query = "select location from pins where pid = '{$pid}'";
$result = $conn->query($query);
$run = $result->fetch_array();
$location = $run['location'];
?>
<h4>Pin from: <a href='locphoto.php?location=<?php
echo $location;
?>
'><?php
示例7: mysql_query
<?php
include 'connect.php';
?>
<?php
include 'functions.php';
?>
<?php
include 'header.php';
?>
<div class="container">
<h3>Friends</h3>
<?php
$my_id = $_SESSION['user_id'];
$req_query = mysql_query("SELECT user_one, user_two FROM friends WHERE user_one='{$my_id}' OR user_two='{$my_id}'");
while ($run_req = mysql_fetch_array($req_query)) {
$user_one = $run_req['user_one'];
$user_two = $run_req['user_two'];
if ($user_one == $my_id) {
$user = $user_two;
} else {
$user = $user_one;
}
$username = getuser($user, 'username');
echo "<a class='box' style='display: block;' href='profile.php?user={$user}'>{$username}</a>";
}
?>
</div>
</body>
</html>
示例8: getuser
?>
<div class="container">
<div class="row">
<div class=" col-sm-8 col-sm-offset-2">
<div class="panel panel-primary">
<div class="panel-heading" >
<?php
echo $post['title'];
?>
by
<a href="user.php?id=<?php
echo $post['user_id'];
?>
">
<?php
$c = getuser($post['user_id']);
echo $c['username'];
?>
</a>
<span style="float:right">
<?php
echo " posted on " . $post['created'];
?>
</span>
</div>
<div class="panel-body" style="color:#191970">
<p class="text-center">
<?php
$a = getimage($post['image_id']);
if ($a) {
echo '<img class="panel" src="images/' . $a['filename'] . '">';
示例9: isset
<?php
require_once '../inc/common.php';
$type = isset($_GET['type']) ? (int) $_GET['type'] : 0;
$user = getuser('mid,name,headimgurl');
$user['headimgurl'] = empty($user['headimgurl']) ? '../images/touxiang.png' : $user['headimgurl'];
$pageSize = 5;
$sql = "SELECT count(1) as count FROM m_comment WHERE mid = '{$user['mid']}' AND type = 0";
$sth = $db->prepare($sql);
$sth->execute();
$count = $sth->fetchColumn();
$pageTotal = ceil($count / $pageSize);
if (isset($_GET['aj_comm'])) {
if ($type == 0) {
$table = 'm_goods';
} elseif ($type == 1) {
$table = 'm_activites';
}
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
//获取请求的页数
$start = ($page - 1) * $pageSize;
$sql = "SELECT c.cid,c.pid,c.ctime,c.nice,c.imgs,c.content,g.name FROM m_comment as c\r\n\t\t\t\tLEFT JOIN {$table} as g ON c.pid = g.gid\r\n\t\t\t\tWHERE c.mid = '{$user['mid']}' AND c.type = '{$type}' ORDER BY c.ctime DESC LIMIT {$start}, {$pageSize}";
$sth = $db->prepare($sql);
$sth->execute();
$data = $sth->fetchAll(PDO::FETCH_ASSOC);
foreach ($data as $k => $v) {
$data[$k]['ctime'] = date('Y-m-d', $v['ctime']);
$data[$k]['imgs'] = explode('|', $v['imgs']);
}
die(json_encode($data));
//转换为json数据输出
示例10: mysql_query
href="#collapseOne">
<span class="glyphicon glyphicon-chevron-down"></span>
</a>
</div>
</div>
<div class="panel-collapse collapse" id="collapseOne">
<div class="panel-body" >
<?php
require_once 'include/db_connect.php';
if (isset($_GET['user']) and isset($_GET['hash'])) {
$hash = $_GET['hash'];
$user = $_GET['user'];
$ext = mysql_query("select * from conversation where chash='{$hash}' ");
while ($row = mysql_fetch_array($ext)) {
$cfrom = $row['cfrom'];
$cfrom1 = getuser($cfrom, 'user_name');
$msg = $row['msg'];
echo "<ul class='chat'>\n <li class='left clearfix'><span class='chat-img pull-left'>\n <img src='img/user.png' height='50' width='50' alt='User Avatar' class='img-circle' />\n </span>\n <div class='chat-body clearfix'>\n <div class='header'>\n <strong class='primary-font'>" . $cfrom1 . "</strong> <small class='pull-right text-muted'>\n <span class='glyphicon glyphicon-time'></span></small>\n </div>\n <p>\n " . $msg . "\n </p>\n </div>\n </li>\n </ul>";
}
}
?>
</div>
<form action="chatupdate.php" method="post">
<div class="panel-footer">
<div class="input-group">
<input id="btn-input" type="text" class="form-control input-sm" name="message" placeholder="Type your message
here..." />
<input type="hidden" name="user" value="<?php
echo $user;
?>
示例11: getavatar
$ava1 = getavatar($row['user_id'], 'avatar');
$ava = "<img src='{$ava1}' height='30' width='30' class=>";
$tim = $row['time'];
$hash = $row['ghash'];
echo "<div class='post'><div class='panel panel-default'>\n <div class='panel-heading'>" . $ava . $postn . "</div>\n <div class='panel-body'>" . $row['message'] . "\n \n </div><div class='panel-footer'>Posted at  " . $tim . "</div>\n</div>\n </div></div>";
}
if ($type == 'image') {
$postn = getuser($row['user_id'], 'fname');
$ava1 = getavatar($row['user_id'], 'avatar');
$ava = "<img src='{$ava1}' height='30' width='30'>";
$pim = $row['pimage'];
$pim1 = "<img src='{$pim}' class='img-responsive center-block'>";
echo "<div class='post'><div class='panel panel-default'>\n <div class='panel-heading'>" . $ava . $postn . "</div>\n <div class='panel-body'>" . $row['message'] . $pim1 . "\n \n </div>\n </div></div>";
}
if ($type == 'video') {
$postn = getuser($row['user_id'], 'fname');
$ava1 = getavatar($row['user_id'], 'avatar');
$ava = "<img src='{$ava1}' height='30' width='30'>";
$url = $row['url'];
$vi = " <iframe src='{$url}'\n frameborder='0' width='476' height='400'\n allowfullscreen ></iframe >";
echo "<div class='post'><div class='panel panel-default'>\n <div class='panel-heading'>" . $ava . $postn . "</div>\n <div class='panel-body'>" . $row['message'] . $vi . "\n \n </div>\n </div></div>";
}
if ($type == 'location') {
$postn = getuser($row['user_id'], 'fname');
$ava1 = getavatar($row['user_id'], 'avatar');
$ava = "<img src='{$ava1}' height='30' width='30'>";
$pla = $row['place'];
echo "<div class='post'><div class='panel panel-default'>\n <div class='panel-heading'>" . $ava . $postn . "</div>\n <div class='panel-body'>" . $row['message'] . "<br>" . $pla . "\n \n </div>\n </div></div>";
}
}
require_once 'footer.php';
示例12: mysql_query
<?php
require_once 'header.php';
?>
<div id="bo">
<?php
require_once 'include/db_connect.php';
require_once 'include/essential.php';
?>
<?php
require_once 'include/db_connect.php';
require_once 'functions.php';
require_once 'include/essential.php';
echo "<h1>Chat List</h1><br>";
$fr = mysql_query("select user_one,user_two from frnd where user_one='{$pid1}' or user_two='{$pid1}'");
while ($frn = mysql_fetch_array($fr)) {
if ($frn['user_one'] == $pid1) {
$frnid = $frn['user_two'];
} else {
$frnid = $frn['user_one'];
}
$frname = getuser($frnid, 'user_name');
echo "<a href='chatbox.php?user={$frnid}'class='btn btn-default btn-lg'style=margin:5px;>{$frname}</a><br><br>";
}
?>
</div>
</body>
<?php
require_once 'footer.php';
?>
</html>
示例13: t_fanli
function t_fanli($uid, $money)
{
global $_G;
$org_money = $money;
if ($uid == $this->user['uid']) {
$user = $this->user;
} else {
$user = getuser($uid, 'uid');
}
//if($user['uid'] == $this->user[uid]) return $money;
//if($user['t_uid'] && $user['t_uid'] == $this->user[uid]) return $money; //防止死循环
//4,3,1,1,2
$rank = $user['rank'];
if (!$rank || !$_G['rank'][$rank]) {
return $money;
}
$group = $_G['rank'][$rank];
$bili = intval($group['bili']);
//当前推荐者所在推荐的返利比例
if ($bili <= 0) {
return $money;
}
$yongjin = fix($money * ($bili / 100), 2);
$money = $money - $yongjin;
//给佣金表,增加记录,供用户查询
$log = array();
//第'.($k+1).'级
if (!$this->order['price'] || $yongjin <= 0) {
return $money;
}
$log['desc'] = '您推荐的用户' . $this->user['username'] . '购物消费,您获得:' . $yongjin . '元(' . $bili . '%)';
$add_money = $user['money'] + $yongjin;
update_member(array('money' => $add_money), $user['uid']);
$log['org_money'] = $user['money'];
$log['money'] = $yongjin;
$log['status'] = 1;
$log['uid'] = $user['uid'];
$log['username'] = $user['username'];
$this->write_log($log);
//无限上级推荐人返利
/*if($user['t_uid']>0){
if($user['t_uid'] == $this->user['uid'] || $user['t_uid'] == $user['uid'])continue; //防止死循环
$money = $this->t_fanli($user['t_uid'],$org_money);
}*/
return $money;
}
示例14: connect
<div id="wrap">
<div id="header"></div>
<div id="main"><p>
<p><span class="pagetitle">User Account</span></p>
<?php
connect();
//printf('<br />roleid: '.$_SESSION['role_id'].'');
if ($_SESSION['role_id'] == 1) {
printf('Only editors may view this page.');
printf('<script type="text/javascript">
location.replace("author.php");
</script>');
}
$uid = $_GET['perid'];
$arruser = getuser($uid);
$fname = $arruser['fname'];
$lname = $arruser['lname'];
$street = $arruser['street'];
$city = $arruser['city'];
$province = $arruser['province'];
$postal = $arruser['postal'];
$email = $arruser['email'];
$uid = $arruser['per_id'];
$active = $arruser['active'];
printf('<span class="edituser">');
printf('<form name="reg" action="updateuser.php" onsubmit="return validateForm();" method="post" >');
printf('<table>');
printf('<tr><td></td><td><input type=hidden name="uid" value="' . $uid . '"></td></tr>');
printf('<tr><td>Username:</td><td>' . $arruser['uname'] . '</td></tr>');
printf('<tr><td>First name:</td><td><input type=text name="ufname" value="' . $fname . '" size="50"></td></tr>');
示例15: delete_account
function delete_account($usrid)
{
// ------------------ DELETE ACCOUNT ---------------
$usr = @getuser($usrid);
if ($usr !== false) {
$c = $usr['cluster'];
if ($c != '') {
$c = @mysql_num_rows(@db_query('SELECT * FROM users WHERE cluster=' . mysql_escape_string($c)));
if ($c < 2) {
deletecluster($c, true);
} else {
$r = db_query('SELECT id FROM users WHERE cluster=' . mysql_escape_string($usr['cluster']) . ' AND clusterstat=' . CS_ADMIN . ';');
$admins = @mysql_num_rows($r);
if ($usr['clusterstat'] == CS_ADMIN && $admins < 2) {
$r = db_query('SELECT * FROM users WHERE cluster=' . mysql_escape_string($usr['cluster']) . ';');
db_query('UPDATE users SET clusterstat=' . CS_ADMIN . ' WHERE id=' . mysql_result($r, 0, 'id') . ';');
}
}
}
db_query('DELETE FROM mails WHERE user=\'' . mysql_escape_string($usrid) . '\';');
db_query('DELETE FROM sysmsgs WHERE user=\'' . mysql_escape_string($usrid) . '\';');
db_query('DELETE FROM users WHERE id=\'' . mysql_escape_string($usrid) . '\';');
db_query('DELETE FROM abooks WHERE user=\'' . mysql_escape_string($usrid) . '\';');
return $usr;
} else {
return false;
}
}