Просмотр файла forum/inc/search_form.php

Размер файла: 1.09Kb
  1. <?
  2. echo "<form method='post' action='?newsearch=$passgen'>\n";
  3.  
  4. echo "Текст:<br />\n<input type='text' name='text' value='".htmlentities($searched['text'], ENT_QUOTES, 'UTF-8')."' /><br />\n";
  5.  
  6. echo "Место поиска:<br />\n<select name='in'>\n";
  7. echo "<option value=''>Везде</option>\n";
  8. $q = mysql_query("SELECT `id`,`name` FROM `forum_f`".((!isset($user) || $user['level']==0)?" WHERE `adm` = '0'":null)." ORDER BY `pos` ASC");
  9. while ($forums = mysql_fetch_assoc($q)){
  10. echo "<option value='f$forums[id]'".(($searched['in']['m']=='f' && $searched['in']['id']==$forums['id'])?" selected='selected'":null).">&gt;&gt; $forums[name]</option>\n";
  11. $q2 = mysql_query("SELECT `id`,`name` FROM `forum_r` WHERE `id_forum` = '$forums[id]' ORDER BY `time` DESC");
  12. while ($razdels = mysql_fetch_assoc($q2)){
  13. echo "<option value='r$razdels[id]'".(($searched['in']['m']=='r' && $searched['in']['id']==$razdels['id'])?" selected='selected'":null).">&gt; $razdels[name]</option>\n";}}
  14. echo "</select><br />\n";
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21. echo "<input type='submit' value='Начать поиск' /><br />\n";
  22. echo "</form>\n";
  23. ?>