diff --git a/_incl_data/class/Model/ActionModel.php b/_incl_data/class/Model/ActionModel.php
index 4445a55a..3682eb84 100644
--- a/_incl_data/class/Model/ActionModel.php
+++ b/_incl_data/class/Model/ActionModel.php
@@ -40,12 +40,16 @@ class ActionModel
Db::sql('delete from actions where uid = ? and vals = ?', [$this->uid, $vals]);
}
- public static function new(array $user, string $vals, string $vars)
+ public static function new(array $user, string $vals, string $vars, int $time = 0)
{
+ if (!$time) {
+ $time = time();
+ }
Db::sql(
- 'insert into actions (uid, time, city, room, vars, ip, vals, val) values (?,unix_timestamp(),?,?,?,?,?,?)',
+ 'insert into actions (uid, time, city, room, vars, ip, vals, val) values (?,?,?,?,?,?,?,?)',
[
$user['id'],
+ $time,
$user['city'],
$user['room'],
$vars,
@@ -56,8 +60,10 @@ class ActionModel
);
}
- public static function getAll(): array
+ public static function getAll(string $filter = ''): array
{
return Db::getRows('select * from actions');
}
+
+
}
\ No newline at end of file
diff --git a/_incl_data/class/User.php b/_incl_data/class/User.php
index 07a89de1..78c11091 100644
--- a/_incl_data/class/User.php
+++ b/_incl_data/class/User.php
@@ -4,6 +4,7 @@ use Core\Config;
use Core\ConversionHelper;
use Core\Database;
use Core\Db;
+use Model\ActionModel;
use User\ItemsModel;
class User
@@ -2257,18 +2258,12 @@ class User
public function addAction($time, $vars, $vls, $uid = null): bool
{
- if ($uid == null) {
- $uid = $this->info['id'];
+ $info = $this->info;
+ if ($uid) {
+ $info['id'] = $uid;
}
- $ins = mysql_query(
- 'INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("' . $uid . '","' . $time . '","' . $this->info['city'] . '","' . $this->info['room'] . '","' . mysql_real_escape_string(
- $vars
- ) . '","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '","' . mysql_real_escape_string(
- $vls
- ) . '")'
- );
-
- return (bool)$ins;
+ ActionModel::new($info, $vls, $vars, $time);
+ return true;
}
public function testAction($filter, $tp)
@@ -6958,11 +6953,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$pl['rep'] = 2;
}
}
- $is1 .= 'Выбрать';
+ $is1 .= 'Выбрать';
} elseif ($type == 14) {
- $is1 .= 'Выбрать';
+ $is1 .= 'Выбрать';
} elseif ($type == 12) {
- $is1 .= 'Выбрать';
+ $is1 .= 'Выбрать';
} elseif ($type == 10) {
//Общага (отображение предметов в общаге (под стеклом))
$is1 .= 'В рюкзак';
@@ -7164,7 +7159,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$inv1 = 'inv=1&';
}
if ($pl['item_id'] == 74) {
- $is1 .= 'исп-ть';
+ $is1 .= 'исп-ть';
} else {
$useUrl = '';
if ($pl['magic_inc'] == '') {
@@ -7192,7 +7187,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
}
if ($pl['max_text'] > 0 && $pl['max_text'] - $pl['use_text'] > 0) {
- $is1 .= 'Записать
';
+ $is1 .= 'Записать
';
}
if ($pl['type'] == 31 || $pl['type'] == 46 || $pl['type'] == 48 || $pl['type'] == 50 || $pl['type'] == 62 || $pl['type'] == 68 || $pl['type'] == 37 || $pl['type'] == 47) {
if ($d[2] == 1) {
@@ -8622,7 +8617,7 @@ LIMIT 1'
if ($i1 == 0 && $u['battle'] == 0) {
$rt[0] .= '';
+ ) - $u['regMP']) . ',' . (0 + $this->rgd[0]) . ',' . (0 + $this->rgd[1]) . ',1)';
}
if ($ivv == 0 && $i1 == 0) {
$rt[0] .= $this->info_remont();
diff --git a/buttons.php b/buttons.php
index 4b362678..008d723c 100644
--- a/buttons.php
+++ b/buttons.php
@@ -975,20 +975,20 @@ $u->stats = $u->getStats($u->info['id'], 0);
info['align'] >= 1 && $u->info['align'] < 2) { ?>
- - |
Абилки:
(Чтобы забрать предмет просто нажмите на его изображение)
- 'на сегодня',1 => ' всего');
- while($i < count($item_dark[$dark_panel])) {
- if($item_dark[$dark_panel][$i][1]>0) {
- $itm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$item_dark[$dark_panel][$i][0].'" LIMIT 1'));
- if(isset($itm['id'])) {
- $vix = 0;
- if($item_dark[$dark_panel][$i][4] == 0) {
- $vix = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time`>='.strtotime('now 00:00:00').' AND `vars` = "dark_itm'.$itm['id'].'"',2);
- $vix = $vix[0];
- }else{
- $vix = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time`>='.$vt['timeUse'].' AND `vars` = "dark_itm'.$itm['id'].'" ',2);
- $vix = $vix[0];
- }
- if($item_dark[$dark_panel][$i][1]-$vix > 0) {
- if(isset($_GET['take_item_dark_panel']) && $_GET['take_item_dark_panel'] == $itm['id']) {
- $nitm = \User\ItemsModel::addItem($itm['id'],$u->info['id'],$item_dark[$dark_panel][$i][5]);
- if($item_dark[$dark_panel][6]>0) {
- }
- $u->addAction(time(),'dark_itm'.$itm['id'],'');
- echo 'Предмет "'.$itm['name'].'" перемещен к Вам в инвентарь!
';
- }
- }
- $seet0 = '';
- //Вывод предметов
- $seet0 .= ' ';
- if($item_dark[$dark_panel][$i][1]-$vix > 0) {
- $seet0 = ''.$seet0.'';
- }else{
- $seet0 = ''.$seet0.'';
- }
- $seet .= $seet0;
- }
- }
- $i++;
- }
-}
- echo $seet;
- ?>
-
- - |
Абилки:
(Чтобы забрать предмет просто нажмите на его изображение)
- 'на сегодня',1 => ' всего');
- while($i < count($item_neytral[$neytral_panel])) {
- if($item_neytral[$neytral_panel][$i][1]>0) {
- $itm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$item_neytral[$neytral_panel][$i][0].'" LIMIT 1'));
- if(isset($itm['id'])) {
- $vix = 0;
- if($item_neytral[$neytral_panel][$i][4] == 0) {
- $vix = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time`>='.strtotime('now 00:00:00').' AND `vars` = "dark_itm'.$itm['id'].'"',2);
- $vix = $vix[0];
- }else{
- $vix = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time`>='.$vt['timeUse'].' AND `vars` = "dark_itm'.$itm['id'].'" ',2);
- $vix = $vix[0];
- }
- if($item_neytral[$neytral_panel][$i][1]-$vix > 0) {
- if(isset($_GET['take_item_neytral_panel']) && $_GET['take_item_neytral_panel'] == $itm['id']) {
- $nitm = \User\ItemsModel::addItem($itm['id'],$u->info['id'],$item_neytral[$neytral_panel][$i][5]);
- if($item_neytral[$neytral_panel][6]>0) {
- }
- $u->addAction(time(),'dark_itm'.$itm['id'],'');
- echo 'Предмет "'.$itm['name'].'" перемещен к Вам в инвентарь!
';
- }
- }
- $seet0 = '';
- //Вывод предметов
- $seet0 .= ' ';
- if($item_neytral[$neytral_panel][$i][1]-$vix > 0) {
- $seet0 = ''.$seet0.'';
- }else{
- $seet0 = ''.$seet0.'';
- }
- $seet .= $seet0;
- }
- }
- $i++;
- }
-}
- echo $seet;
- ?>
-