本文整理汇总了PHP中LoadUser函数的典型用法代码示例。如果您正苦于以下问题:PHP LoadUser函数的具体用法?PHP LoadUser怎么用?PHP LoadUser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LoadUser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Admin_Debug
function Admin_Debug()
{
global $session;
global $db_prefix;
global $GlobalUser;
if (method() === "POST") {
$query = "SELECT * FROM " . $db_prefix . "debug ORDER BY date DESC, error_id DESC LIMIT 50";
$result = dbquery($query);
$rows = dbrows($result);
while ($rows--) {
$msg = dbarray($result);
if ($_POST["delmes" . $msg['error_id']] === "on" || $_POST['deletemessages'] === "deleteall") {
$query = "DELETE FROM " . $db_prefix . "debug WHERE error_id = " . $msg['error_id'];
dbquery($query);
}
}
}
$query = "SELECT * FROM " . $db_prefix . "debug ORDER BY date DESC, error_id DESC LIMIT 50";
$result = dbquery($query);
?>
<?php
echo AdminPanel();
?>
<table class='header'><tr class='header'><td><table width="519">
<form action="index.php?page=admin&session=<?php
echo $session;
?>
&mode=Debug" method="POST">
<tr><td colspan="4" class="c">Сообщения</td></tr>
<tr><th>Действие</th><th>Дата</th><th>От</th><th>Браузер</th></tr>
<?php
$rows = dbrows($result);
while ($rows--) {
$msg = dbarray($result);
$user = LoadUser($msg['owner_id']);
$from = "<a href=\"index.php?page=admin&session={$session}&mode=Users&player_id=" . $msg['owner_id'] . "\">" . $user['oname'] . "</a> [" . $msg['ip'] . "]";
$msg['text'] = str_replace("{PUBLIC_SESSION}", $session, $msg['text']);
echo "<tr><th><input type=\"checkbox\" name=\"delmes" . $msg['error_id'] . "\"/></th><th>" . date("m-d H:i:s", $msg['date']) . "</th><th>{$from} </th><th>" . $msg['agent'] . " </th></tr>\n";
echo "<tr><td class=\"b\"> </td><td class=\"b\" colspan=\"3\">" . $msg['text'] . "</td></tr>\n";
}
?>
<tr><td class="b"> </td><td class="b" colspan="3"></td></tr>
<tr><th colspan="4" style='padding:0px 105px;'></th></tr>
<tr><th colspan="4">
<select name="deletemessages">
<option value="deletemarked">Удалить выделенные сообщения</option>
<option value="deleteall">Удалить все сообщения</option>
</select><input type="submit" value="ok" /></th></tr>
<tr><td colspan="4"><center> </center></td></tr>
</form>
</table>
<?php
}
示例2: EnumNotes
function EnumNotes($player_id)
{
global $db_prefix;
$limit = 20;
$user = LoadUser($player_id);
if ($user['admin'] > 0) {
$limit = 150;
}
$query = "SELECT * FROM " . $db_prefix . "notes WHERE owner_id = {$player_id} ORDER BY date DESC LIMIT {$limit}";
$result = dbquery($query);
return $result;
}
示例3: Admin_Browse
function Admin_Browse()
{
global $session;
global $db_prefix;
global $GlobalUser;
$query = "SELECT * FROM " . $db_prefix . "browse ORDER BY date DESC LIMIT 50";
$result = dbquery($query);
AdminPanel();
$rows = dbrows($result);
echo "Последняя история переходов (50 записей):<br>";
echo "<table>\n";
while ($rows--) {
$log = dbarray($result);
$user = LoadUser($log['owner_id']);
?>
<tr><td><table>
<tr> <th> <?php
echo $user['oname'];
?>
</th> <th> <?php
echo $log['url'];
?>
</th> </tr>
<tr> <th rowspan=2>
<?php
echo $log['method'];
?>
<br>
<?php
echo date("d M Y", $log['date']);
?>
<br>
<?php
echo date("H:i:s", $log['date']);
?>
</th> <th> <?php
echo print_r(unserialize($log['getdata']));
?>
</th> </tr>
<tr> <th> <?php
echo print_r(unserialize($log['postdata']));
?>
</th> </tr>
</table></td></tr>
<?php
}
echo "</table>\n";
}
示例4: DeleteExpiredMessages
function DeleteExpiredMessages($player_id)
{
global $db_prefix;
$now = time();
$hours24 = 60 * 60 * 24;
// Не удалять сообщения администрации.
$user = LoadUser($player_id);
if ($user['admin'] > 0) {
return;
}
$query = "SELECT * FROM " . $db_prefix . "messages WHERE owner_id = {$player_id}";
$result = dbquery($query);
$num = dbrows($result);
while ($num--) {
$msg = dbarray($result);
if ($msg['date'] + $hours24 <= $now) {
DeleteMessage($player_id, $msg['msg_id']);
}
}
}
示例5: ProdResources
function ProdResources($planet, $time_from, $time_to)
{
global $db_prefix, $GlobalUni;
if (!($planet['type'] > 0 && $planet['type'] < 10000)) {
return $planet;
}
// НЕ планета
$user = LoadUser($planet['owner_id']);
if ($user['player_id'] == 99999) {
return $planet;
}
// технический аккаунт space
$diff = $time_to - $time_from;
$unitab = $GlobalUni;
$speed = $unitab['speed'];
$prem = PremiumStatus($user);
if ($prem['geologist']) {
$g_factor = 1.1;
} else {
$g_factor = 1.0;
}
$hourly = prod_metal($planet['b1'], $planet['mprod']) * $planet['factor'] * $speed * $g_factor + 20 * $speed;
// Металл
if ($planet['m'] < $planet['mmax']) {
$planet['m'] += $hourly * $diff / 3600;
if ($planet['m'] >= $planet['mmax']) {
$planet['m'] = $planet['mmax'];
}
}
$hourly = prod_crys($planet['b2'], $planet['kprod']) * $planet['factor'] * $speed * $g_factor + 10 * $speed;
// Кристалл
if ($planet['k'] < $planet['kmax']) {
$planet['k'] += $hourly * $diff / 3600;
if ($planet['k'] >= $planet['kmax']) {
$planet['k'] = $planet['kmax'];
}
}
$hourly = prod_deut($planet['b3'], $planet['temp'] + 40, $planet['dprod']) * $planet['factor'] * $speed * $g_factor;
// Дейтерий
$hourly -= cons_fusion($planet['b12'], $planet['fprod']) * $speed;
// термояд
if ($planet['d'] < $planet['dmax']) {
$planet['d'] += $hourly * $diff / 3600;
if ($planet['d'] >= $planet['dmax']) {
$planet['d'] = $planet['dmax'];
}
}
$planet_id = $planet['planet_id'];
$query = "UPDATE " . $db_prefix . "planets SET m = '" . $planet['m'] . "', k = '" . $planet['k'] . "', d = '" . $planet['d'] . "', lastpeek = '" . $time_to . "' WHERE planet_id = {$planet_id}";
dbquery($query);
$planet['lastpeek'] = $time_to;
return $planet;
}
示例6: LoadUser
echo " <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n";
echo " <title>Вселенная {$uni} ОГейм</title>\n";
echo " </head>\n\n";
echo " <body>\n";
echo " <center><font size=\"3\"><b>\n";
echo " <br /><br />\n";
echo " <font color=\"#FF0000\">Произошла ошбка</font>\n";
echo " <br /><br />\n";
echo " Эта функция доступна только после активации аккаунта. \n";
echo " <br /><br />\n";
echo " Error-ID: 123456 </b></font></center>\n\n";
echo " </body>\n";
echo "</html>\n\n";
}
// *******************************************************************
$user = LoadUser(intval($_GET['messageziel']));
$home = GetPlanet($user['hplanetid']);
$ownhome = GetPlanet($GlobalUser['hplanetid']);
// Обработать POST-запрос.
if (key_exists('gesendet', $_GET)) {
if ($_GET['gesendet'] == 1) {
// Проверить активацию аккаунта.
if (!$GlobalUser['validated']) {
ob_clean();
SendNotActivated();
ob_end_flush();
exit;
}
$subj = $_POST['betreff'];
$text = $_POST['text'];
if ($subj === "") {
示例7: EnumPlanetsGalaxy
echo "<td class=\"c\">Название (активность)</td>\n";
echo "<td class=\"c\">луна</td>\n";
echo "<td class=\"c\">поле обломков</td>\n";
echo "<td class=\"c\">игрок (статус)</td>\n";
echo "<td class=\"c\">Альянс</td>\n";
echo "<td class=\"c\">Действия</td>\n";
echo "</tr>\n";
/***** Перечислить планеты *****/
$p = 1;
$tabindex = 3;
$result = EnumPlanetsGalaxy($coord_g, $coord_s);
$num = $planets = dbrows($result);
$phalanx_radius = $aktplanet['b42'] * $aktplanet['b42'] - 1;
while ($num--) {
$planet = dbarray($result);
$user = LoadUser($planet['owner_id']);
$own = $user['player_id'] == $GlobalUser['player_id'];
for ($p; $p < $planet['p']; $p++) {
empty_row($p);
}
$phalanx = $system_radius <= $phalanx_radius && $aktplanet['type'] == 0 && $planet['owner_id'] != $GlobalUser['player_id'] && $planet['g'] == $aktplanet['g'];
// Коорд.
echo "<tr>\n";
echo "<th width=\"30\"><a href=\"#\" tabindex=\"" . $tabindex++ . "\" >" . $p . "</a></th>\n";
// Планета
echo "<th width=\"30\">\n";
if ($planet['type'] > 0 && $planet['type'] < 10000) {
echo "<a style=\"cursor:pointer\" onmouseover='return overlib(\"<table width=240>";
echo "<tr><td class=c colspan=2 >Планета " . $planet['name'] . " [" . $planet['g'] . ":" . $planet['s'] . ":" . $planet['p'] . "]</td></tr>";
echo "<tr><th width=80 ><img src=" . GetPlanetSmallImage(UserSkin(), $planet) . " height=75 width=75 /></th>";
echo "<th align=left >";
示例8: Admin_UserLogs
function Admin_UserLogs()
{
global $session;
global $db_prefix;
global $GlobalUser;
// Обработка POST-запроса.
if (method() === "POST" && $GlobalUser['admin'] >= 1) {
$name = $_POST['name'];
$type = $_POST['type'];
$period = intval($_POST['days']) * 24 * 60 * 60 + intval($_POST['hours']) * 60 * 60;
$arr = My_date_parse_from_format("dd.mm.yyyy", $_POST['since']);
$since = mktime(0, 0, 0, $arr['month'], $arr['day'], $arr['year']);
// Шаг 1 : найти всех пользователей неточным сравнением
$users = array();
$query = "SELECT * FROM " . $db_prefix . "users WHERE player_id > 0";
$result = dbquery($query);
while ($user = dbarray($result)) {
$percent = 0;
similar_text(mb_strtolower($name), mb_strtolower($user['oname']), &$percent);
if ($percent > 75) {
$users[] = $user;
}
}
// Шаг 2 : выбрать события указанной категории за промежуток времени
$results = "";
foreach ($users as $i => $user) {
if ($type !== "ALL") {
$tstr = "AND type = '" . $type . "'";
}
$query = "SELECT * FROM " . $db_prefix . "userlogs WHERE owner_id = " . $user['player_id'] . " AND (date >= " . $since . " AND date <= " . ($since + $period) . ") " . $tstr . " ORDER BY date ASC";
$result = dbquery($query);
$count = dbrows($result);
$results .= "<h2>История {$type} игрока " . AdminUserName($user) . " ({$count})</h2>\n";
$results .= "<table><tr><td class=\"c\">Дата</td><td class=\"c\">Тип</td><td class=\"c\">Действие</td></tr>\n";
while ($log = dbarray($result)) {
$results .= "<tr><td>" . date("d.m.Y H:i:s", $log['date']) . "</td><td>" . $log['type'] . "</td><td>" . $log['text'] . "</td></tr>\n";
}
$results .= "</table>";
}
}
?>
<?php
echo AdminPanel();
?>
<?php
if (method() === "GET") {
$query = "SELECT * FROM " . $db_prefix . "userlogs WHERE owner_id > 0 ORDER BY date DESC LIMIT 50";
$result = dbquery($query);
echo "<h2>Последние действия игроков</h2>\n";
echo "<table><tr><td class=\"c\">Дата</td><td class=\"c\">Игрок</td><td class=\"c\">Категория</td><td class=\"c\">Действие</td></tr>\n";
$rows = array();
while ($log = dbarray($result)) {
$user = LoadUser($log['owner_id']);
$rows[] = "<tr><td>" . date("d.m.Y H:i:s", $log['date']) . "</td><td>" . AdminUserName($user) . "</td><td>" . $log['type'] . "</td><td>" . $log['text'] . "</td></tr>\n";
}
$rows = array_reverse($rows);
foreach ($rows as $i => $row) {
echo $row;
}
echo "</table>";
}
?>
<?php
echo $results;
?>
<h2>История действий</h2>
<table>
<form action="index.php?page=admin&session=<?php
echo $session;
?>
&mode=UserLogs" method="POST" >
<tr><td>Имя пользователя</td><td><input type="text" size=20 name="name"/> (можно примерно)</td></tr>
<tr><td>Категория</td><td>
<select name="type">
<option value="ALL">Все</option>
<option value="BUILD">Постройки / Снос</option>
<option value="RESEARCH">Исследования</option>
<option value="SHIPYARD">Постройка флота</option>
<option value="DEFENSE">Постройка обороны</option>
<option value="FLEET">Отправка флота</option>
<option value="PLANET">Настройки планеты</option>
<option value="SETTINGS">Изменение настроек аккаунта / РО</option>
<option value="OPER">Действия оператора</option>
</select>
</td></tr>
<tr><td>За период</td><td><input type="text" size=2 name="days" value="2"/> дн. <input type="text" size=2 name="hours"/> ч.</td></tr>
<tr><td>Начиная с</td><td><input type="text" size=20 name="since" value="<?php
echo date("d.m.Y", time() - 24 * 60 * 60);
?>
"/> ДД.ММ.ГГГ</td></tr>
<tr><td class="c" colspan=2> <input type="submit" value="Отправить" /></td></tr>
</form>
//.........这里部分代码省略.........
示例9: ReactivateUser
function ReactivateUser($player_id)
{
global $db_prefix, $db_secret;
$user = LoadUser($player_id);
if ($user == null) {
return;
}
$len = 8;
$r = '';
for ($i = 0; $i < $len; $i++) {
$r .= chr(rand(0, 25) + ord('a'));
}
$pass = $r;
$md = md5($pass . $db_secret);
$name = $user['oname'];
$email = $user['pemail'];
$ack = md5(time() . $db_secret);
$query = "UPDATE " . $db_prefix . "users SET validatemd = '" . $ack . "', validated = 0, password = '" . $md . "' WHERE player_id = {$player_id}";
dbquery($query);
if ($_SERVER['REMOTE_ADDR'] !== "127.0.0.1") {
SendGreetingsMail($name, $pass, $email, $ack);
}
}
示例10: Admin_Bans
//.........这里部分代码省略.........
// while
if ($rows0 > 0) {
?>
<tr><td class=c colspan=7>Действия</td></tr>
<tr>
<td colspan=6>
<input type="radio" name="banmode" value="0"> <font color=firebrick><b>Бан без РО</b></font>
<input type="radio" name="banmode" value="1" checked > <font color=red><b>Бан с РО</b></font>
<input type="radio" name="banmode" value="2"> <font color=yellow><b>Блок атак</b></font>
<input type="radio" name="banmode" value="3"> <font color=lime><b>Разбанить</b></font>
<input type="radio" name="banmode" value="4"> <font color=lime><b>Разрешить атаки</b></font>
</td>
<td><input name="days" type="text" size="5"> дней <input name="hours" type="text" size="3"> часов</td>
</tr>
<tr><th colspan=6> Причина: <textarea cols=40 rows=4 name="reason"><?php
echo "[url=mailto:" . $GlobalUser['pemail'] . "]контакт[/url]";
?>
</textarea></th><th><input type="submit" value="Отправить"></th></tr>
</form>
</table>
<?php
}
die;
}
if ($_GET['action'] === 'ban') {
// Забанить / разбанить
$now = time();
$reason = str_replace('\\"', """, bb($_POST['reason']));
$reason = str_replace('\'', "’", $reason);
$reason = str_replace('\\`', "‘", $reason);
$seconds = intval($_POST['days']) * 24 * 60 * 60 + intval($_POST['hours']) * 60 * 60;
foreach ($_POST['id'] as $player_id => $checked) {
$user = LoadUser($player_id);
switch (intval($_POST['banmode'])) {
case 0:
// Добавить пользователя на столб позора
$entry = array(null, $GlobalUser['oname'], $user['oname'], $GlobalUser['player_id'], $user['player_id'], $now, $now + $seconds, $reason);
AddDBRow($entry, "pranger");
BanUser($player_id, $seconds, 0);
break;
case 1:
// Добавить пользователя на столб позора
$entry = array(null, $GlobalUser['oname'], $user['oname'], $GlobalUser['player_id'], $user['player_id'], $now, $now + $seconds, $reason);
AddDBRow($entry, "pranger");
BanUser($player_id, $seconds, 1);
break;
case 2:
// Добавить пользователя на столб позора
$entry = array(null, $GlobalUser['oname'], $user['oname'], $GlobalUser['player_id'], $user['player_id'], $now, $now + $seconds, $reason);
AddDBRow($entry, "pranger");
BanUserAttacks($player_id, $seconds);
break;
case 3:
UnbanUser($player_id);
break;
case 4:
UnbanUserAttacks($player_id);
break;
}
}
// for
}
}
?>
示例11: Admin_Debug
function Admin_Debug()
{
global $session;
global $db_prefix;
global $GlobalUser;
$message_limit = 50;
if (key_exists('filter', $_REQUEST)) {
$filter = $_REQUEST['filter'];
} else {
$filter = "";
}
if (method() === "POST" && $filter === "") {
if ($_POST['deletemessages'] === "deleteall") {
$query = "TRUNCATE TABLE " . $db_prefix . "debug;";
dbquery($query);
} else {
$query = "SELECT * FROM " . $db_prefix . "debug ORDER BY date DESC, error_id DESC LIMIT " . $message_limit;
$result = dbquery($query);
$rows = dbrows($result);
while ($rows--) {
$msg = dbarray($result);
if (key_exists("delmes" . $msg['error_id'], $_POST) || $_POST['deletemessages'] === "deleteshown") {
$query = "DELETE FROM " . $db_prefix . "debug WHERE error_id = " . $msg['error_id'];
dbquery($query);
}
}
}
}
if ($filter === "") {
$query = "SELECT * FROM " . $db_prefix . "debug ORDER BY date DESC, error_id DESC LIMIT " . $message_limit;
} else {
$query = "SELECT * FROM " . $db_prefix . "debug WHERE text LIKE '%" . $filter . "%' ORDER BY date DESC, error_id DESC LIMIT " . $message_limit;
}
$result = dbquery($query);
?>
<?php
echo AdminPanel();
?>
<table class='header'><tr class='header'><td><table width="519">
<form action="index.php?page=admin&session=<?php
echo $session;
?>
&mode=Debug" method="POST">
<tr><td colspan="4" class="c">Сообщения</td></tr>
<tr><th>Действие</th><th>Дата</th><th>От</th><th>Браузер</th></tr>
<?php
$rows = dbrows($result);
while ($rows--) {
$msg = dbarray($result);
$user = LoadUser($msg['owner_id']);
$from = "<a href=\"index.php?page=admin&session={$session}&mode=Users&player_id=" . $msg['owner_id'] . "\">" . $user['oname'] . "</a> [" . $msg['ip'] . "]";
$msg['text'] = str_replace("{PUBLIC_SESSION}", $session, $msg['text']);
echo "<tr><th><input type=\"checkbox\" name=\"delmes" . $msg['error_id'] . "\"/></th><th>" . date("m-d H:i:s", $msg['date']) . "</th><th>{$from} </th><th>" . $msg['agent'] . " </th></tr>\n";
echo "<tr><td class=\"b\"> </td><td class=\"b\" colspan=\"3\">" . $msg['text'] . "</td></tr>\n";
}
?>
<tr><td class="b"> </td><td class="b" colspan="3"></td></tr>
<tr><th colspan="4" style='padding:0px 105px;'></th></tr>
<tr>
<th colspan="4">
<select name="deletemessages">
<option value="deletemarked">Удалить выделенные сообщения</option>
<option value="deleteshown">Удалить показанные сообщения</option>
<option value="deleteall">Удалить все сообщения</option>
</select><input type="submit" value="ok" /></th></tr>
<tr><td colspan="4"><center> </center></td></tr>
<tr><th colspan="4">Фильтр отладочных сообщений: <input type=text name="filter" />
<input type=submit value="Показать"></th></tr>
</form>
</table>
<?php
}
示例12: Success
function Success($iUserID)
{
global $CFG, $dbConn;
// Get the information about the user that was just created.
$dbConn->query("SELECT * FROM citizen WHERE id={$iUserID}");
$aSQLResult = $dbConn->getresult(TRUE);
// Store the member information into the session.
LoadUser($aSQLResult);
// Delete any guest entries from the session table.
$dbConn->query("DELETE FROM guest WHERE id='" . session_id() . "'");
// Render the page.
Msg("<b>Thank you for registering.</b><br /><br /><span class=\"smaller\">You should be redirected to the forum index momentarily. Click <a href=\"index.php\">here</a><br />if you do not want to wait any longer or if you are not redirected.</span>", 'index.php');
}
示例13: Admin_Fleetlogs
//.........这里部分代码省略.........
?>
><?php
echo date("d.m.Y", $queue['start']);
?>
<br> <?php
echo date("H:i:s", $queue['start']);
?>
</th>
<th <?php
echo $style;
?>
><?php
echo date("d.m.Y", $queue['end']);
?>
<br> <?php
echo date("H:i:s", $queue['end']);
?>
</th>
<th <?php
echo $style;
?>
>
<?php
echo "<nobr>" . BuildDurationFormat($fleet_obj['flight_time']) . "</nobr><br>";
echo "<nobr>" . $fleet_obj['flight_time'] . " сек.</nobr>";
?>
</th>
<th <?php
echo $style;
?>
>
<?php
$planet = GetPlanet($fleet_obj['start_planet']);
$user = LoadUser($planet['owner_id']);
echo AdminPlanetName($planet) . " " . AdminPlanetCoord($planet) . " <br>";
echo AdminUserName($user);
?>
</th>
<th <?php
echo $style;
?>
>
<?php
$planet = GetPlanet($fleet_obj['target_planet']);
$user = LoadUser($planet['owner_id']);
echo AdminPlanetName($planet) . " " . AdminPlanetCoord($planet) . " <br>";
echo AdminUserName($user);
?>
</th>
<th <?php
echo $style;
?>
>
<?php
$fleetmap = array(202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215);
foreach ($fleetmap as $i => $gid) {
$amount = $fleet_obj["ship" . $gid];
if ($amount > 0) {
echo loca("NAME_{$gid}") . ":" . nicenum($amount) . " ";
}
}
?>
</th>
<th <?php
echo $style;
?>
示例14: LoadUser
$dbConn->query("UPDATE citizen SET lastactive={$CFG['globaltime']}, loggedin=1, lastlocation='{$strLastLocation}', lastrequest='{$strLastRequest}', ipaddress={$_SESSION['userip']} WHERE id={$_SESSION['userid']}");
}
} else {
// Does the user have our cookie?
if (isset($_COOKIE['activeuserid']) && isset($_COOKIE['activepassword'])) {
// Yes, save the data.
$iUserID = (int) $_COOKIE['activeuserid'];
$strPassword = $_COOKIE['activepassword'];
// Get the member information of the member whose user ID was specified.
$dbConn->query("SELECT * FROM citizen WHERE id={$iUserID} AND reghash IS NULL");
// Was the username of a real member?
if ($aSQLResult = $dbConn->getresult(TRUE)) {
// Yes, so do the passwords match?
if ($aSQLResult['passphrase'] == $strPassword) {
// Store the member information into the session.
LoadUser($aSQLResult);
// Load the permissions for this user.
$_SESSION['permissions'] = $aGroup[$_SESSION['usergroup']];
// Also update the user's lastactive, lastlocation, lastrequest, and ipaddress values in their profile.
if ($CFG['currentpage'] != 'avatar.php' && $CFG['currentpage'] != 'regimage.php' && $CFG['currentpage'] != 'style.php') {
$dbConn->query("UPDATE citizen SET lastactive={$CFG['globaltime']}, loggedin=1, lastlocation='{$strLastLocation}', lastrequest='{$strLastRequest}', ipaddress={$_SESSION['userip']} WHERE id={$_SESSION['userid']}");
}
}
}
}
// Are they still not logged in?
if (!$_SESSION['loggedin']) {
// No. Load the permissions for this guest.
$_SESSION['permissions'] = $aGroup[0];
// They're a guest, but have their session settings been set?
if (!$_SESSION['guest']) {
示例15: Admin_Queue
function Admin_Queue()
{
global $session;
global $db_prefix;
global $GlobalUser;
// Обработка POST-запросов.
$player_id = 0;
if (method() === "POST") {
if (key_exists("player", $_POST)) {
// Фильтр по имени игрока
$query = "SELECT * FROM " . $db_prefix . "users WHERE oname LIKE '" . $_POST['player'] . "%'";
$result = dbquery($query);
if (dbrows($result) > 0) {
$user = dbarray($result);
$player_id = $user['player_id'];
}
}
if (key_exists("order_end", $_POST) && $GlobalUser['admin'] >= 2) {
// Завершить задание
$id = intval($_POST['order_end']);
$now = time();
$query = "UPDATE " . $db_prefix . "queue SET end={$now} WHERE task_id={$id}";
dbquery($query);
}
if (key_exists("order_remove", $_POST) && $GlobalUser['admin'] >= 2) {
// Удалить задание
RemoveQueue(intval($_POST['order_remove']));
}
}
if ($player_id > 0) {
$query = "SELECT * FROM " . $db_prefix . "queue WHERE (type <> 'Fleet' AND type <> 'CommanderOff') AND owner_id={$player_id} ORDER BY end ASC, prio DESC";
} else {
$query = "SELECT * FROM " . $db_prefix . "queue WHERE (type <> 'Fleet' AND type <> 'CommanderOff') ORDER BY end ASC, prio DESC LIMIT 50";
}
$result = dbquery($query);
$now = time();
AdminPanel();
echo "<table>\n";
echo "<tr><td class=c>Время окончания</td><td class=c>Игрок</td><td class=c>Тип задания</td><td class=c>Описание</td><td class=c>Приоритет</td><td class=c>ID</td><td class=c>Управление</td></tr>\n";
$anz = $rows = dbrows($result);
$bxx = 1;
while ($rows--) {
$queue = dbarray($result);
$user = LoadUser($queue['owner_id']);
$pid = $user['player_id'];
echo "<tr><th> <table><tr><th><div id='bxx" . $bxx . "' title='" . ($queue['end'] - $now) . "' star='" . $queue['start'] . "'></th>";
echo "<tr><th>" . date("d.m.Y H:i:s", $queue['end']) . "</th></tr></table></th><th><a href=\"index.php?page=admin&session={$session}&mode=Users&player_id={$pid}\">" . $user['oname'] . "</a></th><th>" . $queue['type'] . "</th><th>" . QueueDesc($queue) . "</th><th>" . $queue['prio'] . "</th><th>" . $queue['task_id'] . "</th>\n";
?>
<th>
<form action="index.php?page=admin&session=<?php
echo $session;
?>
&mode=Queue" method="POST">
<input type="hidden" name="order_end" value="<?php
echo $queue['task_id'];
?>
" />
<input type="submit" value="Завершить" />
</form>
<form action="index.php?page=admin&session=<?php
echo $session;
?>
&mode=Queue" method="POST" style="border: 1px solid red">
<input type="hidden" name="order_remove" value="<?php
echo $queue['task_id'];
?>
" />
<input type="submit" value="Удалить" />
</form>
</th>
</tr>
<?php
$bxx++;
}
echo "<script language=javascript>anz={$anz};t();</script>\n";
echo "</table>\n";
$playername = "";
if ($player_id > 0) {
$user = LoadUser($player_id);
$playername = $user['name'];
}
?>
<br/>
<form action="index.php?page=admin&session=<?php
echo $session;
?>
&mode=Queue" method="POST">
Показать задания игрока : <input size=15 name="player" value="<?php
echo $playername;
?>
">
<input type="submit" value="Отправить">
</form>
<?php
}