Просмотр файла eforum25/search.php

Размер файла: 3.59Kb
  1. <?php
  2. include "config.php";
  3. include "incl/head.inc";?>
  4. <title><?php print $lang[32];?>...</title></head><body onload="document.y.src.focus()"><form name="y" action="search.php" method="get">
  5. <table align="center" width="95%"><tr><td><?php include "incl/cust-top.inc";?>
  6. <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td class="q">
  7. <table width="100%" border="0" cellspacing="1" cellpadding="<?php print $cellpadding;?>">
  8. <tr class="c"><td colspan="3"><table width="100%" cellpadding="1" cellspacing="0"><tr><td nowrap="nowrap"><span class="c"><a href="main.php" id="lnk" title="<?php print $lang[0];?>" style="color:#ffffff;text-decoration:none" onmouseover="start_impress();return true" onmouseout="stop_impress();return true" onclick="refresh(<?php print $f;?>);return false"><?php print $forum_name[$f];?></a></span></td>
  9. <td class="c" align="right" width="120"><input type="hidden" name="f" value="<?php print $f;?>" /><input size="20" type="text" name="src" class="ia" style="font-size:9px;width:120px" maxlength="30" value="" /></td><td width="18"><a href="#" onclick="document.y.submit();return false"><img src="pics/find.gif" border="0" width="15" height="15" alt="<?php print $lang[32];?>" title="<?php print $lang[32];?>" /></a></td></tr></table></td></tr>
  10. <?php
  11. if(isset($src)){
  12. $src=strtolower($src);
  13. $src=strip_tags($src);
  14. $src=trim($src);}
  15.  
  16. if(isset($src)&&strlen($src)>1){
  17. $i=0;$temp_array=array();$found_number=0;
  18. print "<tr class=\"z\"><td class=\"f\" width=\"20%\" nowrap=\"nowrap\">&nbsp;$lang[28]&nbsp;</td><td class=\"f\" width=\"70%\" nowrap=\"nowrap\">&nbsp;$lang[17]&nbsp;</td><td class=\"f\" width=\"10%\" nowrap=\"nowrap\">&nbsp;$lang[15]&nbsp;</td></tr>";
  19.  
  20. $handle=opendir($data);
  21. while($entry=readdir($handle)){
  22. if(is_file("$data/$entry")&&substr($entry,0,1)=='2'){
  23. $temp_array[$i]=$entry;$i++;}}
  24. closedir($handle);
  25. rsort($temp_array);
  26.  
  27. for($j=0;$j<count($temp_array);$j++){
  28. if($found_number>9){break;}
  29. $file="$data/$temp_array[$j]";
  30. $fs=open_file($file);
  31. $topic=explode("\n",$fs);
  32. for($i=0;$i<count($topic);$i++){
  33. if($found_number>9){break;}
  34.  
  35. $row=explode(":|:",$topic[$i]);
  36.  
  37. if(isset($row[2])&&isset($row[3])){
  38. $pic_number=explode(".gif",$row[2]);
  39. $pic_number=substr($pic_number[0], -1);
  40. if(!strstr($row[0],' ')){$row[0]=time_offset($row[0]);}
  41.  
  42. $search_in=str_replace("<br />","[br]",$row[3]);
  43. $search_in=strip_tags($search_in);
  44. $search_in=str_replace("[br]","<br />",$search_in);
  45. $search_in=strtolower($search_in);
  46. }else{$search_in='';}
  47.  
  48. if(stristr($search_in,$src)){$found_number++;
  49. $search_in=str_replace($src,"<span style=\"background-color:yellow;font-weight:bold\">$src</span>",$search_in);
  50. print "\n<tr class=\"$row_bg\"><td><b class=\"y\">$row[2]</b><br clear=\"all\" /><img src=\"pics/b$pic_number.gif\" $size_img[3] alt=\"\" hspace=\"1\" align=\"left\" /><b>$row[1]</b></td>";
  51. print "\n<td class=\"s\"><br />$search_in<a href=\"show.php?f=$f&amp;topic=$temp_array[$j]\"><img src=\"pics/t$pic_number.gif\" border=\"0\" $size_img[2] alt=\"$lang[29]\" align=\"right\" /></a></td><td class=\"s\" nowrap=\"nowrap\">$row[0]</td></tr>";
  52. switch_row_bg();}}}
  53.  
  54. if($found_number==0){$result=$lang[39];}
  55. elseif($found_number>9){$result=$lang[40];}
  56. else{$result='';}
  57.  
  58. print "\n<tr class=\"$row_bg\"><td class=\"r\" colspan=\"2\"><span class=\"y\">&nbsp;$result</span></td><td align=\"center\" class=\"r\"><a href=\"#\" onclick=\"self.scrollTo(0,0);return false\">$lang[30]</a></td></tr>";
  59. }?></table></td></tr></table>
  60. <?php $color_changing=0;include "incl/clrs.inc";?><br clear="all" />
  61. <?php include "incl/cust-bot.inc";?></td></tr></table></form></body></html>