From e4c551b9a2ebb121c0896e2bc56fc4f96325b00a Mon Sep 17 00:00:00 2001 From: "Igor Barkov [iwork]" Date: Tue, 11 Dec 2018 12:58:32 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D0=B0=D1=8F=20=D1=83=D0=BD=D0=B8=D0=B2=D0=B5=D1=80=D1=81=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D0=B0=D1=8F=20=D1=84=D1=83=D0=BD=D0=BA=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B8=20=D0=B2=20?= =?UTF-8?q?=D0=9B=D0=94.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 5a134d1..4bf7056 100644 --- a/functions.php +++ b/functions.php @@ -2399,7 +2399,6 @@ function usemagic($id) } if (($all_magic[$user['id']] < 1) || ($charge == '0')) - if ((($user['sila'] >= $row['nsila']) && ($user['lovk'] >= $row['nlovk']) && ($user['inta'] >= $row['ninta']) && @@ -2842,4 +2841,19 @@ function SolveExp($at_id, $def_id, $damage) $result = $result / 3; $result = round($result, 0); return $result; -} \ No newline at end of file +} + +/** + * Функция записи в личное дело. + * + * @param string $message - текст записи. + * @param int $user_id - ID пользователя которому добавляется запись. + * @param int $type - тип записи: (1)обычная, (2)модераторская. + * @return bool + * @throws \Krugozor\Database\Mysql\Exception + */ +function addToDelo($message, $user_id = 0, $type = 1) { + if (empty($user_id)) $user_id = $_SESSION['uid']; + db::c()->query('INSERT INTO `delo` (pers, text, type, date) VALUES (?i,"?s",?i,?i)',$user_id,$message,$type,time()); + return true; +}