diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php
index 03d048a7..dc785992 100644
--- a/_incl_data/class/User.php
+++ b/_incl_data/class/User.php
@@ -1201,56 +1201,50 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
return $bus['login_BIG'];
}
- public function microLogin(int $id, $t, $nnz = 1): string
+ public function microLogin(int $id, int $t, int $nnz = 1): string
{
- if ($t == 1) {
- $inf = mysql_fetch_array(
- mysql_query(
- 'SELECT
- `u`.`id`,
- `u`.`align`,`u`.`align2`,
- `u`.`login`,
- `u`.`clan`,
- `u`.`level`,
- `u`.`city`,
- `u`.`online`,
- `u`.`sex`,`u`.`autospell`,`u`.`noplaw`,
- `u`.`cityreg`,
- `u`.`palpro`,
- `u`.`invis`,
- `st`.`hpNow` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="' . mysql_real_escape_string(
- $id
- ) . '" OR `u`.`login` = "' . mysql_real_escape_string((int)$id) . '" LIMIT 1'
- )
- );
- } else {
+ if ($t !== 1) {
$inf['id'] = $id;
+ } else {
+ $inf = Db::getRow(
+ 'select
+ users.id,
+ invis,
+ users.align,
+ align2,
+ clan,
+ cityreg,
+ login,
+ users.level,
+ c.name_mini
+ from users left join clan as c on c.id = users.clan
+ where users.id = ?',
+ [$id]
+ );
}
$r = '';
- if (isset($inf['id']) && (($inf['invis'] < time(
- ) && $inf['invis'] != 1) || ($this->info['id'] == $inf['id'] && $nnz == 1))) {
+ if (
+ isset($inf['id']) &&
+ (
+ ($inf['invis'] < time() && $inf['invis'] !== 1) ||
+ ($this->info['id'] == $inf['id'] && $nnz === 1)
+ )
+ ) {
if ($inf['align'] > 0) {
- $r .= '';
+ $r .= '';
}
if ($inf['align2'] > 0) {
- $r .= '';
+ $r .= '';
}
- if ($inf['clan'] > 0) {
- $cln = mysql_fetch_array(
- mysql_query(
- 'SELECT `id`,`name`,`name_mini`,`align`,`type_m`,`money1`,`exp` FROM `clan` WHERE `id` = "' . $inf['clan'] . '" LIMIT 1'
- )
- );
- if (isset($cln['id'])) {
- $r .= '';
- }
+ if ($inf['name_mini']) {
+ $r .= '';
}
if ($inf['cityreg'] == '') {
$inf['cityreg'] = 'capitalcity';
}
- $r .= ' ' . $inf['login'] . ' [' . $inf['level'] . ']';
+ $r .= '' . $inf['login'] . ' [' . $inf['level'] . ']';
} else {
- $r = 'Невидимка [??]';
+ $r = 'Невидимка [??]';
}
return $r;
}