PHP/MySQL | Пересчет параметров
[hljs class="php"]<?php
include 'system/func.php';
auth();
if ($id && $id !== $myID)
$profile = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '" . $id . "'")); else $profile = $user;
if (!$profile) {
header('Location: /home.php?' . $r);
exit;
}
if($profile['access'] == 2)$admin = '<font color="red">[р]</font>';
if($profile['access'] == 1)$admin = '<font color="#7fff00">[m]</font>';
if($profile['access'] == 0)$admin = '';
if (isset($_GET['user_clan']) and $myID != $profile['id'] and $user['clan_rang'] > 2 and $profile['id_clan'] == 0 and $profile['side'] == $user['side'] and $profile['stor'] == $user['stor']) {
$clan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '" . $user['id_clan'] . "' LIMIT 1"));
$k_post = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `id_clan` = '$clan[id]'"), 0);
if ($k_post >= $clan['user_clan']) {
$_SESSION['msg'] = "<div class='text center'><font color='tomato'>Ошибка. Клан переполнен</font></div>";
header('Location: /hero/' . $profile['id'] . '?' . $r);
exit;
}
//space
mysql_query("INSERT INTO `clan_memb` SET `id_user` = '$profile[id]', `id_clan` = '$clan[id]'");
$_SESSION['msg'] = "<div class='text center'><font color='lime'>Приглашение отправлено!</font></div>";
header('Location: ?' . $rand);
exit();
}
$title = 'Профиль';
include 'system/header.php';
//титул
if($profile['str_train'] >= 0 && $profile['str_train'] <= 9){
$titul = 'Пришедший';
}elseif($profile['str_train'] >= 10 && $profile['str_train'] <= 19){
$titul = 'Опытный воин';
}elseif($profile['str_train'] >= 20 && $profile['str_train'] <= 29){
$titul = 'Мастер';
}elseif($profile['str_train'] >= 25 && $profile['str_train'] <= 29){
$titul = 'Повелитель';
}elseif($profile['str_train'] >= 30){
$titul = 'Герой';
}
//
if ($profile['liga'] == 0)
$liga = 'новичков';
elseif ($profile['liga'] == 1)
$liga = 'бойцов';
elseif ($profile['liga'] == 2)
$liga = 'сильнейших';
elseif ($profile['liga'] == 3)
$liga = 'чемпионов';
elseif ($profile['liga'] == 4)
$liga = 'легенд';
elseif ($profile['liga'] == 5)
$liga = 'всемогущих';
elseif ($profile['liga'] == 6)
$liga = 'богов';
if ($user['save'] <= 1)
header("Location: /home.php?error");
if ($user['access'] == 2)
echo "<a href='/mahaker/mahaker_panel.php?sett_user=$profile[id]' class='but'>Редактировать игрока</a>";
if ($user['access'] >= 1 && $myID != $profile['id']) {
echo '<div class="text_p1 center">';
if ($user['access'] > $profile['access'])
echo "<a href='/ip/$profile[id]' class='center'>Проверить IP</a> | ";
if ($user['access'] > $profile['access'])
echo " <a href='/ban/$profile[id]/' class='center'>Забанить</a>";
if ($user['access'] > $profile['access'])
if ($user['access'] == 2 && $myID != $profile['id'])
echo "<br/><a href='/block/$profile[id]/' class='center'>Блок игрока</a>";
echo '</div>';
}
echo '<div class="de center"><img src="/icons/' . $profile['sex'] . '.png" alt> ' . $profile['login'] . ' '.$admin.', ' . $profile['level'] . ' уровень.<br> <b>Сторона: ';
if($profile['stor'] == 1)echo '<img src="/icons/fractiya/1.png" alt><b>Земля';
if($profile['stor'] == 2)echo '<img src="/icons/fractiya/2.png" alt><b>
Внешний мир';
echo '</b></div><div class="text center">';
$clan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '" . $profile['id_clan'] . "' LIMIT 1"));
switch ($profile['clan_rang']) {
case 1:
$clan_rang = 'Новичок';
break;
case 2:
$clan_rang = 'Боец';
break;
case 3:
$clan_rang = 'Офицер';
break;
case 4:
$clan_rang = 'Генерал';
break;
case 5:
$clan_rang = "Лидер";
break;
}
if ($clan)
echo "<img src='/icons/adven.png' alt> <a href='/clan/index.php?id=$clan[id]'><font color='lime'>$clan[name]</font></a> - $clan_rang<br/>";
$ban = mysql_fetch_array(mysql_query('SELECT * FROM `ban` WHERE `id_user` = "' . $profile['id'] . '" AND `last` > "' . time() . '" ORDER BY `id` DESC LIMIT 1'));
if ($ban)
echo '<font color="tomato">' . ($ban['block'] == 1 ? nick($ban['id_admin']) . ': ' . $ban['text'] : 'Игрок забанен') . '</font> [' . tl($ban['last'] - time()) . ']<br/>';
if (mb_strlen($profile['statys_text']) >= 1)
echo ($myID == $profile['id'] ? '<img src="/icons/statys.png" alt=""> <a href="/statys.php">' . text_msg($profile['statys_text']) . '</a>' : '<img src="/icons/statys.png" alt=""> ' . text_msg($profile['statys_text'])) . '<br/>'; elseif ($myID == $profile['id'])
echo '<img src="/icons/statys.png" alt> <a href="/statys.php">Написать статус</a><br/>';
echo '<center><br /><img height="240px" style="border-radius: 60px; -webkit-border-radius: 60px; -moz-border-radius: 60px;" src="/ava/' . $profile['ava'] . '"><br /></center>';
#include 'my_inc/hero_avatar.php';
echo '</div>';
echo '<div class="center"><a href="/complect.php?id=' . $profile['id'] . '">' . $title . '</a> </div>';
if ($profile['run_1'] >= 1)
echo '<img src="/icons/item/complect_' . $profile['run_1'] . '.png" alt> ';
if ($profile['run_2'] >= 1)
echo '<img src="/icons/item
________
посл. ред. 25.07.2020 в 17:37; всего 1 раз(а); by yarukqwe
include 'system/func.php';
auth();
if ($id && $id !== $myID)
$profile = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '" . $id . "'")); else $profile = $user;
if (!$profile) {
header('Location: /home.php?' . $r);
exit;
}
if($profile['access'] == 2)$admin = '<font color="red">[р]</font>';
if($profile['access'] == 1)$admin = '<font color="#7fff00">[m]</font>';
if($profile['access'] == 0)$admin = '';
if (isset($_GET['user_clan']) and $myID != $profile['id'] and $user['clan_rang'] > 2 and $profile['id_clan'] == 0 and $profile['side'] == $user['side'] and $profile['stor'] == $user['stor']) {
$clan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '" . $user['id_clan'] . "' LIMIT 1"));
$k_post = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `id_clan` = '$clan[id]'"), 0);
if ($k_post >= $clan['user_clan']) {
$_SESSION['msg'] = "<div class='text center'><font color='tomato'>Ошибка. Клан переполнен</font></div>";
header('Location: /hero/' . $profile['id'] . '?' . $r);
exit;
}
//space
mysql_query("INSERT INTO `clan_memb` SET `id_user` = '$profile[id]', `id_clan` = '$clan[id]'");
$_SESSION['msg'] = "<div class='text center'><font color='lime'>Приглашение отправлено!</font></div>";
header('Location: ?' . $rand);
exit();
}
$title = 'Профиль';
include 'system/header.php';
//титул
if($profile['str_train'] >= 0 && $profile['str_train'] <= 9){
$titul = 'Пришедший';
}elseif($profile['str_train'] >= 10 && $profile['str_train'] <= 19){
$titul = 'Опытный воин';
}elseif($profile['str_train'] >= 20 && $profile['str_train'] <= 29){
$titul = 'Мастер';
}elseif($profile['str_train'] >= 25 && $profile['str_train'] <= 29){
$titul = 'Повелитель';
}elseif($profile['str_train'] >= 30){
$titul = 'Герой';
}
//
if ($profile['liga'] == 0)
$liga = 'новичков';
elseif ($profile['liga'] == 1)
$liga = 'бойцов';
elseif ($profile['liga'] == 2)
$liga = 'сильнейших';
elseif ($profile['liga'] == 3)
$liga = 'чемпионов';
elseif ($profile['liga'] == 4)
$liga = 'легенд';
elseif ($profile['liga'] == 5)
$liga = 'всемогущих';
elseif ($profile['liga'] == 6)
$liga = 'богов';
if ($user['save'] <= 1)
header("Location: /home.php?error");
if ($user['access'] == 2)
echo "<a href='/mahaker/mahaker_panel.php?sett_user=$profile[id]' class='but'>Редактировать игрока</a>";
if ($user['access'] >= 1 && $myID != $profile['id']) {
echo '<div class="text_p1 center">';
if ($user['access'] > $profile['access'])
echo "<a href='/ip/$profile[id]' class='center'>Проверить IP</a> | ";
if ($user['access'] > $profile['access'])
echo " <a href='/ban/$profile[id]/' class='center'>Забанить</a>";
if ($user['access'] > $profile['access'])
if ($user['access'] == 2 && $myID != $profile['id'])
echo "<br/><a href='/block/$profile[id]/' class='center'>Блок игрока</a>";
echo '</div>';
}
echo '<div class="de center"><img src="/icons/' . $profile['sex'] . '.png" alt> ' . $profile['login'] . ' '.$admin.', ' . $profile['level'] . ' уровень.<br> <b>Сторона: ';
if($profile['stor'] == 1)echo '<img src="/icons/fractiya/1.png" alt><b>Земля';
if($profile['stor'] == 2)echo '<img src="/icons/fractiya/2.png" alt><b>
Внешний мир';
echo '</b></div><div class="text center">';
$clan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '" . $profile['id_clan'] . "' LIMIT 1"));
switch ($profile['clan_rang']) {
case 1:
$clan_rang = 'Новичок';
break;
case 2:
$clan_rang = 'Боец';
break;
case 3:
$clan_rang = 'Офицер';
break;
case 4:
$clan_rang = 'Генерал';
break;
case 5:
$clan_rang = "Лидер";
break;
}
if ($clan)
echo "<img src='/icons/adven.png' alt> <a href='/clan/index.php?id=$clan[id]'><font color='lime'>$clan[name]</font></a> - $clan_rang<br/>";
$ban = mysql_fetch_array(mysql_query('SELECT * FROM `ban` WHERE `id_user` = "' . $profile['id'] . '" AND `last` > "' . time() . '" ORDER BY `id` DESC LIMIT 1'));
if ($ban)
echo '<font color="tomato">' . ($ban['block'] == 1 ? nick($ban['id_admin']) . ': ' . $ban['text'] : 'Игрок забанен') . '</font> [' . tl($ban['last'] - time()) . ']<br/>';
if (mb_strlen($profile['statys_text']) >= 1)
echo ($myID == $profile['id'] ? '<img src="/icons/statys.png" alt=""> <a href="/statys.php">' . text_msg($profile['statys_text']) . '</a>' : '<img src="/icons/statys.png" alt=""> ' . text_msg($profile['statys_text'])) . '<br/>'; elseif ($myID == $profile['id'])
echo '<img src="/icons/statys.png" alt> <a href="/statys.php">Написать статус</a><br/>';
echo '<center><br /><img height="240px" style="border-radius: 60px; -webkit-border-radius: 60px; -moz-border-radius: 60px;" src="/ava/' . $profile['ava'] . '"><br /></center>';
#include 'my_inc/hero_avatar.php';
echo '</div>';
echo '<div class="center"><a href="/complect.php?id=' . $profile['id'] . '">' . $title . '</a> </div>';
if ($profile['run_1'] >= 1)
echo '<img src="/icons/item/complect_' . $profile['run_1'] . '.png" alt> ';
if ($profile['run_2'] >= 1)
echo '<img src="/icons/item
________
посл. ред. 25.07.2020 в 17:37; всего 1 раз(а); by yarukqwe
Кто вас мат накуреных за комп пускает
Скрип писать нужно, и все.
DELETED
30 августа 2020, в 9:46
Delete
Стр.: 1, 2