本文整理汇总了PHP中GetUserInfo函数的典型用法代码示例。如果您正苦于以下问题:PHP GetUserInfo函数的具体用法?PHP GetUserInfo怎么用?PHP GetUserInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetUserInfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: verify_user
function verify_user($userArray)
{
if (!(isset($userArray['user_id']) || (isset($userArray['username']) || isset($userArray['email'])) && (isset($userArray['password']) || isset($userArray['token'])))) {
throw new Exception("Must provide (username or email) and password.");
}
//set variables
$user_id = isset($userArray['user_id']) ? $userArray['user_id'] : NULL;
$username = isset($userArray['username']) ? $userArray['username'] : NULL;
$email = isset($userArray['email']) ? $userArray['email'] : NULL;
$password = isset($userArray['password']) ? $userArray['password'] : NULL;
$token = isset($userArray['token']) ? $userArray['token'] : NULL;
if (isset($token)) {
$user_id = VerifyToken($token, $user_id, $username);
if ($user_id === FALSE) {
throw new Exception("Your session has expired. Please log in again.");
}
$token = $token;
}
$dbh = new PDOConnection();
// Could not verify by token, try by username/email and password
if (empty($user_id)) {
$row = GetUserInfo($dbh, $username, $email, $password);
//user verified, return proper landing page content
$user_id = $row['id'];
$token = GenerateToken($username, $password);
StoreToken($username, $token);
}
return array_merge(GetLandingPageContent($dbh, $user_id), array('token' => $token));
}
示例2: AdminAuditLog
function AdminAuditLog()
{
AddCenterBox('Лог действий администраторов');
$query = System::database()->Select('audit', '');
$count = count($query);
if ($count > 0) {
if (isset($_GET['page'])) {
$page = SafeEnv($_GET['page'], 10, int);
} else {
$page = 1;
}
SortArray($query, 'date', true);
$num = 25;
if ($count > $num) {
$navigator = new Navigation($page);
$navigator->GenNavigationMenu($query, $num, ADMIN_FILE . '?exe=audit&a=log');
$nav = true;
} else {
$nav = false;
}
$text = '<table cellspacing="0" cellpadding="0" class="cfgtable">';
$text .= Indent('<tr>
<th>Пользователь</th>
<th>Действие</th>
<th>Дата</th>
<th>IP</th>
</tr>');
foreach ($query as $q) {
$user = GetUserInfo(SafeDB($q['user'], 11, int));
$date = TimeRender(SafeDB($q['date'], 11, int));
$action = SafeDB($q['action'], 255, str);
$action = nl2br(str_replace(array(' ', "\t"), array(' ', ' '), $action));
$ip = SafeDB($q['ip'], 255, str);
$text .= '<tr>
<td>' . System::admin()->Link(SafeDB($user['name'], 50, str), ADMIN_FILE . '?exe=admins&a=editadmin&id=' . SafeDB($user['id'], 11, int)) . '</td>
<td style="text-align: left;">' . $action . '</td>
<td>' . $date . '</td>
<td>' . $ip . '</td>
</tr>';
}
$text .= '</table>';
$text .= System::admin()->SpeedConfirm('Очистить лог', ADMIN_FILE . '?exe=audit&a=clear_log', '', 'Очистить лог действий администраторов?', true, true);
AddText($text);
if ($nav) {
AddNavigation();
}
} else {
System::admin()->Highlight('Администраторы не произвели никаких действий.');
}
}
示例3: GetUserRole
function GetUserRole(&$ldap, &$ldap_connection)
{
global $admin_list, $user_list;
if (count($admin_list) > 0 || count($user_list) > 0) {
$user = GetUserInfo($ldap, $ldap_connection);
$primary_group = GetUserPrimaryGroupName($ldap, $user, $ldap_connection);
if (IsUserInRoleArray($ldap, $admin_list, $user, $primary_group, $ldap_connection)) {
return "admin";
}
if (IsUserInRoleArray($ldap, $user_list, $user, $primary_group, $ldap_connection)) {
return "user";
}
}
return "none";
}
示例4: Pretest
function Pretest()
{
global $qcount;
global $uid;
//chk onlne
if (!is_online()) {
echo ': APPLICATION OFFLINE';
}
//TestEnd();
$loggedInUser = $_SESSION["userCakeUser"];
$_SESSION['mode'] = 'train';
$uid = $loggedInUser->user_id;
$_SESSION['uid'] = $uid;
GetUserInfo();
GetMyBattingside();
ChkStarted();
ChkConnect();
if (!isset($_SESSION['curquest'])) {
$_SESSION['curquest'] = 1;
}
echo '<a href="op/views/index.html" class="btn btn-primary"> START</a>';
}
示例5: IndexForumUserTopics
function IndexForumUserTopics()
{
global $forum_lang;
$forums_tree = ForumTree::Instance();
// Проверка данных
if (isset($_GET['user'])) {
$user_id = SafeEnv($_GET['user'], 11, int);
$user = GetUserInfo($user_id);
if ($user === false) {
// Пользователь не найден
System::site()->AddTextBox($forum_lang['error'], $forum_lang['error_no_user']);
return;
}
} else {
System::site()->AddTextBox($forum_lang['error'], $forum_lang['error_no_data']);
// Нет параметра
return;
}
// Параметры постраничной навигации
if (isset($_GET['page'])) {
$page = SafeEnv($_GET['page'], 11, int);
} else {
$page = 1;
}
$topics_on_page = System::config('forum/topics_on_page');
// Устанавливаем заголовок страницы
$function_title = $forum_lang['allusertopics'] . ' "' . $user['name'] . '"';
System::site()->SetTitle(SafeDB($function_title, 255, str) . ' - ' . ($page > 1 ? $forum_lang['page'] . $page . ' - ' : '') . $forum_lang['forum']);
$forum_nav_url = Ufu('index.php?name=forum&op=usertopics&user=' . $user_id, 'forum/usertopics/{user}-{page}/', true);
//$forum_url = Ufu('index.php?name=forum&op=usertopics&user='.$user_id, 'forum/usertopics/{user}/');
// Объекты статистики и онлайн
$statistics = ForumStatistics::Instance();
$online = ForumOnline::Instance('0', '0', true);
// Обновляем статус онлайн
// Инициализируем статистику
$statistics->Initialize($forum_lang['statistics_cat']);
// Хлебные крошки
System::site()->BreadCrumbAdd($function_title);
$auth = System::user()->Auth;
$is_admin = System::user()->isAdmin();
$current_user_id = System::user()->Get('u_id');
// Загружаем данные корзины для видимых топиков
$basket = ForumBasketGetData('forum_basket_topics');
// Загружаем информацию по топикам в $topics_data и считаем статистику (кэшировать статистику)
$topics_data = ForumCacheGetTopics();
// Запрашиваем данные тем (агрегированы по форумам)
$topics = array();
// Сюда будем добавлять топики для вывода
$resolve_cats = $forums_tree->GetAllAccessForumId(0);
// Считаем только в открытых для доступа форумах
foreach ($resolve_cats as $resolve_cat) {
if (!isset($topics_data[$resolve_cat])) {
continue;
}
foreach ($topics_data[$resolve_cat] as $topic) {
// Отсеиваем
if ($topic['starter_id'] == $user_id) {
// Добавляем данные из корзины, если топик удалён в корзину
$topic['status'] = '';
$topic['show_delete'] = $is_admin;
if ($topic['delete'] && isset($basket[$topic['id']]) && $auth && ($is_admin || $topic['starter_id'] == $current_user_id)) {
// Добавляем сообщение - "Удалено в корзину"
$topic['status'] = ForumBasketRender($topic['id'], $topic['title'], $basket, false);
$topic['show_delete'] = false;
} elseif ($topic['delete']) {
continue;
// Удалён топик и корзина не показывается для этого пользователя
}
$statistics->hits += $topic['hits'];
$statistics->AddTopicAuthor($topic['starter_id'], $topic['starter_name']);
$statistics->topics_count += 1;
$statistics->reply_count += $topic['posts'];
$topics[] = $topic;
}
}
}
unset($topics_data);
// Заголовки (Темы, Ответов, Просмотры)
System::site()->AddBlock('statistik', true, false, 'stat');
System::site()->SetVars('statistik', array('count_read' => ''));
// Отключаем некоторые блоки
System::site()->AddBlock('topic_form', false, false, 'form');
System::site()->AddBlock('topic_right', false, false, 'topic');
System::site()->AddBlock('forum', false);
System::site()->AddBlock('forum_guest_message', false);
// Блоки шаблона
// Ссылки, Отметить все как прочитанные и показать все не прочитанные темы.
$vars_is_forum_member = array();
$vars_is_forum_member['url'] = '<a href="' . Ufu('index.php?name=forum&op=markread', 'forum/markread/') . '">' . $forum_lang['mark_all_read'] . '</a>';
$vars_is_forum_member['viewnoreadurl'] = '<a href="' . Ufu('index.php?name=forum&op=viewnoread', 'forum/viewnoread/') . '">' . $forum_lang['viewnoread'] . '</a>';
$vars_is_forum_member['forum_id'] = '0';
if (!System::site()->HasBlock('is_forum_member')) {
System::site()->AddBlock('is_forum_member', AccessIsResolved(2), false, 'mark');
}
System::site()->SetVars('is_forum_member', $vars_is_forum_member);
// Последние темы форума
System::site()->AddBlock('old', true, false, 'mark');
$vars_old = array();
$vars_old['lasttopics'] = '<a href="' . Ufu('index.php?name=forum&op=lasttopics', 'forum/lasttopics/') . '">' . $forum_lang['lasttopics'] . '</a>';
System::site()->SetVars('old', $vars_old);
//.........这里部分代码省略.........
示例6: AddPictureToUser
function AddPictureToUser($username, $source)
{
$loc = "members_bulkpics.php->AddPIctureToUser";
$userid = GetUserIDFromName($username);
$userinfo = GetUserInfo($userid);
if ($userinfo === false) {
DieWithMsg($loc, 'User with ID=' . $userid . ' not found, but should be there.');
}
// Copy the file into our website.
$target = GetTempDir() . "temppic.jpg";
$result = @copy($source, $target);
if ($result == false) {
log_msg($loc, array('Picture not added. Unable to copy file.', 'External File=' . $source, 'Internal Target=' . $target));
return false;
}
$id = StoreUserPic($target, $userid);
return true;
}
示例7: RenderPost
private function RenderPost($ObjectId, &$Posts, $BlockName, $Level)
{
if (count($Posts) == 0) {
return false;
}
foreach ($Posts as $post) {
$post_id = SafeDB($post['id'], 11, int);
$user_id = SafeDB($post['user_id'], 11, int);
$vars = array();
$vars['level_padding'] = Posts::$LevelMargin * $Level;
$vars['post_message'] = HtmlChars($post['post_message']);
SmiliesReplace($vars['post_message']);
$vars['post_message'] = nl2br($vars['post_message']);
$vars['post_message'] = BbCodePrepare($vars['post_message']);
if ($user_id != 0) {
// Зарегистрированный пользователь
$userinfo = GetUserInfo($user_id);
$vars['user_link'] = Ufu("index.php?name=user&op=userinfo&user={$user_id}", 'user/{user}/info/');
$vars['user_name'] = '<a href="' . $vars['user_link'] . '">' . $userinfo['name'] . '</a>';
$vars['post_date'] = SafeDB($post['post_date'], 11, int);
if ($userinfo['hideemail'] == '0') {
$vars['user_email'] = AntispamEmail($userinfo['email']);
} else {
$vars['user_email'] = '';
}
$vars['user_homepage'] = SafeDB($userinfo['url'], 255, str);
$vars['user_homepage_url'] = UrlRender(SafeDB($post['user_homepage'], 255, str));
if ($userinfo['online']) {
$vars['user_status'] = 'Сейчас на сайте.';
} else {
$vars['user_status'] = '';
}
$vars['user_rank_image'] = $userinfo['rank_image'];
$vars['user_rank_name'] = $userinfo['rank_name'];
$vars['user_avatar'] = $userinfo['avatar_file'];
$vars['user_avatar_small'] = $userinfo['avatar_file_small'];
$vars['user_avatar_smallest'] = $userinfo['avatar_file_smallest'];
$vars['user_regdate'] = TimeRender($userinfo['regdate'], false, false);
} else {
$vars['user_name'] = SafeDB($post['user_name'], 255, str);
$vars['post_date'] = SafeDB($post['post_date'], 11, int);
if ($post['user_email'] != '' && $post['user_hideemail'] != 0) {
$vars['user_email'] = AntispamEmail(SafeDB($post['user_email'], 255, str));
} else {
$vars['user_email'] = '';
}
if ($post['user_homepage'] != '') {
$vars['user_homepage'] = SafeDB($post['user_homepage'], 255, str);
$vars['user_homepage_url'] = UrlRender(SafeDB($post['user_homepage'], 255, str));
} else {
$vars['user_homepage'] = '';
$vars['user_homepage_url'] = '';
}
$vars['user_status'] = '';
$vars['user_rank_image'] = '';
$vars['user_rank_name'] = '';
$vars['user_avatar'] = GetPersonalAvatar(0);
$vars['user_avatar_small'] = GetSmallUserAvatar(0, $vars['user_avatar']);
$vars['user_avatar_smallest'] = GetSmallestUserAvatar(0, $vars['user_avatar']);
$vars['user_regdate'] = '';
}
$vars['user_id'] = SafeDB($post['user_id'], 11, int);
$vars['post_id'] = $post_id;
$vars['user_ip'] = SafeDB($post['user_ip'], 19, str);
$vars['object_id'] = $ObjectId;
$vars['parent_id'] = SafeDB($post['post_parent_id'], 11, int);
if ($vars['user_homepage'] != '') {
$vars['user_homepage'] = '<a href="' . $vars['user_homepage_url'] . '" target="_blank">' . $vars['user_homepage'] . '</a>';
} else {
$vars['user_homepage'] = '';
}
$vars['post_date'] = TimeRender($vars['post_date']);
if (System::user()->Auth) {
$vars['editing'] = System::user()->Get('u_id') == $user_id || System::user()->isAdmin();
} else {
$vars['editing'] = $user_id == '0' && $vars['user_ip'] == getip();
}
$vars['answers'] = $this->Answers != '0' || System::user()->isAdmin();
if (!System::user()->Auth && !$this->GuestPost) {
$vars['answers'] = false;
}
if (!$this->AlloyComments) {
$vars['answers'] = false;
}
$vars['no_answers'] = !$vars['answers'];
$back = SaveRefererUrl();
$vars['edit_url'] = $this->EditPageUrl . '&post_id=' . $post_id . '&back=' . $back;
$vars['delete_url'] = $this->DeletePageUrl . '&post_id=' . $post_id . '&back=' . $back;
$vars['parent_post_url'] = $_SERVER['REQUEST_URI'] . '#post_' . SafeDB($post['post_parent_id'], 11, int);
$vars['post_url'] = $_SERVER['REQUEST_URI'] . '#post_' . $post_id;
System::site()->AddSubBlock($BlockName, true, $vars, array(), $this->PostTemplate);
if (isset($this->PostsTree[$post_id])) {
if ($this->MaxTreeLevel > $Level) {
$newLevel = $Level + 1;
} else {
$newLevel = $Level;
}
$this->RenderPost($ObjectId, $this->PostsTree[$post_id], $BlockName, $newLevel);
}
}
//.........这里部分代码省略.........
示例8: FromGSMGetAddress
$cellId = $_POST['cid'];
$locationAreaCode = $_POST['lac'];
$mobileCountryCode = $_POST['mcc'];
$mobileNetworkCode = $_POST['mnc'];
$imei = $_POST['imei'];
$jsonString = FromGSMGetAddress($cellId, $locationAreaCode, $mobileCountryCode, $mobileNetworkCode);
$arr = json_decode($jsonString, true);
$latitude = empty($arr["location"]["latitude"]) ? 0.0 : $arr["location"]["latitude"];
$longitude = empty($arr["location"]["longitude"]) ? 0.0 : $arr["location"]["longitude"];
echo "{'state':'1002','message':'{$latitude},{$longitude}'}";
$address = GetAddress("http://maps.google.com/maps/api/geocode/json?latlng=" . $latitude . "," . $longitude . "&sensor=true");
GsmLog($DB, $cellId, $locationAreaCode, $mobileCountryCode, $mobileNetworkCode, $imei, $latitude, $longitude, $address);
break;
case 'reg':
$email = $_POST['email'];
$nick = $_POST['nick'];
$pass = $_POST['pass'];
$imei = $_POST['imei'];
break;
case 'getLocalMessage':
$Latitude = $_POST['Latitude'];
$Longitude = $_POST['Longitude'];
$localMessage = GetNearbyMessage($DB, $Latitude, $Longitude);
echo "{'state':'1006','message':'{$localMessage}'}";
break;
case 'getuser':
$imei = $_POST['imei'];
$userinfo = GetUserInfo($DB, $imei);
echo "{'state':'1007','message':'{$userinfo}'}";
break;
}
示例9: GetSessionInfo
<?php
include '/connection/authenticate.php';
require_once '/connection/config.php';
include 'functions.php';
$sessionuserid = $_SESSION['id'];
//get the user id for this session
$sessionaccounttype = $_SESSION['accounttype'];
//get the user id for this session
//get the session id from log history
$sessionrec = GetSessionInfo($sessionuserid);
$_SESSION['maxsession'] = $sessionrec['maxsession'];
$sessionid = $_SESSION['maxsession'];
//get the session id
//get the name of the user for the current session
$sessionuser = GetUserInfo($sessionuserid);
$sessionusername = $sessionuser['username'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="description" content=""/>
<meta name="keywords" content="" />
<meta name="author" content="" />
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<title>IDSR GOK</title>
<script language="JavaScript" src="scripts/FusionMaps.js"></script>
<script language="JavaScript" src="scripts/FusionCharts.js"></script>
<script type="text/javascript" src="jquery.min.js"></script>
示例10: merge_workorders
function merge_workorders($wo1, $wo2)
{
$loc = rmabs(__FILE__ . ".merge_workorders");
$wid1 = $wo1["WID"];
$wid2 = $wo2["WID"];
$wo1["Description"] .= "\n\n" . $wo2["Description"];
UpdateWorkOrder($wid1, $wo1);
$data = GetAppendedData($wid2);
$nd = 0;
foreach ($data as $d) {
if ($d["UserID"] == 0) {
continue;
}
// Skip sys generated msg.
if ($d["Removed"]) {
continue;
}
// Skip deleted data.
AppendWorkOrderData($wid1, $d["UserID"], $d["TextInfo"], $d["PicID"], false);
$nd++;
}
$workers = GetAssignedWorkers($wid2);
$nw = 0;
foreach ($workers as $w) {
MakeAssignment($wid1, $w["UserID"]);
RemoveAssignment($wid2, $w["UserID"]);
$nw++;
}
$userid = GetUserID();
$userinfo = GetUserInfo($userid);
$username = MakeFullName($userinfo);
if (!$wo2["Closed"]) {
ChangeWOStatus($wid2, $username, "Closed", true);
}
$newwostr = WIDStr($wid1, $wo1["Revision"], $wo1["IsApproved"]);
AttachSystemNote($wid2, "This WO Merged into " . $newwostr . " by " . $username . '.');
$oldwostr = WIDStr($wid2, $wo2["Revision"], $wo2["IsApproved"]);
AttachSystemNote($wid1, "Data from " . $oldwostr . " merged into this one by " . $username . '.');
$msg = 'Workorder ' . $oldwostr . ' merged into ' . $newwostr . '. ';
$msg .= 'Number Items Copied=' . $nd . '. ';
$msg .= 'Number of Workers Reassigned=' . $nw . '. ';
log_msg($loc, array($msg, "By " . $username));
return $msg;
}
示例11: IndexFormSendMail
function IndexFormSendMail($email, $form_name, $time, $user, $ip, $data_rows)
{
if ($user != 0) {
$user_info = GetUserInfo($user);
$user = SafeDB($user_info['name'], 255, str) . ' ( id:' . SafeDB($user_info['id'], 11, int) . ' )';
$from = $user_info['name'];
$from_email = $user_info['email'];
} else {
$user = 'Не зарегистрирован';
$from = System::config('general/site_name');
$from_email = System::config('general/site_email');
}
$subject = 'Веб форма "' . SafeDB($form_name, 255, str) . '"';
$mail = LmEmailExtended::Instance();
$mail->SetSubject(Cp1251ToUtf8($subject));
$mail->SetFrom($from_email, Cp1251ToUtf8($from));
$mail->AddTo($email, Cp1251ToUtf8('Администратор'));
$post_text = '';
foreach ($data_rows as $row) {
if ($row[2] == 'file') {
$mail->AddAttachmentPart(file_get_contents($row[1]), $row[3]);
} else {
$post_text .= '<b>' . SafeDB($row[0], 255, str) . ':</b><br />' . SafeDB($row[1], 0, str) . '<br />';
}
}
$text = Indent('
<html>
<head>
<title>Форма</title>
</head>
<body>
<table cellspacing="2" cellpadding="10" border="1">
<tr>
<th>Дата: ' . TimeRender($time, true, false) . '</th>
<th>Пользователь: ' . $user . '</th>
<th>IP: ' . $ip . '</th>
</tr>
<tr>
<td colspan="3" style="text-align: left;">' . $post_text . '</td>
</tr>
</table>
</body>
</html>
');
$mail->AddHtmlPart(Cp1251ToUtf8($text));
if (!$mail->Send()) {
ErrorHandler(USER_ERROR, 'Проблема при отправке E-mail "' . $subject . '".', __FILE__);
}
}
示例12: AdminForumBasket
function AdminForumBasket($table = 'forum_basket_post')
{
global $config, $site;
if (isset($_GET['page'])) {
$page = SafeEnv($_GET['page'], 10, int);
} else {
$page = 1;
}
if ($table == 'forum_basket_post') {
$site->Title .= ' > Удаляемые сообщения';
$caption = 'Удаляемые сообщения';
} else {
$site->Title .= ' > Удаляемые Темы';
$caption = 'Удаляемые Темы';
}
$result = System::database()->Select($table);
if (count($result) > 20) {
$navigator = new Navigation($page);
$navigator->GenNavigationMenu($result, 20, ADMIN_FILE . '?exe=forum&a=' . $table);
$nav = true;
} else {
$nav = false;
}
$mop = 'showtopic&topic=';
if ($table == 'forum_basket_post') {
$table_caption = ' (сообщение)';
if (count($result) > 0) {
$mposts = array();
$where = '';
foreach ($result as $mpost) {
$where .= "`id`='" . $mpost['obj_id'] . "' or ";
}
$where = substr($where, 0, strlen($where) - 3);
$result_posts = System::database()->Select('forum_posts', $where);
if (count($result_posts) > 0) {
foreach ($result_posts as $mpost) {
$mposts[$mpost['id']] = $mpost['object'];
$mpostsm[$mpost['id']] = $mpost['message'];
}
foreach ($result as $mpost) {
$mpost['obj_id2'] = $mposts[$mpost['obj_id']];
$mpost['obj_id'] = $mpost['obj_id'];
$mpost['date'] = $mpost['date'];
$mpost['user'] = $mpost['user'];
$mpost['reason'] = $mpost['reason'];
$mpost['message'] = $mpostsm[$mpost['obj_id']];
$result2[] = $mpost;
}
$result = $result2;
}
}
} else {
$table_caption = ' (название темы)';
if (count($result) > 0) {
$where = '';
foreach ($result as $mpost) {
$where .= "`id`='" . $mpost['obj_id'] . "' or ";
}
$where = substr($where, 0, strlen($where) - 3);
$result_topics = System::database()->Select('forum_topics', $where);
if (count($result_topics) > 0) {
foreach ($result_topics as $mtopic) {
$mtopics[$mtopic['id']] = $mtopic['title'];
}
foreach ($result as $mtopic) {
$mpost['obj_id'] = $mtopic['obj_id'];
$mpost['date'] = $mtopic['date'];
$mpost['user'] = $mtopic['user'];
$mpost['reason'] = $mtopic['reason'];
$mpost['message'] = $mtopics[$mtopic['obj_id']];
$result2[] = $mpost;
}
$result = $result2;
}
}
}
$text = '<table cellspacing="0" cellpadding="0" class="cfgtable">';
$text .= '<tr><th>Кто удалил</th><th>Дата удаления</th><th>Дата окончательного удаления</th><th>Комментарий</th><th>Содержимое удаляемого <BR>' . $table_caption . '</th><th>Функции</th></tr>';
foreach ($result as $basket) {
$mop = 'showtopic&topic=' . ($table == 'forum_basket_post' ? $basket['obj_id2'] : $basket['obj_id']);
$restore_link = ADMIN_FILE . '?exe=forum&a=basket_restore&' . $table . '=' . $basket['obj_id'];
$ainfo = GetUserInfo($basket['user']);
$text .= '<tr>
<td>' . $ainfo['name'] . '</td>
<td>' . TimeRender($basket['date'], false, false) . '</td>
<td>' . TimeRender($basket['date'] + 86400 * $config['forum']['clear_basket_day'], false, false) . '</td>
<td>' . $basket['reason'] . '</td>
<td>' . (isset($basket['message']) ? $basket['message'] : '') . '</td>
<td><a href="' . $restore_link . '">Восстановить</a>
<a href="index.php?name=forum&op=' . $mop . '" target="_blank">Просмотр</a></td>
</tr>';
}
$text .= '</table>';
AddTextBox($caption, $text);
if ($nav) {
AddNavigation();
}
}
示例13: AdminFormsViewPosts
function AdminFormsViewPosts($new)
{
$file_save_dir = 'uploads/forms';
if (!isset($_GET['id'])) {
return;
}
$id = SafeEnv($_GET['id'], 11, int);
System::database()->Select('forms', "`id`='{$id}'");
$form = System::database()->FetchRow();
$box_title = $form['hname'];
if ($new) {
$moderated = " and `moderated`='0'";
} else {
$moderated = '';
}
$posts = System::database()->Select('forms_data', "`form_id`='{$id}'" . $moderated);
if (count($posts) == 0) {
System::admin()->AddCenterBox('Новые поcты формы "' . $box_title . '"');
System::admin()->Highlight('Нет новых сообщений');
return;
}
$text = '';
foreach ($posts as $post) {
$time = TimeRender(SafeDB($post['time'], 11, int));
if ($post['user_id'] > 0) {
$user_info = GetUserInfo(SafeDB($post['user_id'], 11, int));
$user_name = '<a href="' . 'index.php?name=user&op=userinfo&user=' . $user_info['id'] . '">' . $user_info['name'] . '</a>';
} else {
$user_name = '-';
}
$ip = SafeDB($post['user_ip'], 20, str);
$data_rows = unserialize($post['data']);
$post_text = '';
foreach ($data_rows as $row) {
if ($row[2] == 'file') {
$post_text .= '<b>' . SafeDB($row[0], 255, str) . ':</b><br><a href="' . SafeDB($file_save_dir . '/' . $row[1], 0, str) . '">' . SafeDB($row[3], 255, str) . '</a><br>';
} else {
$post_text .= '<b>' . SafeDB($row[0], 255, str) . ':</b><br>' . SafeDB($row[1], 0, str) . '<br>';
}
}
$delfunc = System::admin()->SpeedConfirm('Удалить данные формы', ADMIN_FILE . '?exe=forms&a=delpost&id=' . $id . '&pid=' . SafeDB($post['id'], 11, int) . '&ok=0' . ($new ? '&new=1' : ''), 'images/admin/delete.png', 'Удалить?');
//'<a href="'.ADMIN_FILE.'?exe=forms&a=delpost&id='.$id.'&pid='.SafeDB($post['id'], 11, int).'&ok=0&new=1"><img src="images/admin/delete.png" title="Удалить эти данные" /></a>';
$text .= '<table cellspacing="0" cellpadding="0" border="0" class="cfgtable">';
$text .= '<tr><th>Дата: ' . $time . '</td><th>Пользователь: ' . $user_name . '</td><th>IP: ' . $ip . '</td><th width="30">' . $delfunc . '</td></tr>';
$text .= '<tr><td colspan="4" style="text-align:left;padding-left:10px;">' . $post_text . '</td></tr>';
$text .= '</table>';
}
if ($new) {
$text .= '<div style="text-align: right;">' . System::admin()->SpeedButton('Отметить все как просмотренные', ADMIN_FILE . '?exe=forms&a=checkall&id=' . $id, '', true, true) . '</div>';
}
AddTextBox('Новые поcты формы "' . $box_title . '"', $text);
}
示例14: GetUserInfo
<a href="javascript:void(0);" class="waves-effect waves-button waves-classic" id="showRight">
<i class="fa fa-comments"></i>
</a>
</li>
</ul><!-- Nav -->
</div><!-- Top Menu -->
</div>
</div>
</div><!-- Navbar -->
<div class="page-sidebar sidebar">
<div class="page-sidebar-inner slimscroll">
<div class="sidebar-header">
<div class="sidebar-profile">
<a href="javascript:void(0);" id="profile-menu-link">
<?php
@($userinfo = GetUserInfo());
@($uservalue = $userinfo[0]);
@($confObj = CheckconfigInfo());
//prepare the variables for youtube and viedo and images
if (count($confObj) > 0) {
if (@$confObj['uploaddirectory'] != '') {
@($uploads = $confObj['uploaddirectory']);
} else {
@($uploads = 'uploads/');
}
} else {
@($uploads = 'uploads/');
}
if (preg_match('/___/', $uservalue)) {
@($username = substr($uservalue, 0, strpos($uservalue, '___')));
@($userimage = substr($uservalue, strpos($uservalue, '_') + 3));
示例15: CreateOrderTableHead
function CreateOrderTableHead($MKZ, $UGP)
{
$userinfo = GetUserInfo();
$head = $userinfo;
$head = $head . "<p style=\"font-family: Arial; font-size:18px;\" >Bestellungen aus Magento</p>\n";
$timestamp = strtotime("-1 days");
$head = $head . "<p style=\"font-family: Arial; font-size:12px;\" >ab Datum: \n";
$head = $head . "<input type=\"text\" maxlength=\"10\" width=\"50\" name=\"selDate\" value=\"" . date("d.m.Y", $timestamp) . "\">";
$timestamp = strtotime("16:00:00");
$head = $head . " Uhrzeit:";
$head = $head . "<input type=\"text\" maxlength=\"10\" width=\"50\" name=\"selTime\" value=\"" . date("G:i:s", $timestamp) . "\"></p>\n";
$ahref = "<a href=\"order.php?MKZ=" . $MKZ . "&UPG=" . $UGP . "&function=GetMagOrders\"><button style=\"width:400px\">Bestellungen aus dem Shop holen</button></a>";
$head = $head . "<p style=\"font-family: Arial; font-size:10px;\" >" . $ahref . "</p>";
$ahref = "<a href=\"order.php?MKZ=" . $MKZ . "&UPG=" . $UGP . "&function=PrintAllReservations\"><button style=\"width:400px\">Reservierungen drucken für ALLE NEU importierten</button></a>";
$head = $head . "<p style=\"font-family: Arial; font-size:10px;\" >" . $ahref . "</p>";
$aorder = "";
$ahref = "<a href=\"order.php?MKZ=" . $MKZ . "&UPG=" . $UGP . "&function=PrintChecked\">";
$ahref = $ahref . "<button onClick=\"PrintCheckedOrders()\" style=\"width:400px\">" . $aorder . "Reservierungen drucken für alle angekreuzten Bestellungen</button></a>";
$head = $head . "<p style=\"font-family: Arial; font-size:10px;\" >" . $ahref . "</p>";
$head = $head . "<br>";
return $head;
}