Размер файла: 2.88Kb
<?
/*
Автор: SaDiEv
Сайт: comwap.ru
Пример работы: comwap.ru/top
Страница: sites.php
Назначение: список сайтов
*/
Error_Reporting(E_ALL & ~E_NOTICE); Error_Reporting (ERROR | WARNING);
extract($HTTP_GET_VARS); extract($HTTP_POST_VARS); extract($HTTP_COOKIE_VARS); extract($HTTP_SERVER_VARS); extract($HTTP_SESSION_VARS);
//сессии
session_name("SESID"); session_start();
// подключаем настройки
include "config/sis.php";
include "config/other.php";
$TITLES = "сайты";
mysql_connect ($DB_HOST, $DB_USER, $DB_PASS);mysql_select_db($DB_NAME);
if($brodilka==wap){include "theme/".$wap_theme."/head.php";}
else {include "theme/".$web_theme."/head.php";}
?>
<form name="form" action="search.php?act=search" method="post">Что ищем?<br><input name="text" type="text" maxlength="50"><br><input type="checkbox" name="tr_text" value="1">Транслит<br><input type="submit" value=" Найти "></form></div>
<?
if($act=="search"){$text=strtolower($text);if($tr_text==1){include_once "trans.php"; $text=eng_to_rus($text);}$text=substr(trim($text), 0, 50);
$arr=mysql_query("select * from `users` where (locate(lower('$text'),lower(about))>0 and counthost>'0') order by counthost desc;");
$i=mysql_num_rows($arr);
if($i>0)
{
echo"Совпадений: $i<br>$srd<br>";
while ($data=@mysql_fetch_array($arr))
{
if($cid==$data['id']) $start=count($ids);
$titles[] = $data['title'];
$ids[] = $data['id'];
$abouts[] = $data['about'];
$arrr=mysql_query("select id from users where 1;");
$ir=mysql_num_rows($arrr);
$asr=mysql_query("select id from users where counthost>=1;");
$asir=mysql_num_rows($asr);}
echo"<div class='content'>";
$count=$i;
$count1=$count;
if(empty($start))
$start=0;
$start=intval($start);
if($start<0)
$start=0;
if($count>$start+$url_page) $count=$start+$url_page;
for($i=$start;$i<$count;$i++){
$n=$i+1;
if($url_page%$i!=0||$i==1) $br="<br>";
$text2=str_replace(" ","|",$text);
$abouts[$i]=strtolower($abouts[$i]);
$abouts[$i] = ereg_replace($text2,"<font color=#A50000><b>\\0</b></font>",$abouts[$i]);
echo"<b>$n</b> <a href='go/index.php?id=$ids[$i]'>$titles[$i]</a><br>";
echo"$abouts[$i]<br><br/>";
}
if($start!=0){echo"<a href='search.php?act=search&text=$text&start=".($start-$url_page)."'>Пред.</a>";}
if($start!=0 && $count1>$start+$url_page) {echo" | ";}
if($count1>$start+$url_page){echo"<a href='search.php?act=search&text=$text&start=".($start+$url_page)."'>След.</a>";}
if($i==0){echo"<div class='content'>По вашему запросу <b>$text</b>, ничего не найдено!</div>";}
mysql_close();
}}
echo "</div>";
mysql_close();
include "dat/baner.dat";
print "<div id='foot'><center>$autor<center></div>";
if($brodilka==wap){include "theme/".$wap_theme."/foot.php";}
else {include "theme/".$web_theme."/foot.php";}
?>