本文整理汇总了PHP中getUserById函数的典型用法代码示例。如果您正苦于以下问题:PHP getUserById函数的具体用法?PHP getUserById怎么用?PHP getUserById使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getUserById函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: login
function login($link, $user_id)
{
$_SESSION['auth'] = 'ok';
$_SESSION['user_id'] = $user_id;
$user_info = getUserById($link, $user_id);
$_SESSION['user'] = $user_info['user'];
$_SESSION['role'] = $user_info['role'];
header('LOCATION: ./index.php');
}
开发者ID:VyacheslavLynnyk,项目名称:devionity-php,代码行数:9,代码来源:libs.php
示例2: checkIsAuth
function checkIsAuth()
{
global $db;
if (!isset($_SESSION['userid'])) {
header('Location: /');
exit;
} else {
//Теперь при вызове этой функции для закрытия части сайта
//мы можем сразу забрать данные о пользователе. В userspace продолжение
getUserById($_SESSION['userid']);
}
}
开发者ID:ddeadlink,项目名称:pet_project,代码行数:12,代码来源:func.php
示例3: extractLogins
function extractLogins($prefix)
{
$prefixLen = strlen($prefix);
foreach ($_POST as $key => $value) {
$index = strpos($key, $prefix);
if ($index !== false) {
$userId = substr($key, $prefixLen);
$oneLogin = getUserById($userId);
$loginList[] = $oneLogin;
}
}
return $loginList;
}
开发者ID:coyotetracks,项目名称:PiutePonds,代码行数:13,代码来源:correspondence_role_send_action.php
示例4: sendConfirmationEmail
function sendConfirmationEmail($userID)
{
global $smarty;
$user = getUserById($userID);
$hash = getUserActivation($userID);
$to = $user["email"];
$subject = 'Please confirm your registration in Fastmarket';
$smarty->assign('user', $user["name"]);
$smarty->assign('hash', $hash);
$message = $smarty->fetch('emails/confirmationEmail.tpl');
$headers = "From: [email protected]\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($to, $subject, $message, $headers);
}
开发者ID:andrefreitas,项目名称:feup-lbaw-fastmarket,代码行数:15,代码来源:plataform.php
示例5: sendProductPriceChange
function sendProductPriceChange($userId, $productId)
{
global $smarty;
$user = getUserById($userId);
$userName = "André Freitas";
$link = "http://fastmarket.com";
$to = "[email protected]";
$productName = "Ferrari 548";
$subject = 'Product changed price';
$smarty->assign('user', $userName);
$smarty->assign('link', $link);
$smarty->assign('productName', $productName);
$message = $smarty->fetch('emails/productPriceChange.tpl');
$headers = "From: [email protected]\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($to, $subject, $message, $headers);
}
开发者ID:andrefreitas,项目名称:feup-lbaw-fastmarket,代码行数:18,代码来源:storeEmails.php
示例6: page_admincontrol
function page_admincontrol()
{
global $admin_lang;
//
// get the coutnt of all pages
//
$sitedata_result = db_result("SELECT page_id FROM " . DB_PREFIX . "pages_content");
$page_count = mysql_num_rows($sitedata_result);
//
// get the count of all registered users
//
$users_result = db_result("SELECT user_id FROM " . DB_PREFIX . "users");
$users_count = mysql_num_rows($users_result);
//
// get the size of all tables with the prefix DB_PREFIX
//
$table_infos_result = db_result("SHOW TABLE STATUS");
$data_size = 0;
while ($table_infos = mysql_fetch_object($table_infos_result)) {
if (substr($table_infos->Name, 0, strlen(DB_PREFIX)) == DB_PREFIX) {
$data_size += $table_infos->Data_length + $table_infos->Index_length;
}
}
$out = "<h3>AdminControl</h3><hr />\r\n\t<table>\r\n\t\t<tr><td>" . $admin_lang['online since'] . "</td><td>#DATUM</td></tr>\r\n\t\t<tr><td>" . $admin_lang['registered users'] . "</td><td>" . $users_count . "</td></tr>\r\n\t\t<tr><td>" . $admin_lang['created pages'] . "</td><td>" . $page_count . "</td></tr>\r\n\t\t<tr><td>" . $admin_lang['database size'] . "</td><td>" . kbormb($data_size) . "</td></tr>\r\n\t</table>\r\n\t\r\n\t<h3>Aktuelle Besucher</h3><hr />\r\n\t<table>\r\n\t\t<tr>\r\n\t\t\t<td>" . $admin_lang['name'] . "</td>\r\n\t\t\t<td>" . $admin_lang['page'] . "</td>\r\n\t\t\t<td>" . $admin_lang['last action'] . "</td>\r\n\t\t\t<td>" . $admin_lang['language'] . "</td>\r\n\t\t\t<td>" . $admin_lang['ip'] . "</td>\r\n\t\t\t<td>" . $admin_lang['host'] . "</td>\r\n\t\t</tr>";
//output all visitors surfing on the site
$users_online_result = db_result("SELECT userid, page, lastaction, lang, ip, host FROM " . DB_PREFIX . "online");
while ($users_online = mysql_fetch_object($users_online_result)) {
if ($users_online->userid == 0) {
$username = $admin_lang['not registered'];
} else {
$username = getUserById($users_online->userid);
}
//
// FIXME: gethostbyaddr needes to much time if there are many users online
//
$out .= "\t\t\t<tr>\r\n\t\t\t<td>" . $username . "</td>\r\n\t\t\t<td><a href=\"index.php?page=" . $users_online->page . "\">" . $users_online->page . "</a></td>\r\n\t\t\t<td>" . date("d.m.Y H:i:s", $users_online->lastaction) . "</td>\r\n\t\t\t<td>" . $admin_lang[$users_online->lang] . "</td>\r\n\t\t\t<td>" . $users_online->ip . "</td>\r\n\t\t\t<td>" . $users_online->host . "</td>\r\n\t\t</tr>\r\n";
}
$out .= "</table>";
return $out;
}
开发者ID:BackupTheBerlios,项目名称:comacms-svn,代码行数:40,代码来源:admin_pages.php
示例7: getUserById
<?php
require_once __DIR__ . '/app/models/user.php';
//require_once __DIR__ . '/app/models/post.php';
require_once __DIR__ . '/libs/storage.php';
require_once __DIR__ . '/libs/viev.php';
$user = getUserById(isset($_GET['id']) ? $_GET['id'] : '');
if (!$user) {
header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not found');
exit('Post not found!');
}
//var_dump($post);
?>
<!Doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php
echo $user['login'];
?>
</title>
</head>
<body>
<p>Имя пользователя: <?php
echo $user['login'];
?>
</p>
<p><?php
echo $post['login'];
?>
开发者ID:itmo-it-group-305,项目名称:nataliya.saveleva-php,代码行数:31,代码来源:usershow.php
示例8: header
<?php
header('Content-Type: application/json');
include "../../include/dbcon.inc.php";
include "../../include/functions.php";
include "../../include/pm_functions.inc.php";
include "../../include/push_functions.inc.php";
$user_id = getUserIdFromToken($con, @$_POST["token"]);
$dog_id = $con->real_escape_string($_POST["dog_id"]);
$symptoms = $con->real_escape_string($_POST["symptoms"]);
$place_id = $con->real_escape_string($_POST["place_id"]);
$duedate = $con->real_escape_string($_POST["duedate"]);
$volume = $con->real_escape_string($_POST["volume"]);
$user = getUserById($user_id, $con);
$dog = getDogById($dog_id, $con);
$bloodtype = getBloodTypeById($dog["dog_bloodtype_id"], $con);
$bloodstores = getBloodStoreByBloodTypeId($dog["dog_bloodtype_id"], $con);
$result = 0;
if (sizeof($bloodstores) > 0) {
//Found Blood In Hospital Blood Store
//create bloodstore_id string
$bloodstore_ids = array();
foreach ($bloodstores as $key => $bloodstore) {
array_push($bloodstore_ids, $bloodstore["bloodstore_id"]);
}
$bloodstore_id = implode(",", $bloodstore_ids);
$con->query("INSERT INTO `request`(`request_id`, `from_user_id`, `for_dog_id`, `symptoms`, `place_id`," . " `duedate`, `request_type`, `bloodstore_id`, `created_time`, `amount_volume`) " . "VALUES (null,'{$user_id}','{$dog_id}','{$symptoms}','{$place_id}','{$duedate}',1,'{$bloodstore_id}',now(),'{$volume}')");
//save to db (request_type = 1)
$senthospital_id = array();
//store sent hospital id
$message = "การขอรับเลือดของ" . $dog["dog_name"] . " เมื่อ " . date("j") . " " . $thai_month_short_arr[date("n")] . " " . (date("Y") + 543) . " " . "พบเลือดกรุ๊ป " . $bloodtype["bloodtype_name"] . " ที่โรงพยาบาลดังนี้";
开发者ID:joyfulful,项目名称:DogBloodDonor_Web,代码行数:31,代码来源:create.php
示例9: getUserById
<div class="score-tabs">
<div class="col-md-2"></div>
<div class="col-md-8"><ul class="gamepoint">
<li><a href="game-point-leader-board">All Time </a></li>
<li><a href="game-point-weekly-leader-board">This Week</a></li>
<li><a href="game-point-daily-leader-board">Today </a></li>
</ul></div>
<div class="clearfix"></div>
<div class="highscore">
<div class="row">
<div class="col-md-12">
<h3>Today Leaderboard</h3>
</div>
<?php
if (isset($_SESSION['user_loged_id'])) {
$user_information = getUserById($_SESSION['user_loged_id']);
$u_info = mysql_fetch_array($user_information);
$current_user = countDailyUserDailyPointByUserId($_SESSION['user_loged_id']);
if ($current_user > 0) {
$user_current_score = mysql_fetch_array($current_user);
}
$utilize = countUtilizeUserPointByUserId($_SESSION['user_loged_id']);
$utilize_point = mysql_fetch_array($utilize);
?>
<?php
if ($user_current_score['user_id'] > 0) {
?>
<div class="bdr-bot-red">
<div class="col-md-1 nopad-right">
<img src="user_images/<?php
echo $u_info['photo'];
开发者ID:azeemgolive,项目名称:maverickgame,代码行数:31,代码来源:daily-leader-board.php
示例10: session_start
<?php
session_start();
include "dbconnection.php";
if (isset($_SESSION['user_loged_id'])) {
$session_id = $_SESSION['user_loged_id'];
$user_detail = getUserById($_SESSION['user_loged_id']);
$user = mysql_fetch_array($user_detail);
} else {
header("location:maverick-game-user-login");
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Purchase Coins | Maverick Game</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="shortcut icon" href="favicon.png" type="image/x-icon"/>
<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Didact+Gothic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="assets/css/style.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="assets/js/jquery.min.js" type="text/javascript"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/script.js"></script>
<!--[if lt IE 9]>
<script src="http://css3-mediaqueries-js.googlecode.com/files/css3-mediaqueries.js"></script>
<script src="/assets/js/respond.min.js"></script>
<![endif]-->
开发者ID:azeemgolive,项目名称:maverickgame,代码行数:31,代码来源:thanks-scratchcard-payment.php
示例11: getAllNotificationGames
</a>
<ul class="dropdown-menu">
<li class="header">You have <?php
echo $total_game_comment['game_comment_id'];
?>
Game Comments Notification</li>
<li>
<!-- inner menu: contains the actual data -->
<ul class="menu">
<?php
$games_notification = getAllNotificationGames($last_game['game_comment_id']);
if ($games_notification) {
while ($game_notification = mysql_fetch_array($games_notification)) {
$games_users = getUserById($game_notification['user_id']);
$game_user = mysql_fetch_array($games_users);
?>
<li><!-- start message -->
<a href="#">
<div class="pull-left">
<?php
if ($rhyme_user['userimages'] != '') {
?>
<img src="../userimages/<?php
echo $game_user['userimages'];
?>
" class="img-circle" alt="User Image"/>
<?php
开发者ID:azeemgolive,项目名称:thefunkidsgame,代码行数:31,代码来源:momforumnotification.php
示例12: getReplyByThreadByReply
?>
</div>
</div>
<?php
}
}
?>
<?php
$get_reply = getReplyByThreadByReply($thread_id);
if ($get_reply > 0) {
while ($reply_get = mysql_fetch_array($get_reply)) {
$thread_user = getUserById($reply_get['user_id']);
$userthread = mysql_fetch_array($thread_user);
?>
<div class="col-md-12 postdtl">
<div class="col-md-3 post-display">
<?php
if ($userthread['user_name'] != "") {
?>
<h3> <?php
echo $userthread['user_name'];
?>
</h3>
<?php
} else {
?>
开发者ID:azeemgolive,项目名称:maverickgame,代码行数:31,代码来源:forum-post-detail.php
示例13: explode
?>
<input type="hidden" name="imgName" id="imgName" value="<?php
if (isset($imgname)) {
echo $imgname;
}
?>
" />
</form>
<?php
if (isset($_REQUEST['update'])) {
$imgNames = $_POST['imgNames'];
$user_crop_image = $imgNames;
$user_crop_image = explode("/", $imgNames);
$profile_img_query = mysql_query("UPDATE glogin_users SET photo='{$user_crop_image['1']}' WHERE id='{$session_id}'");
unset($_SESSION['loged_user_image']);
$users = getUserById($session_id);
$user = mysql_fetch_array($users);
$_SESSION['loged_user_image'] = $user['photo'];
//echo "<strong style='background-color:green'; color:#fff; font-size:12px; padding:3px 5px'>Your Profile Picture has been Update Sucessfully</strong>";
echo "<script type='text/javascript'>\n\t\t\t\t\t\ttop.location.href = 'user-profile.php';\n\t\t\t\t\t\t</script>";
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
开发者ID:azeemgolive,项目名称:maverickgame,代码行数:31,代码来源:user-profile-picture.php
示例14: updateUser
function updateUser($userId, $name, $email, $password, $privilegeId)
{
$sql = "UPDATE users " . "SET name = ?, email = ?, password = ?, privilege_id=? " . "WHERE id = ?";
$sqlVars = array($name, $email, $password, $privilegeId, $userId);
return getUserById($userId) ? query($sql, $sqlVars) : false;
}
开发者ID:andrefreitas,项目名称:feup-lbaw-fastmarket,代码行数:6,代码来源:plataform.php
示例15: session_start
<?php
session_start();
if (isset($_POST['submit'])) {
include "dbconnection.php";
$puzzle_id = mysql_real_escape_string($_POST['puzzle_id']);
$rhymes = getPuzzleById($puzzle_id);
$rhyme = mysql_fetch_array($rhymes);
$rhyme_seo = $rhyme['seo_puzzle'];
if (isset($_SESSION['user_id'])) {
$users = getUserById($_SESSION['user_id']);
$user = mysql_fetch_array($users);
$comments = mysql_real_escape_string($_POST['comments']);
addPuzzleComments($puzzle_id, $comments, $_SESSION['user_id']);
$base_url = "http://thefunkids.com/admin";
$subject = "Comments on Rhymes for Moderation";
$from = "[email protected]";
$to = "[email protected]";
$mail_body = "Dear All,<br/><br/> A comment has been posted on our website TheFunKids.com and is pending approval. Kindly review and <br /><br /> moderate whether the comment should be posted or not.<br /><br /><br/>Login Url:<a href=" . $base_url . ">" . $base_url . "</a><br/><br/><strong>User Name:</strong>[email protected]<br><strong>Password:</strong>admin123<br/></br>Regards & Love<br/><br/>The Fun Kids Team";
$body = wordwrap($mail_body, 2000);
//$body_user = wordwrap($mail_body_user,70);
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: " . $from . "\r\n";
$headers .= 'Bcc:[email protected],[email protected]' . "\r\n";
//------------------------Thanks You Email-------------------------------------------------------------------
mail($to, $subject, $mail_body, $headers);
header("location:kid-puzzle-{$rhyme_seo}&comment#puzzles");
} elseif (isset($_SESSION['FBID'])) {
$user_facebook_id = getUserByFaceBookId($_SESSION['FBID']);
if ($user_facebook_id) {
开发者ID:azeemgolive,项目名称:thefunkidsgame,代码行数:31,代码来源:doaddpuzzlecoment.php
示例16: sendUserToMail
function sendUserToMail($userId)
{
//1. получить пользователя по $id_user - пиши.
$user = getUserById($userId);
//строка записи из таблицы users
//2. получить адрес пользователя.
$address = getUserFullAddress($user['id_address']);
/*header("Content-Type: text/html;charset=utf-8");
echo '<pre>';
print_r($user);
print_r($address);
die;*/
//пиши все остальное.
$msg = "Ф.И.О: {$user['fio']}\n Email: {$user['email']}\n Телефон: {$user['phone']}\n Статус: {$user['name_status']}\n Адрес: {$address['fullAddress']}, кв. {$address['kv']}\n Логин: {$user['login']}\n Пароль: {$user['password']}";
$subject = '';
$to = '[email protected]';
//почта получателя
$send = sendMail("Name", $to, 'example.ru', '[email protected]/', $subject, $msg);
return $send;
}
开发者ID:evgeniya994,项目名称:HH,代码行数:20,代码来源:user_functions.php
示例17: createUserPlace
function createUserPlace(PDO $db, $user_id, $restaurant_id)
{
require_once __DIR__ . '/../account/account.php';
$response = getUserById($db, $user_id);
if ($response->getType() != Response::SUCCESS) {
return new ErrorResponse("User does not exist.");
}
$query = ' INSERT INTO
user_places(
user_id,
restaurant_id
)
VALUES(
:user_id,
:restaurant_id
)';
try {
$statement = $db->prepare($query);
$statement->bindValue(':user_id', $user_id, PDO::PARAM_INT);
$statement->bindValue(':restaurant_id', $restaurant_id, PDO::PARAM_INT);
$statement->execute();
if ($statement->rowCount() >= 1) {
return new SuccessResponse("User place created.", $response->getData());
}
return new ErrorResponse('User place could not be registered.');
} catch (PDOException $ex) {
return new ExceptionResponse('PDOException was caught.', $ex);
}
}
开发者ID:JuandreBarnard11061015,项目名称:COS-790-Project,代码行数:29,代码来源:restaurant.php
示例18: editUser
function editUser($data)
{
$user_info = getUserById($data['userId']);
$sql = "UPDATE " . e50;
$implode = array();
if (isset($data['username'])) {
if ($user_info['username'] != $data['username']) {
$implode[] = " username = '" . $data['username'] . "'";
insertUserLog($data['userId'], 1, $user_info['username'], $data['username']);
}
}
if (isset($data['email'])) {
if ($user_info['email'] != $data['email']) {
$implode[] = " email = '" . $data['email'] . "'";
insertUserLog($data['userId'], 2, $user_info['email'], $data['email']);
}
}
if (isset($data['password'])) {
if ($user_info['password'] != $data['password']) {
$implode[] = " password = '" . $data['password'] . "'";
insertUserLog($data['userId'], 3, $user_info['password'], $data['password']);
}
}
if (isset($data['group_id'])) {
if ($user_info['group_id'] != $data['user_group']) {
$implode[] = " group_id = '" . $data['user_group'] . "'";
insertUserLog($data['userId'], 4, $user_info['group_id'], $data['user_group']);
}
}
if (isset($data['status'])) {
if ($user_info['status'] != $data['status']) {
$implode[] = " status = '" . $data['status'] . "'";
insertUserLog($data['userId'], 5, $user_info['status'], $data['status']);
}
}
if ($implode) {
$sql .= " SET " . implode(" , ", $implode);
}
$sql .= " WHERE id='" . $data['userId'] . "'";
$query = mysql_query($sql);
if ($query) {
return true;
}
return false;
}
开发者ID:nvcDeb,项目名称:CoinCod,代码行数:45,代码来源:sql_function.php
示例19: strip_tags
<td style="background:#f4f4f4; width:54%;"><span class="tabletd">
<a href="mom-forum-thread-<?php
echo $thread['thread_seo'];
?>
">
<?php
$string = strip_tags($thread['thread_message']);
if (strlen($string) > 100) {
// truncate string
$stringCut = substr($string, 0, 100);
// make sure it ends in a word so assassinate doesn't become ass...
$string = substr($stringCut, 0, strrpos($stringCut, ' ')) . '...';
}
echo $string;
if ($thread['user_id'] > 0) {
$user_detail = getUserById($thread['user_id']);
$user = mysql_fetch_array($user_detail);
echo "<br> by ";
?>
<span style='color: #688031'><?php
echo $user['name'];
?>
<br></span>
<?php
echo date("d-m-y", strtotime($thread['createdAt']));
}
?>
</a>
</span></td>
<td class="text-center" style="background:#efefef; width:8%;"><sprean class="tabletd">
<?php
开发者ID:azeemgolive,项目名称:thefunkidsgame,代码行数:31,代码来源:mom-forum-thread.php
示例20: session_start
session_start();
if (isset($_REQUEST['post_id'])) {
include "dbconnection.php";
$post_id = $_GET['post_id'];
$reply_type = $_GET['reply_type'];
if ($reply_type == 'quote') {
$reply_type = "quick reply";
} else {
$reply_type = "reply";
}
$thread_user_id = $_GET['thread_user_id'];
$post_status = $_GET['post_status'];
$thread_post_user = getUserById($thread_user_id);
$thread_user = mysql_fetch_array($thread_post_user);
$post_user = $_GET['post_user_id'];
$post_user = getUserById($post_user);
$user_post = mysql_fetch_array($post_user);
approveThreadPosts($post_id, $post_status);
$subject = "Quick reply to thread";
$from = "[email protected]";
$to = $thread_user['email'];
$mail_body = "Hi " . $thread_user['name'] . "<br/><br/>" . $user_post['name'] . ",<br/><br/> has post a" . $reply_type . " to thread has been posted on your thread on TheFunKids.com<br /><br /></br>Regards & Love<br/><br/>The Fun Kids Team";
$body = wordwrap($mail_body, 2000);
//$body_user = wordwrap($mail_body_user,70);
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: " . $from . "\r\n";
$headers .= 'Bcc:[email protected],[email protected],[email protected]' . "\r\n";
//------------------------Thanks You Email-------------------------------------------------------------------
mail($to, $subject, $mail_body, $headers);
header("location:mom-forum-posts.php");
开发者ID:azeemgolive,项目名称:thefunkidsgame,代码行数:31,代码来源:doapprovepost.php
注:本文中的getUserById函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论