another fixes

This commit is contained in:
Igor Barkov [iwork] 2019-01-18 14:25:27 +02:00
parent 6d7afa131c
commit 76bd11d0f4
3 changed files with 37 additions and 77 deletions

View File

@ -1,4 +1,4 @@
ыр<?php
<?php
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>

17
inf.php
View File

@ -77,32 +77,27 @@ if (!empty($user['realname'])) echo "Имя: " . $user['realname'] . "<br>";
<?php
# Секретыный раздел
$okld = 0;
$okdop = 0;
$showModeratorInfo = false;
# Если я любой паладин, и смотрю не админа, или я сам админ.
if ((((int)$own['align'] == 1) AND (!$user['admin'])) OR (!empty($own['admin']))) $okld = 1;
# Если я любой паладин выше 1.2, и смотрю не админа, или я сам админ.
if ((((int)$own['align'] == 1) AND (!$user['admin']) AND ($own['align'] > 1.2)) OR (!empty($own['admin']))) $okdop = 1;
if ((($own['align'] == 1) AND (!$user['admin'])) OR (!empty($own['admin']))) $showModeratorInfo = true;
if ($okld == 1) {
echo "<H4>Личное дело</H4>";
if ($showModeratorInfo == 1) {
$ld = db::c()->query('SELECT * FROM `lichka` WHERE `pers` = ?i ORDER BY `id` ASC', $user['id']);
$iplog = db::c()->query('SELECT idperslater FROM delo_multi WHERE idpersnow = ?i GROUP BY idperslater ASC', $user['id']);
echo "<H4>Личное дело</H4>";
while ($row_ld = $ld->fetch_assoc()) {
$dat = date("d.m.Y H:i", $row_ld['date']);
echo "<code>$dat {$row_ld['text']} </code><br />";
}
}
if ($okdop == 1) {
$iplog = db::c()->query('SELECT idperslater FROM delo_multi WHERE idpersnow = ?i GROUP BY idperslater ASC', $user['id']);
if ($iplog->getNumRows()) {
echo "<H4>Возможные мульты</H4>";
while ($row_iplog = $iplog->fetch_assoc()) echo nick::id($row_iplog['idperslater'])->full() . " ";
}
echo "<H4>Дополнительные сведения</H4>";
if (!empty($user['id'])) echo "ID: " . $user['id'] . "<br>";
if (!empty($user['email'])) echo "E-mail: " . $user['email'] . "<br>";
if (!empty($user['borndate'])) echo "День рождения: " . $user['borndate'] . "<br>";

View File

@ -2,11 +2,9 @@
ob_start("ob_gzhandler");
session_start();
$errkom = '';
if (!isset($_SESSION['uid'])) {
header("Location: index.php");
}
include("config.php");
include("functions.php");
if (!isset($_SESSION['uid'])) header("Location: index.php");
require_once 'functions.php';
$tmaz = time();
db::c()->query('UPDATE `online` SET `real_time` = ?i WHERE `id` = ?i', time(), $user['id']);
if ($user['battle'] != 0) {
@ -37,7 +35,7 @@ function sum_bron($u)
function bron_ads($a1, $a2, $a3, $a4, $col)
{
return array('a1' => round(($a1 / 100) * $col), 'a2' => round(($a2 / 100) * $col), 'a3' => round(($a3 / 100) * $col), 'a4' => round(($a4 / 100) * $col));
return ['a1' => round(($a1 / 100) * $col), 'a2' => round(($a2 / 100) * $col), 'a3' => round(($a3 / 100) * $col), 'a4' => round(($a4 / 100) * $col)];
}
@ -152,7 +150,7 @@ function countmf()
$bmfbron = 0;
}
$mf = array();
$mf = [];
$user_dress = db::c()->query('SELECT SUM(`minu`), SUM(`maxu`), SUM(`mfkrit`), SUM(`mfakrit`), SUM(`mfuvorot`), SUM(`mfauvorot`), SUM(`bron1`), SUM(`bron2`), SUM(`bron3`), SUM(`bron4`) FROM `inventory` WHERE `dressed` = 1 AND `owner` = ?i', $user['id'])->fetch_row();
$user_dress[6] = $bmfbron;
@ -171,7 +169,7 @@ function countmf()
$myuvorot = $user_dress[4] + ($user['lovk'] * 5);
$myauvorot = $user_dress[5] + ($user['lovk'] * 4);
$mf['me'] = array('udar' => (floor($user['sila'] / 3) + 1 + $user_dress[0]), 'maxudar' => (floor($user['sila'] / 3) + 4 + $user_dress[1]));
$mf['me'] = ['udar' => (floor($user['sila'] / 3) + 1 + $user_dress[0]), 'maxudar' => (floor($user['sila'] / 3) + 4 + $user_dress[1])];
if ($mf['me']['udar'] < 0) {
$mf['me']['udar'] = 0;
@ -193,7 +191,7 @@ function countmf()
break;
}
return array('minu' => $mf['me']['udar'] + $bmfud + $weap_b, 'maxu' => $mf['me']['maxudar'] + $bmfud + $weap_b, 'fkrit' => round($mykrit, 0), 'fakrit' => round($myakrit, 0), 'fuvorot' => round($myuvorot, 0), 'fauvorot' => round($myauvorot, 0), 'bron1' => $user_dress[6], 'bron2' => $user_dress[7], 'bron3' => $user_dress[8], 'bron4' => $user_dress[9]);
return ['minu' => $mf['me']['udar'] + $bmfud + $weap_b, 'maxu' => $mf['me']['maxudar'] + $bmfud + $weap_b, 'fkrit' => round($mykrit, 0), 'fakrit' => round($myakrit, 0), 'fuvorot' => round($myuvorot, 0), 'fauvorot' => round($myauvorot, 0), 'bron1' => $user_dress[6], 'bron2' => $user_dress[7], 'bron3' => $user_dress[8], 'bron4' => $user_dress[9]];
}
// одеть предмет
@ -247,54 +245,29 @@ function dressitem($id)
}
if ($item['type'] == 5) {
if (!$user['r1']) {
$slot1 = 'r1';
} elseif (!$user['r2']) {
$slot1 = 'r2';
} elseif (!$user['r3']) {
$slot1 = 'r3';
} else {
if (!$user['r1']) $slot1 = 'r1';
elseif (!$user['r2']) $slot1 = 'r2';
elseif (!$user['r3']) $slot1 = 'r3';
else {
$slot1 = 'r1';
dropitem(5);
}
} elseif ($item['type'] == 12) {
if (!$user['m1']) {
$slot1 = 'm1';
} elseif (!$user['m2']) {
$slot1 = 'm2';
} elseif (!$user['m3']) {
$slot1 = 'm3';
} elseif (!$user['m4']) {
$slot1 = 'm4';
} elseif (!$user['m5']) {
$slot1 = 'm5';
} elseif (!$user['m6']) {
$slot1 = 'm6';
} elseif (!$user['m7']) {
$slot1 = 'm7';
} elseif (!$user['m8']) {
$slot1 = 'm8';
} elseif (!$user['m9']) {
$slot1 = 'm9';
} elseif (!$user['m10']) {
$slot1 = 'm10';
} else {
if (!$user['m1']) $slot1 = 'm1';
elseif (!$user['m2']) $slot1 = 'm2';
elseif (!$user['m3']) $slot1 = 'm3';
elseif (!$user['m4']) $slot1 = 'm4';
elseif (!$user['m5']) $slot1 = 'm5';
elseif (!$user['m6']) $slot1 = 'm6';
elseif (!$user['m7']) $slot1 = 'm7';
elseif (!$user['m8']) $slot1 = 'm8';
elseif (!$user['m9']) $slot1 = 'm9';
elseif (!$user['m10']) $slot1 = 'm10';
else {
$slot1 = 'm1';
dropitem(12);
}
} else {
dropitem($item['type']);
}
$al = '(1 = 1)';
if ($item['nalign'] > 0) {
if ($item['nalign'] == 1.1) {
if (($user['align'] == 6 || ($user['align'] > 1 && $user['align'] < 2))) {
$al = '(1 = 1)';
} else {
$al = '(1 = 2)';
}
}
}
} else dropitem($item['type']);
if (!($item['type'] == 12 && $user['level'] < 4)) {
if (db::c()->query('UPDATE `users` AS `u`, `inventory` AS `i` SET `u`.?f = ?i, `i`.`dressed` = 1, `u`.`sila` = `u`.`sila` + `i`.`gsila`, `u`.`lovk` = `u`.`lovk` + `i`.`glovk`, `u`.`inta` = `u`.`inta` + `i`.`ginta`, `u`.`intel` = `u`.`intel` + `i`.`gintel`, `u`.`maxhp` = `u`.`maxhp` + `i`.`ghp`, `u`.`noj` = `u`.`noj` + `i`.`gnoj`, `u`.`topor` = `u`.`topor` + `i`.`gtopor`, `u`.`dubina` = `u`.`dubina` + `i`.`gdubina`, `u`.`mec` = `u`.`mec` + `i`.`gmech`, `u`.`mfire` = `u`.`mfire` + `i`.`gfire`, `u`.`mwater` = `u`.`mwater` + `i`.`gwater`, `u`.`mair` = `u`.`mair` + `i`.`gair`, `u`.`mearth` = `u`.`mearth` + `i`.`gearth`, `u`.`mlight` = `u`.`mlight` + `i`.`glight`, `u`.`mgray` = `u`.`mgray` + `i`.`ggray`, `u`.`mdark` = `u`.`mdark` + `i`.`gdark`, `u`.`ubron1` = `u`.`ubron1` + `i`.`bron1`, `u`.`ubron2` = `u`.`ubron2` + `i`.`bron2`, `u`.`ubron3` = `u`.`ubron3` + `i`.`bron3`, `u`.`ubron4` = `u`.`ubron4` + `i`.`bron4`, `u`.`fkrit` = `u`.`fkrit` + `i`.`mfkrit`, `u`.`fakrit` = `u`.`fakrit` + `i`.`mfakrit`, `u`.`fuvorot` = `u`.`fuvorot` + `i`.`mfuvorot`, `u`.`fauvorot` = `u`.`fauvorot` + `i`.`mfauvorot`, `u`.`uminu` = `u`.`uminu` + `i`.`minu`, `u`.`umaxu` = `u`.`umaxu` + `i`.`maxu` WHERE `i`.`needident` = 0 AND `i`.`id` = ?i AND `i`.`dressed` = 0 AND `i`.owner = ?i AND (20 + `u`.`sila`) >= `i`.`nsila` AND (20 + `u`.`lovk`) >= `i`.`nlovk` AND (20 + `u`.`inta`) >= `i`.`ninta` AND `u`.`vinos` >= `i`.`nvinos` AND (20 + `u`.`intel`) >= `i`.`nintel` AND `u`.`mudra` >= `i`.`nmudra` AND `u`.`level` >= `i`.`nlevel` AND (("?s" OR (?i = `i`.`nalign`)) OR (`i`.`nalign` = 0)) AND `u`.`noj` >= `i`.`nnoj` AND `u`.`topor` >= `i`.`ntopor` AND `u`.`dubina` >= `i`.`ndubina` AND `u`.`mec` >= `i`.`nmech` AND `u`.`mfire` >= `i`.`nfire` AND `u`.`mwater` >= `i`.`nwater` AND `u`.`mair` >= `i`.`nair` AND `u`.`mearth` >= `i`.`nearth` AND `u`.`mlight` >= `i`.`nlight` AND `u`.`mgray` >= `i`.`ngray` AND `u`.`mdark` >= `i`.`ndark` AND `i`.`setsale` = 0 AND `u`.`id` = ?i', $slot1, $id, $id, $user['id'], $al, $user['align'], $user['id']))
@ -305,6 +278,7 @@ function dressitem($id)
/**
* Отображение персонажа в main.php
*
* @param $id
*/
function showpersinv($id)
@ -324,18 +298,9 @@ function showpersinv($id)
}
?>
<CENTER>
<img src="i/align_<?= ($user['align'] > 0 ? $user['align'] : "0") ?>.gif">
<img src="i/klan/<?= ClanImage($user['klan']) ?>.gif">
<B><?= $user['login'] ?></B> [<?= $user['level'] ?>]
<a href=inf.php?<?= $user['login'] ?> target=_blank><IMG SRC=i/inf.gif ALT="Инф. о <?= $user['login'] ?>"></a>
<?php nick::id($_SESSION['uid']); ?>
<?= showProgressBar($user['hp'], $user['maxhp']); ?>
<TABLE cellspacing=0 cellpadding=0>
<tr>
<TD colspan=3 width=100%>
<?= setHP($user['hp'], $user['maxhp'], 1); ?>
</td>
</tr>
<?
if ($user['level'] > 3) { ?>
<TR>
@ -1588,7 +1553,7 @@ if (input::get('edit')) {
} else err('Ошибка: запрещённые символы!');
}
if (!in_array(input::get('mZeAjax'), array('mZeInventory', 'mZeFilter'))): ?>
if (!in_array(input::get('mZeAjax'), ['mZeInventory', 'mZeFilter'])): ?>
<HTML>
<HEAD>
<meta charset="utf-8">
@ -1789,7 +1754,7 @@ if (input::get('edit')) {
$add_bron = sum_bron($user['id']);
$var_brons = bron_ads($mf['bron1'], $mf['bron2'], $mf['bron3'], $mf['bron4'], $add_bron);
} else {
$var_brons = array('a1' => 0, 'a2' => 0, 'a3' => 0, 'a4' => 0);
$var_brons = ['a1' => 0, 'a2' => 0, 'a3' => 0, 'a4' => 0];
}
?>
@ -2241,7 +2206,7 @@ if (input::get('edit')) {
</td>
</tr>
</table>
<?php if (!in_array(input::get('mZeAjax'), array('mZeInventory', 'mZeFilter'))): ?>
<?php if (!in_array(input::get('mZeAjax'), ['mZeInventory', 'mZeFilter'])): ?>
</div>
</td>
</form>