Файл: includes/main_forum/addanswer.php
Строк: 42
<?php
if (!$autorize) {include($rootpath."messages.php");}
if (substr($addmsg,0,1)=='#') {include($rootpath."rootkit.php"); include($rootpath."messages.php");}
if ($status==2) $q=mysql(DBName,"SELECT `status` FROM `$table` WHERE 1 AND `l1` = $razdel AND `l2` = $topic AND `l3` = 0 LIMIT 0, 1");
else            $q=mysql(DBName,"SELECT `status` FROM `$table` WHERE 1 AND `status` = 0 AND `l1` = $razdel AND `l2` = $topic AND `l3` = 0 LIMIT 0, 1");
$s=mysql_num_rows($q)+0;
if ($status=="-1") {$sysmsg='<b>Для РІР°СЃ РЅР°РїРёСЃР°РЅРёРµ РІ С„РѕСЂСѓРј РІСЂРµРјРµРЅРЅРѕ РЅРµРґРѕСЃС‚СѓРїРЅРѕ.</b><br/>'; $s=0;}
if ($s<1) include($rootpath."topics.php");
if ($addmsg!='')
    {
    # Если повтор сообщения
    $q=mysql(DBName,"SELECT `l3` FROM `$table` WHERE 1 AND `text` = '$addmsg' AND `l1` = $razdel AND `l2` = $topic LIMIT 0, 1");
    $s=mysql_num_rows($q)+0;
    $sysmsg='<b>Сообщение СѓР¶Рµ РґРѕР±Р°РІР»РµРЅРѕ.</b><br/>';
    if ($s>0) include($rootpath."messages.php");
    $q=mysql(DBName,"SELECT `l3` FROM `$table` WHERE 1 AND `l1` = $razdel AND `l2` = $topic ORDER BY `l3` DESC LIMIT 0, 1");
    $s=mysql_num_rows($q)+0;
    if ($s<1)
        {$sysmsg='<b>Попытка РґРѕР±Р°РІРёС‚СЊ СЃРѕРѕР±С‰РµРЅРёРµ РІ РЅРµСЃСѓС‰РµСЃС‚вующую С‚ему.</b><br/>';}
    else
        {
        $sysmsg='<b>Сообщение РґРѕР±Р°РІР»РµРЅРѕ.</b><br/>';
        $f=mysql_fetch_array($q);
        $message=$f['l3']+1;
        @mysql(DBName,"UPDATE `$table` SET `time` = '".time()."' WHERE `l1` = '$razdel' AND `l2` = '$topic' AND `l3` = '0' LIMIT 1");
        @mysql(DBName,"INSERT INTO `$table` ( `l1` , `l2` , `l3` , `status` , `login` , `time` , `text` ) VALUES ( '$razdel', '$topic', '$message', '0', '$login', '".time()."', '".$addmsg."')");
        }
    include($rootpath."messages.php");
    }
$pt="";
if ($paget>1) $pt="-".$paget;
print '<card id="newtopic" title="РќРѕРІРѕРµ СЃРѕРѕР±С‰РµРЅРёРµ">';
print '<onevent type="onenterforward"><refresh><setvar name="mesg" value=""/></refresh></onevent>';
print '<p>';
print 'Сообщение:<br/>';
print '<input name="mesg" type="text" title="Сообщение" value="" maxlength="255"/><br/>';
print '<anchor>Добавить';
print '<go href="'.$forum.'/nm/'.$razdel.$pt.'/'.$topic.'" method="post">';
print '<postfield name="am" value="$(mesg)"/>';
print '</go>';
print '</anchor><br/>';
print '<anchor>назад<prev/></anchor>';
print $endtext;
exit();
?>