From cda265c799d82f59ffc482d4f30dff99a69f9550 Mon Sep 17 00:00:00 2001 From: Ivor Barhansky Date: Fri, 8 Dec 2023 17:55:27 +0200 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B3=D0=B8=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BF=D0=B5=D1=80=D1=81=D0=BE=D0=BD?= =?UTF-8?q?=D0=B0=D0=B6=D0=B5=D0=B9=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD=D0=B8?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=BE=D0=B2=20=D0=B2?= =?UTF-8?q?=20=D0=BE=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20?= =?UTF-8?q?=D0=BA=D0=BB=D0=B0=D1=81=D1=81.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../class/Moderation/UserRegistrationList.php | 85 +++++++++++++------ modules_data/_mod.php | 58 +------------ 2 files changed, 63 insertions(+), 80 deletions(-) diff --git a/_incl_data/class/Moderation/UserRegistrationList.php b/_incl_data/class/Moderation/UserRegistrationList.php index 06db0bff..65452cea 100644 --- a/_incl_data/class/Moderation/UserRegistrationList.php +++ b/_incl_data/class/Moderation/UserRegistrationList.php @@ -3,34 +3,71 @@ namespace Moderation; use Core\Db; -use DateTime; -use DateTimeImmutable; use User; class UserRegistrationList { - public function get(DateTime $date) + /** : . + * @return void + */ + public static function get(): void { - $from = $date->getTimestamp(); - $to = $date->modify('+ 1 day')->getTimestamp(); - $list = Db::getRows("select id, banned, molch1, battle, host_reg, online from users where timereg between ? and ? and bot_id = 0 and bithday != '01.01.1800' order by id", [$from, $to]); - - $str = ''; - - foreach ($list as $user) { - $time = new DateTime(); - $loginColor = 'black'; - if ($user['banned']) { - $loginColor = 'red'; - } - if ($user['online'] > $time->modify('- 10 minutes')->getTimestamp()) { - $loginColor = 'green'; - } - if ($user['molch1'] > 0) { - $molch1Duration = new DateTimeImmutable($user['molch1']); - - } - $str .= "
  • " . User::getLogin($user['id'] . ""); + $query = "select users.id, host_reg, banned, battle, online, molch1 + from users left join stats on users.id = stats.id + where bithday != '01.01.1800' and bot = 0 and timereg between ? and ? order by users.id"; + $pld520 = date('d.m.Y'); + if (isset($_POST['loginLD520'])) { + $pld520 = $_POST['loginLD520']; } + $pld520TS = strtotime(str_replace(".", "-", $pld520)); + $pld520 = date('d.m.Y', $pld520TS); + ?> + + +
    +

    + + + + + + +
    +
      + 0 => 'red', + $pl['online'] > time() - 520 => 'green', + default => 'black', + }; + ?> + +
    1. + + time()): ?> + () + + 0): ?> + ( ) + + 0): ?> + ( ) + +
    2. + +
    + +
    + info['admin'] > 0) { /** Мегафон только для администраторов. */ Announcement::init(); - /** Регистрации персонажей только для администраторов. */ - $pld520 = date('d.m.Y'); - if (isset($_POST['loginLD520'])) { - $pld520 = $_POST['loginLD520']; - } - $pld520TS = strtotime(str_replace(".", "-", $pld520)); - $pld520 = date('d.m.Y', $pld520TS); - ?> -
    -

    Регистрации персонажей

    - Дата регистрации - - - - - = ' . $pld520TS . ' AND `users`.`timereg` < ' . ($pld520TS + 86400) . ' ORDER BY `users`.`id` ASC' - ); - $i = 1; - echo '
    Персонажи зарегистрированные ' . $pld520 . ''; - while ($pl = mysql_fetch_array($sp)) { - $urt5202 = '
    ' . $i . '. ' . User::getLogin($pl['id']); - - if ($pl['banned'] > 0) { - $urt5202 = '' . $urt5202 . ''; - } elseif ($pl['online'] > time() - 520) { - $urt5202 = '' . $urt5202 . ''; - } - if ($pl['molch1'] > time()) { - $urt5202 .= ' '; - } - if ($pl['battle'] > 0) { - $urt5202 .= ' '; - } - if ($pl['host_reg'] > 0) { - $urt5202 .= '   (Реферал персонажа ' . User::getLogin($pl['host_reg']) . ')'; - } - $urt520 .= $urt5202; - $i++; - } - echo $urt520; - unset($urt520, $i, $pl, $sp); - } - ?> -
    - -