Файл: includes/service/forum10/addrazdel.php
Строк: 46
<?php
if ($status<2)
{
$sysmsg='<b>Недостаточно прав для создания разделов.</b><br/>';
include($rootpath_forum."main.php");
}
if ($addmsg!='')
{
$addtopic=$addtopic+0;
$addmsg=addslashes(stripslashes($addmsg));
# Если повтор сообщения
$q=mysql(DBName,"SELECT `l3` FROM `$table` WHERE `domain` = '$domain' AND `site` = '$site' AND `text` = '$addmsg' AND `l2` = 0 AND `l3` = 0 LIMIT 0, 1");
$s=mysql_num_rows($q)+0;
$sysmsg='<b>Раздел уже добавлен.</b><br/>';
if ($s>0) include($rootpath_forum."main.php");
@mysql(DBName,"UPDATE `$table` SET `l1` = `l1` + 1 WHERE `domain` = '$domain' AND `site` = '$site' AND `l1` > $addtopic");
@mysql(DBName,"INSERT INTO `$table` ( `domain`, `site`, `l1` , `l2` , `l3` , `status` , `login` , `time` , `text` ) VALUES ( '$domain', '$site', '".($addtopic+1)."', '0', '0', '0', '$login', '".time()."', '".$addmsg."')");
$sysmsg='<b>Раздел добавлен.</b><br/>'.mysql_error().'<br/>';
include($rootpath_forum."main.php");
}
print cyr2utf('<card id="forum" title="'.$title.'Форум">'.
'<p>'.
'Раздел:<br/>'.
'<input name="r" type="text" title="Раздел" value="" maxlength="20"/><br/>');
$q=mysql(DBName,"SELECT `l1` , `text` FROM `".$table."` WHERE `domain` = '$domain' AND `site` = '$site' AND `l2` = 0 AND `l3` = 0 ORDER BY `l1` ASC LIMIT 0, 29");
$s=mysql_num_rows($q);
print cyr2utf('Вставить после...<br/>'.
'<select name="pr" title="После..." value="0">'.
'<option value="0">в начало</option>');
for ($i=0;($i<$s);$i++)
{
$f=mysql_fetch_array($q);
$text=$f['text'];
$l1=$f['l1'];
$q1=@mysql(DBName,"SELECT `status` FROM `$table` WHERE `domain` = '$domain' AND `site` = '$site' AND `status` < 2 AND `l1` = $l1 AND `l2` != 0 AND `l3` = 0");
$countertopic=@mysql_num_rows($q1)+0;
$q1=@mysql(DBName,"SELECT `status` FROM `$table` WHERE `domain` = '$domain' AND `site` = '$site' AND `status` < 2 AND `l1` = $l1 AND `l2` != 0 AND `l3` != 0");
$countermsg=@mysql_num_rows($q1)+0;
print cyr2utf('<option value="'.$l1.'">...'.$text.'</option>');
}
print cyr2utf('</select><br/>'.
'<anchor>Добавить'.
'<go href="'.$forum.'?'.$user.'&a=ar&r='.$razdel.'&pt='.$paget.'&t='.$topic.'&pm=9999" method="post">'.
'<postfield name="at" value="$(pr)"/>'.
'<postfield name="am" value="$(r)"/>'.
'</go>'.
'</anchor><br/>'.
'<anchor>Назад<prev/></anchor>').
$endtext;
exit();
?>