Файл: forum/inc/search_form.php
Строк: 29
<?
echo "<form method='post' action='?newsearch=$passgen'>";
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/img/search.png'> <b>Текст:</b><br />";
echo "<input type='text' name='text' value='".htmlentities($searched['text'], ENT_QUOTES, 'UTF-8')."' /><br />";
echo "</div>";
echo "<div class='forum_tema'>";
echo "<img src='/s-klub/img/search.png'> <b>Место поиска:</b><br />";
echo "<select name='in'>";
echo "<option value=''>Везде</option>";
$q=mysql_query("SELECT `id`,`name` FROM `forum_f`".((!isset($user) || $user['level']==0)?" WHERE `adm` = '0'":null)." ORDER BY `pos` ASC");
while ($forums=mysql_fetch_assoc($q))
{
echo "<option value='f$forums[id]'".(($searched['in']['m']=='f' && $searched['in']['id']==$forums['id'])?" selected='selected'":null).">>> ".$forums['name']."</option>";
$q2=mysql_query("SELECT `id`,`name` FROM `forum_r` WHERE `id_forum` = '$forums[id]' ORDER BY `time` DESC");
while ($razdels=mysql_fetch_assoc($q2))
{
echo "<option value='r$razdels[id]'".(($searched['in']['m']=='r' && $searched['in']['id']==$razdels['id'])?" selected='selected'":null).">> ".$razdels['name']."</option>";
}
}
echo "</select><br />";
echo "</div>";
echo "<div class='forum_tema'>";
echo "<input type='submit' value='Начать поиск' /><br />";
echo "</div>";
echo "</form>";
?>