battles/magic/note.php

24 lines
872 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?
use Battles\GameLogs;
use Battles\Nick;
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
if ($user['battle']==0) {
echo'Нельзя использовать вне боя';
}
$_POST['target']=htmlspecialchars($_POST['target'], NULL, "");
if(preg_match("/__/",$_POST['target']) || preg_match("/--/",$_POST['target']))
{
echo"В тексте не должно присутствовать подряд более 1 символа '_' или '-'.";
}else{
$mess = $_POST['target'];
if ($user['sex'] == 1) {$action="выкрикнул";} else {$action="выкрикнула";}
GameLogs::addBattleLog($user['battle'],'<span class=sysdate>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' '.$action.': '.$mess.'<BR>');
}