Файл: in4at/fsearch.php
Строк: 39
<?php
##################################################################################################
## Script name : In4at ##
## Version : Final ##
## Made by : XPYCT(Сергей Мищенко) ##
## E-mail : bce-ok@bk.ru ##
## ICQ : 447-50-50-62 ##
## Site : http://vkontakte.ru/id31604521 ##
## Внимание! Скрипт распространяется бесплатно! Модификация W4at by XPYCT ##
##################################################################################################
define('REQ_2_chat', true);
require('4at_set.php');
require('db_con.php');
require('style.php');
if ($py !== spy_code) require('us_info.php');
require('func.php');
switch($go) {
default:
echo head;
if ($vv!=0) echo '<div class="d0"><b>Поиск</b></div>';
else echo '<card id="search" title="Поиск"><p>';
if ($vv!=0) echo "<form action="fsearch.php?go=results&$wp" method="post">";
echo $fsize1;
echo 'Данные для поиска:<br/>';
echo $fsize2;
echo "<input name="mes$ref" title="mes"/><br/>";
echo $fsize1;
echo 'Транслит: ';
echo $fsize2;
echo "<select name="trun">";
echo "<option value="0">Нет</option>";
echo "<option value="1">Да</option>";
echo '</select><br/>';
echo $fsize1;
echo 'Искать:<br/>';
echo $fsize2;
echo "<select name="mode">";
echo "<option value="mes">В сообщениях</option>";
echo "<option value="tem">В темах</option>";
echo '</select><br/>';
if ($vv!=0){
echo "<input class="ibutton" type="submit" value="Искать"/></form>";
echo $fsize1;
} else {
echo $fsize1;
echo "<anchor title="go">Искать<go href="fsearch.php?go=results&$wp" method="post">";
echo "<postfield name="mes" value="$(mes$ref)"/>";
echo "<postfield name="mode" value="$(mode)"/>";
echo "<postfield name="trun" value="$(trun)"/>";
echo '</go></anchor><br/>';
}
break;
case 'results':
if($trun==1)$mes=trun_to_rus($mes);
$mes=check($mes);
$mes=trim($mes);
if($mes=="")$mes=0;
$mes = str_replace("_","",$mes);
echo head;
if ($vv!=0) echo '<div class="d0"><b>Поиск</b></div>';
else echo '<card id="search" title="Поиск"><p>';
echo $fsize1;
if ($mode=='mes') {
$select = mysql_query("select * from forum_m where mes LIKE '%$mes%'");
} elseif ($mode=='tem') {
$select = mysql_query("select * from forum_t where mes LIKE '%$mes%'");
} elseif ($mode=='us') {
$select = mysql_query("select * from forum_t where who=$mes");
}elseif ($mode=='us2') {
$select = mysql_query("select * from forum_m where who=$mes");
}elseif ($mode=='top') {
$select = mysql_query("select * from forum_t order by id desc limit 10");
}elseif ($mode=='top2') {
$select = mysql_query("select * from forum_m order by id desc limit 10");
}
if (mysql_affected_rows() == 0) {
echo 'Не найдено!<br/>';
} else {
echo 'Найдено:<br/>';
$a = mysql_fetch_array($select);
while ($a !== false){
if (($mode=='mes')||($mode=='us2')||($mode=='top2')){$mid=$a['tem'];
}else{ $mid=$a['id'];}
$us = mysql_query("select user from users WHERE id='".$a['who']."';");
$usn = mysql_fetch_array($us);
echo "<a href="forum.php?$wp&mod=mes&mid=".$mid."">".$a['mes']."</a><br/>[".$a['time'].", ".$a['data']."]|".$usn['user']."|<br/>";
$a = mysql_fetch_array($select);
}
}
break;
}
mysql_close ($link);
echo divide;
if($go)echo "<a href="fsearch.php?$wp">Искать еще</a><br/>";
echo "<a href="forum.php?$wp">Форум</a><br/>";
echo "<a href="enter.php?$wp">Прихожая</a>";
echo $fsize2;
echo foot;
?>