if($registr==1) { if(ereg($words[$j],$text)) {$ok2=1; $ok3[$j]=1;} else {$ok3[$j]=0;} } else {if(eregi($words[$j],$text)) {$ok2=1; $ok3[$j]=1;} else {$ok3[$j]=0;}}
if($logik==1||$logik==2) {$words=explode(' ',$words);} print($words[0].'*'.$words[1]); if($razdels=='all') // поиск по всем форумам { $base2=mysql_connect($my_sql_server2,$my_sql_user2,$my_sql_pas2); mysql_select_db($my_sql_base_name2, $base2); for($y=1;$y<=count($forum_conf);$y++) { $print_zagolovok=0; $prd=mysql_query("SELECT * FROM `a_".$forum_conf[$y][2]."`"); $num_thems=mysql_num_rows($prd); if($num_thems>0) { $prd=mysql_query("SELECT * FROM `a_".$forum_conf[$y][2]."`"); while($them=mysql_fetch_array($prd)) { if($where_find==2||$where_find==3) { $prd=mysql_query("SELECT * FROM `".$forum_conf[$y][2]."_".$them['id']."`"); $t=1; while($posts[$t]=mysql_fetch_array($prd)) {$t++;} } if($where_find==1) {$text=$them['name'];} if($where_find==2) {$text=''; for($o=1;$o<=count($posts);$o++) {$text.=$posts[$o]['text'];}} if($where_find==3) {$text=$them['name']; for($o=1;$o<=count($posts);$o++) {$text.=$posts[$o]['text'];}} if($logik==1||$logik==2) // логика поиска: и / или { $ok2=0;unset($ok3); for($j=0;$j<=count($words);$j++) { if($registr==1) { if(ereg($words[$j],$text)) {$ok2=1; $ok3[$j]=1;} else {$ok3[$j]=0;} } else {if(eregi($words[$j],$text)) {$ok2=1; $ok3[$j]=1;} else {$ok3[$j]=0;}} } $ok=1; for($p=0;$p<=count($ok3);$p++) {if($ok3[$p]==0) $ok=0;} } if($logik==3) // логика поиска: вся фраза { $ok4=0; if($registr==1) { if(stristr($text,$words)!='') {$ok4=1;} } else {if(strstr($text,$words)!='') {$ok4=1;}}print($words."^"); } if($ok==1||$ok2==1||$ok4==1) // вывод найденного результата { if($print_zagolovok==0) {print("<table cellpadding=2 cellspacing=0 width='95%' class=ind_table><tr><td width=100% colspan=3 class=ind_table_zagolovok> ".$forum_conf[$y][3]."</td></tr>");$print_zagolovok=1;} $prd=mysql_query("SELECT * FROM `".$forum_conf[$y][2]."_".$them['id']."`"); $post_num=mysql_num_rows($prd); $page_2c=0; $pages=''; while($post_num>0) { $page_2c++; $post_num-=$posts_in_one_page; if($page_2c==2) {$pages="[ <a href=fewforum.php?go=".$go."&them=".$tl[$i]['id']."&page=1>1</a>";} if($page_2c>1) {$pages.=" <a href=fewforum.php?go=".$go."&them=".$tl[$i]['id']."&page=".$page_2c.">".$page_2c."</a>";} } if($pages!='') {$pages.=" ]";} $w='ind_table_';$style_td="bgcolor='#F8F8F8'"; $style_td_1="bgcolor='#FEE7CF'"; $style_td_2="bgcolor='#F9F5F2'"; print("<tr><td width='4%' class=".$w."1 height=30 $style_td_1><center> </center></td><td width='58%' class=".$w."1 $style_td><font size=2> <a href=fewforum.php?go=".$forum_conf[$y][2]."&them=".$them['id']."&page=1>".$them['name']."</a></font> ".$pages." <font color=gray>[ от <a href=dopfunk.php?go=user_info&to=".$them['user'].">".$them['user']."</a> ]</font></td><td width='30%' class=".$w."2 $style_td> <a href=fewforum.php?go=".$forum_conf[$y][2]."&them=".$them['id']."&page=".$page_2c."#down>".$t_n."</a></td></tr>"); } } print("</table><br>"); } } }