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; +}