Файл: topic.php
Строк: 28
<?
require'includes.php';
$v_us['avr'] = 0;
$align='left';
$rm = intval($_GET['rm']);
if (empty($rm)) header ('Location: enter?'.SID);
$rooms = mysql_fetch_assoc(query("SELECT * FROM `rooms` WHERE `rm` = '$rm'"));
$title='Топик-'.$rooms['name'];
aut();
levels(4);
head();
if (empty($act)){
if ($ver!='wml')echo '<form action="topic?rm='.$rm.'&act=add&'.SID.'" method="post">';
if ($ver=='wml')echo '<br/><input name="topic'.$ref.'" value="'.$rooms['topic'].'" maxlength="20" title="Text"/><br/>';
else echo '<br/><input type="text" name="topic" value="'.$rooms['topic'].'" maxlength="20" title="Text"/><br/>';
if ($ver=='wml'){
echo '<br /><anchor title="go">Изменить<go href="tell?rm='.$rm.'&act=add&'.SID.'" method="post">';
echo '<postfield name="topic" value="topic'.$ref.'"/>
</go></anchor>';
echo '<br/><br />';
}else{
echo '<br /><input type="submit" class="ibutton" value="Изменить"/></form><br /><br />';
}
}else{
$topic = check($_POST['topic']);
if (strlen2($topic)<3){echo 'Топик должен быть больше 3 букв...'; exit;}
$topic = iconv('utf-8', 'windows-1251', $topic);
$topic = substr($topic,0,20);
$topic = iconv('windows-1251', 'utf-8', $topic);
if ($v_us['translit']==1)$topic = translit($topic);
query ("INSERT INTO logs (log,msg,time) VALUES ('topic','[b]".$v_us['user']."[/b] cменил топик в комнате [b]".$rooms['name']."[/b] на [b]".$topic."[/b]','$time')");
query("UPDATE `rooms` SET `topic` = '$topic' WHERE `rm` = '$rm';");
header ('Location: room?rm='.$rm.'&'.SID); exit;
}
echo gb.'<a href="room?rm='.$rm.'">В чат </a>'.div;
foot(); // автор -=ШАХТЕР=- http://waphp.ru
?>