This commit is contained in:
lopar 2018-03-23 22:36:35 +02:00
parent 845857d3cf
commit 6fac7d9304
2 changed files with 79 additions and 198 deletions

239
main.php
View File

@ -14,11 +14,6 @@ if ($user['battle'] != 0) {
die();
}
//if($user['klan']) {
// $shadow = mysql_fetch_array(mysql_query("SELECT `id`, `mshadow`, `wshadow` FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1"));
//}
function updstats()
{
global $user;
@ -65,121 +60,24 @@ if ($_GET['unstack']) {
unstack((int)$_GET['unstack'], (int)$_POST["qty"]);
}
if (isset($_GET['obraz']) && $_GET['obraz'] !== null && ($user['shadow'] == 'g0.gif' || $user['shadow'] == 'man0.gif' || $shadow['mshadow'] || $shadow['wshadow'])) {
if ($user['sex']) {
switch ($_GET['obraz']) {
case 0:
mysql_query("UPDATE `users` SET `shadow` = 'man0.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 1:
mysql_query("UPDATE `users` SET `shadow` = 'man1.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 2:
mysql_query("UPDATE `users` SET `shadow` = 'man2.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 3:
mysql_query("UPDATE `users` SET `shadow` = 'man3.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 4:
mysql_query("UPDATE `users` SET `shadow` = 'man4.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 5:
mysql_query("UPDATE `users` SET `shadow` = 'man5.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 6:
mysql_query("UPDATE `users` SET `shadow` = 'man6.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 7:
mysql_query("UPDATE `users` SET `shadow` = 'man7.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 8:
mysql_query("UPDATE `users` SET `shadow` = 'man8.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 9:
mysql_query("UPDATE `users` SET `shadow` = 'man9.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 10:
mysql_query("UPDATE `users` SET `shadow` = 'man10.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 11:
mysql_query("UPDATE `users` SET `shadow` = 'man11.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 12:
mysql_query("UPDATE `users` SET `shadow` = 'man12.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 13:
mysql_query("UPDATE `users` SET `shadow` = 'man13.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 14:
mysql_query("UPDATE `users` SET `shadow` = 'man14.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 40:
mysql_query("UPDATE `users` SET `shadow` = '{$shadow['mshadow']}' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
}
} else {
switch ($_GET['obraz']) {
case 0:
mysql_query("UPDATE `users` SET `shadow` = 'g0.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 1:
mysql_query("UPDATE `users` SET `shadow` = 'g1.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 2:
mysql_query("UPDATE `users` SET `shadow` = 'g2.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 3:
mysql_query("UPDATE `users` SET `shadow` = 'g3.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 4:
mysql_query("UPDATE `users` SET `shadow` = 'g4.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 5:
mysql_query("UPDATE `users` SET `shadow` = 'g5.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 6:
mysql_query("UPDATE `users` SET `shadow` = 'g6.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 7:
mysql_query("UPDATE `users` SET `shadow` = 'g7.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 8:
mysql_query("UPDATE `users` SET `shadow` = 'g8.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 9:
mysql_query("UPDATE `users` SET `shadow` = 'g9.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 10:
mysql_query("UPDATE `users` SET `shadow` = 'g10.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 11:
mysql_query("UPDATE `users` SET `shadow` = 'g11.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 12:
mysql_query("UPDATE `users` SET `shadow` = 'g12.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 13:
mysql_query("UPDATE `users` SET `shadow` = 'g13.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 14:
mysql_query("UPDATE `users` SET `shadow` = 'g14.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 15:
mysql_query("UPDATE `users` SET `shadow` = 'g15.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 16:
mysql_query("UPDATE `users` SET `shadow` = 'g16.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 17:
mysql_query("UPDATE `users` SET `shadow` = 'g17.gif' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
case 41:
mysql_query("UPDATE `users` SET `shadow` = '{$shadow['wshadow']}' WHERE `id` = '{$user['id']}' LIMIT 1");
break;
}
}
function setShadow($image)
{
global $user;
$shadows = [
'm01','m02','m03','m04','m05','m06','m07','m08','m09','m10',
'f01','f02','f03','f04','f05','f06','f07','f08','f09','f10',
'person'
];
if (in_array($image,$shadows)) {
$i = $image . '.png';
db::c()->query('UPDATE `users` SET `shadow` = "?s" WHERE `id` = ?i', $i, $user['id']);
} else err('Ошибка!');
}
$obraz = filter_input(INPUT_GET,'obraz');
if ($obraz && ($user['shadow'] == 'g0.gif' || $user['shadow'] == 'man0.gif')) {
setShadow($obraz);
}
if ($_GET['del'] == 1) {
if ($_GET['efid'] > 0) {
@ -1164,36 +1062,50 @@ if ($_GET['setch']) {
header("Cache-Control: no-cache");
if ($_GET['edit']) {
function ups($type, $stat, $statName)
{
global $user;
if ($user[$type] > 0 && $user['sid'] == $_GET['s4i']) {
if ($user[$type] >= (int)$_POST['stat'] && (int)$_POST['stat'] > 0) {
$user[$stat] += (int)$_POST['stat'];
$user[$type] -= (int)$_POST['stat'];
db::c()->query('UPDATE `users` SET ?f = ?i, ?f = ?i WHERE `id` = ?i', $stat, $user[$stat], $type, $user[$type], $user['id']);
err('Параметр '.$statName.' увеличен на '.(int)$_POST['stat'].' ед.');
} else err('Ошибка в количестве.');
}
}
if ($_GET['ups']) {
switch ($_GET['ups']) {
case 11 :
if ($user['stats'] > 0 && $user['sid'] == $_GET['s4i']) {
if ($user['stats'] >= (int)$_POST['stat'] && ((int)$_POST['stat'] > 0)) {
$user['sila'] += (int)$_POST['stat'];
$user['stats'] -= (int)$_POST['stat'];
mysql_query("UPDATE `users` SET `sila` = '" . $user['sila'] . "', `stats` = '" . $user['stats'] . "' WHERE `id` = '{$user['id']}' LIMIT 1");
echo "<b style=\"color: Red;\">Параметр Сила увеличен на " . (int)$_POST['stat'] . " ед.</b>";
} elseif ((int)$_POST['stat'] <= 0) {
echo "<b style=\"color: Red;\">Не верное количество</b>";
} else {
echo "<b style=\"color: Red;\">Недостаточно статов</b>";
}
}
ups('stats','sila','Сила');
// if ($user['stats'] > 0 && $user['sid'] == $_GET['s4i']) {
// if ($user['stats'] >= (int)$_POST['stat'] && ((int)$_POST['stat'] > 0)) {
// $user['sila'] += (int)$_POST['stat'];
// $user['stats'] -= (int)$_POST['stat'];
// mysql_query("UPDATE `users` SET `sila` = '" . $user['sila'] . "', `stats` = '" . $user['stats'] . "' WHERE `id` = '{$user['id']}' LIMIT 1");
// echo "<b style=\"color: Red;\">Параметр Сила увеличен на " . (int)$_POST['stat'] . " ед.</b>";
// } elseif ((int)$_POST['stat'] <= 0) {
// echo "<b style=\"color: Red;\">Не верное количество</b>";
// } else {
// echo "<b style=\"color: Red;\">Недостаточно статов</b>";
// }
// }
break;
case 12 :
if ($user['stats'] > 0 && $user['sid'] == $_GET['s4i']) {
if ($user['stats'] >= (int)$_POST['stat'] && ((int)$_POST['stat'] > 0)) {
$user['lovk'] += (int)$_POST['stat'];
$user['stats'] -= (int)$_POST['stat'];
mysql_query("UPDATE `users` SET `lovk` = '" . $user['lovk'] . "', `stats` = '" . $user['stats'] . "' WHERE `id` = '{$user['id']}' LIMIT 1");
echo "<b style=\"color: Red;\">Параметр Ловкость увеличен на " . (int)$_POST['stat'] . " ед.</b>";
} elseif ((int)$_POST['stat'] <= 0) {
echo "<b style=\"color: Red;\">Не верное количество</b>";
} else {
echo "<b style=\"color: Red;\">Недостаточно статов</b>";
}
}
ups('stats','lovk','Ловкость');
// if ($user['stats'] > 0 && $user['sid'] == $_GET['s4i']) {
// if ($user['stats'] >= (int)$_POST['stat'] && ((int)$_POST['stat'] > 0)) {
// $user['lovk'] += (int)$_POST['stat'];
// $user['stats'] -= (int)$_POST['stat'];
// mysql_query("UPDATE `users` SET `lovk` = '" . $user['lovk'] . "', `stats` = '" . $user['stats'] . "' WHERE `id` = '{$user['id']}' LIMIT 1");
// echo "<b style=\"color: Red;\">Параметр Ловкость увеличен на " . (int)$_POST['stat'] . " ед.</b>";
// } elseif ((int)$_POST['stat'] <= 0) {
// echo "<b style=\"color: Red;\">Не верное количество</b>";
// } else {
// echo "<b style=\"color: Red;\">Недостаточно статов</b>";
// }
// }
break;
case 13 :
@ -1427,7 +1339,7 @@ if ($_GET['edit']) {
updstats();
}
if (@$_GET['dress']) {
if ($_GET['dress']) {
$rec = mysql_fetch_array(mysql_query('SELECT `id`, `koll` FROM `inventory` WHERE `id` = "' . (int)$_GET['dress'] . '" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if (isset($rec['id'])) {
if ($rec['koll'] > 1) {
@ -1442,7 +1354,7 @@ if ($_GET['edit']) {
}
}
if (@$_GET['destruct']) {
if ($_GET['destruct']) {
$dress = mysql_fetch_array(mysql_query("SELECT `id`, `dressed`, `name`, `duration`, `maxdur` FROM `inventory` WHERE `owner` = '{$user['id']}' AND `id` = '{$_GET['destruct']}' LIMIT 1"));
if (isset($dress['id'])) {
if ($dress['dressed'] == 0) {
@ -1457,7 +1369,7 @@ if ($_GET['edit']) {
}
}
if (@$_GET['use']) {
if ($_GET['use']) {
$rec = mysql_fetch_array(mysql_query('SELECT `id`, `koll` FROM `inventory` WHERE `id` = "' . (int)$_GET['use'] . '" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if (isset($rec['id'])) {
if ($rec['koll'] > 1) {
@ -1471,14 +1383,14 @@ if ($_GET['edit']) {
}
}
if (@$_GET['undress']) {
if ($_GET['undress']) {
undressall($user['id']);
updstats();
}
if (@$_GET['delcomplect']) {
if ($_GET['delcomplect']) {
mysql_query("DELETE FROM `komplekt` WHERE `name` = '" . $_GET['delcomplect'] . "' AND `owner` = '" . $user['id'] . "';");
}
if (@$_GET['complect']) {
if ($_GET['complect']) {
$hp = $user['hp'];
undressall($user['id']);
$_GET['complect'] = mysql_real_escape_string($_GET['complect']);
@ -1494,7 +1406,7 @@ if ($_GET['edit']) {
}
ref_drop($user['id']);
if (@$_GET['savecomplect']) {
if ($_GET['savecomplect']) {
$_GET['savecomplect'] = trim($_GET['savecomplect']);
if (preg_match('/[\/\:*?"<>|+%]/', $_GET['savecomplect'])) {
echo "<b style=\"color: Red;\">Вы используете запрещенные символы ...</b>";
@ -1730,7 +1642,6 @@ if ($_GET['edit']) {
<table border=0>
<tr>
<td>
<script>DrawBar('Параметры', 'param', <?if ($_SESSION['param'] == 1) {
echo "1";
} else {
@ -1738,7 +1649,7 @@ if ($_GET['edit']) {
}?>, '', '');</script>
<?
if (@$_SESSION['param'] == 1) {
if ($_SESSION['param'] == 1) {
?>
<!--href='?up=11&edit=1&s4i=".($user['sid'])."'-->
Сила: <?= $user['sila'] ?><?= ($user['stats']) ? " <img src=i/up.gif onclick=\"stats('Увеличить Силу', '', 1, '', '', '', '?ups=11&edit=1&s4i=" . ($user['sid']) . "');\">" : "" ?>
@ -1774,7 +1685,7 @@ if ($_GET['edit']) {
}?>, '', '');</script>
<?
if (@$_SESSION['modif'] == 1) {
if ($_SESSION['modif'] == 1) {
$item_mf = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `owner` = "' . $user['id'] . '" AND `dressed` = "1" AND `add_proc_mf` > 0'));
$item_damage = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `owner` = "' . $user['id'] . '" AND `dressed` = "1" AND `add_proc_uron` > 0'));
$item_bron = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `owner` = "' . $user['id'] . '" AND `dressed` = "1" AND `add_proc_bron` > 0'));
@ -1835,7 +1746,7 @@ if ($_GET['edit']) {
}?>, '', '');</script>
<?
if (@$_SESSION['oryj'] == 1) {
if ($_SESSION['oryj'] == 1) {
?>
<div class="container" bit=1>
@ -1881,7 +1792,7 @@ if ($_GET['edit']) {
echo "6";
}?>, '', '');</script>
<? if (@$_SESSION['bron'] == 1) { ?>
<? if ($_SESSION['bron'] == 1) { ?>
Броня головы: <?= $mf['bron1'] + $var_brons['a1'] ?><? if (isset($item_bron['id'])) {
echo '<span style=\'color: Green;\'>(' . $add_bron . '%)</span>';
} ?><BR>
@ -1907,7 +1818,7 @@ if ($_GET['edit']) {
<?
if (@$_SESSION['bonus'] == 1) {
if ($_SESSION['bonus'] == 1) {
if ($user['sila'] >= 25) {
@ -1952,8 +1863,6 @@ if ($_GET['edit']) {
$sila['uminu'] = 15;
$sila['umaxu'] = 15;
}
if ($user['lovk'] >= 25) {
$lovk['fuvorot'] = 10;
$lovk['fauvorot'] = 10;
@ -2004,8 +1913,6 @@ if ($_GET['edit']) {
$lovk['uminu'] = 15;
$lovk['umaxu'] = 15;
}
if ($user['inta'] >= 25) {
$inta['fkrit'] = 10;
$inta['fauvorot'] = 10;
@ -2054,8 +1961,6 @@ if ($_GET['edit']) {
$inta['uminu'] = 15;
$inta['umaxu'] = 15;
}
if ($user['vinos'] >= 25) {
$vinos['fkrit'] = 10;
$vinos['fauvorot'] = 10;
@ -2104,37 +2009,30 @@ if ($_GET['edit']) {
$vinos['uminu'] = 15;
$vinos['umaxu'] = 15;
}
if ($user['vinos'] >= $user['sila'] && $user['vinos'] >= $user['lovk'] && $user['vinos'] >= $user['inta']) {
$i_uminu = $vinos['uminu'];
$i_fkrit = $vinos['fkrit'];
$i_fauvorot = $vinos['fauvorot'];
$i_fakrit = $vinos['fakrit'];
}
if ($user['inta'] >= $user['sila'] && $user['inta'] >= $user['lovk'] && $user['inta'] >= $user['vinos']) {
$i_uminu = $inta['uminu'];
$i_fkrit = $inta['fkrit'];
$i_fauvorot = $inta['fauvorot'];
$i_fakrit = $inta['fakrit'];
}
if ($user['lovk'] >= $user['sila'] && $user['lovk'] >= $user['inta'] && $user['lovk'] >= $user['vinos']) {
$i_uminu = $lovk['uminu'];
$i_fkrit = $lovk['fkrit'];
$i_fauvorot = $lovk['fauvorot'];
$i_fakrit = $lovk['fakrit'];
}
if ($user['sila'] >= $user['lovk'] && $user['sila'] >= $user['inta'] && $user['sila'] >= $user['vinos']) {
$i_uminu = $sila['uminu'];
$i_fkrit = $sila['fkrit'];
$i_fauvorot = $sila['fauvorot'];
$i_fakrit = $sila['fakrit'];
}
if ($i_fkrit > 0) {
echo "Мф. крит: +" . $i_fkrit . "<br />";
}
@ -2147,12 +2045,9 @@ if ($_GET['edit']) {
if ($i_uminu > 0) {
echo "Урон: +" . $i_uminu;
}
}
}
?>
</td>
</tr>
</table>

View File

@ -13,44 +13,30 @@
margin: 0 auto;
overflow: auto;
}
ul {
list-style-type: none;
}
li img {
float: right;
margin: 5px;
a img {
border: 1px solid #fff;
-webkit-transition: box-shadow 0.5s ease;
-moz-transition: box-shadow 0.5s ease;
-o-transition: box-shadow 0.5s ease;
transition: box-shadow 0.5s ease;
}
li img:hover {
a img:hover {
-webkit-box-shadow: 0 0 7px rgba(255,255,255,0.9);
box-shadow: 0 0 7px rgba(255,255,255,0.9);
}
</style>
</HEAD>
<body>
<div>
<ul>
<li><a href="/user_anketa.php" title="Анкета" target="main"><img src="http://placehold.it/32x32" /></a></li>
<li><a href="/friend.php" title="Друзья" target="main"><img src="http://placehold.it/32x32" /></a></li>
<li><a href="/main.php?edit=1" title="Инвентарь" target="main"><img src="http://placehold.it/32x32" /></a></li>
<li><a href="/relikt.php?edit=1" title="Реликты" target="main"><img src="http://placehold.it/32x32" /></a></li>
<li><a href="/give.php" title="Передачи" target="main"><img src="http://placehold.it/32x32/ff3333" /></a></li>
<li><a href="/klan.php" title="Клан" target="main"><img src="http://placehold.it/32x32/ff33ff" /></a></li>
<li><a href="/orden.php" title="Особые умения" target="main"><img src="http://placehold.it/32x32/33ff33" /></a></li>
<li><a href="/moderators.php" title="Модераторы" target="main"><img src="http://placehold.it/32x32/33ff33" /></a></li>
<li><a href="/forum.php" title="Форум" target="main"><img src="http://placehold.it/32x32" /></a></li>
<li><a href="/forum.php" title="Форум" target="main"><img src="http://placehold.it/32x32/ff0000" /></a></li>
</ul>
<div style="text-align: right;">
<a href="/user_anketa.php" title="Анкета" target="main"><img src="http://placehold.it/32x32/33ff33?text=A"/></a>
<a href="/friend.php" title="Друзья" target="main"><img src="http://placehold.it/32x32/33ff33?text=F"/></a>
<a href="/main.php?edit=1" title="Инвентарь" target="main"><img src="http://placehold.it/32x32/33ff33?text=I"/></a>
<a href="/relikt.php?edit=1" title="Реликты" target="main"><img src="http://placehold.it/32x32?text=R"/></a>
<a href="/give.php" title="Передачи" target="main"><img src="http://placehold.it/32x32/ff3333?text=G"/></a>
<a href="/klan.php" title="Клан" target="main"><img src="http://placehold.it/32x32/33ff33?text=K"/></a>
<a href="/orden.php" title="Особые умения" target="main"><img src="http://placehold.it/32x32/33ff33?text=O"/></a>
<a href="/moderators.php" title="Модераторы" target="main"><img src="http://placehold.it/32x32/33ff33?text=M"/></a>
<a href="/forum.php" title="Форум" target="main"><img src="http://placehold.it/32x32?text=F"/></a>
</div>
</body>
</html>