Файл: pages/search.php
Строк: 175
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" Content="ru">
<link rel="stylesheet" href="/design/style.css" type="text/css">
<meta name="description" Content="<?=$system['description']?>">
<meta name="keywords" Content="<?=$system['keywords']?>">
<title><?=$title?>Поиск</title>
</head>
<body>
<div class="header">
<table cellspacing="0" cellpadding="0" width="100%" border="0"><tr><td class="markcell-cell1" width="50%">
<a href="/"><img src="http://igru6ek.ru/logogo.png" alt="" /></a>
</td><td class="markcell-cell1" width="50%" align="right"> <a href="/panel/login.php"><img src="http://igru6ek.ru/images/a49b8d2.gif" alt="" /></a> </td></tr></table>
</div>
<?php
$titles = 'Поиск';
include("../sys/connect.php");
include("../sys/config.php");
include("../sys/function.php");
include("head.php");
echo '<div class="vote">Поиск</div>';
if(!isset($_GET['g']))
{
echo '<div class="link">
<form action="search.php" method="get">
Что ищем?:<br/>
<input name="c" type="text" value="" /><br/>
Где ищем:<br/>
<select size="1" name="g">
<option value="1">В адресе</option>
<option value="2">В названии</option>
<option value="3">В описании</option>
</select><br/>
<input type="submit" value="Искать"></form></div>';
}
else
{
if(isset($_GET['g']) AND $_GET['g'] == 1)
{
$poisk = mysql_query("SELECT * FROM `".$prefix."users` WHERE `url` LIKE '%".htmlspecialchars(mysql_real_escape_string(trim($_GET['c'])))."%'");
$all = mysql_num_rows($poisk);
if($all == 0)
{
echo '<div class="link">Поиск не дал результатов!</div>';
}
else
{
echo '<div class="link">Найдено совпаденй: '.$all.'</div>';
$total=intval(($all-1)/$set['onpage_s'])+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0)
{
$page = 1;
}
if($page > $total)
{
$page = $total;
}
$past=intval($all/$set['onpage_s']);
$start=$page*$set['onpage_s']-$set['onpage_s'];
$n = 0;
$query = mysql_query("SELECT * FROM `".$prefix."users` WHERE `url` LIKE '%".htmlspecialchars(mysql_real_escape_string(trim($_GET['c'])))."%' ORDER BY `url` ASC LIMIT ".$start.",".$set['onpage_s']."");
while($row = mysql_fetch_array($query))
{
$start++;
$n++;
$int = $n/2;
if(is_integer($int))
{
$div = '<div class="link">';
}
else
{
$div = '<div class="link2">';
}
$about=mb_substr($row['about'],0,35);
echo $div;
echo '• <a href="http://'.$row['url'].'">'.$row['name'].'</a> [<b>ID:'.$row['id'].'</b>]<br/>';
echo '[<small><strong>'.$row['url'].'</strong></small>]</br>';
if(mb_strlen($row['about']) > 35)
{
echo ''.$about.'<br/>....<a href="http://'.$set['url_sait'].'/sait/'.$row['id'].'"><b>[Подробнее]</b></a></br>';
}
else
{
echo ''.$about.'<br/><a href="http://'.$set['url_sait'].'/sait/'.$row['id'].'"><b>[Подробнее]</b></a></br>';
}
if(admin==1)
{
echo '
<b>
<a href="http://'.$set['url_sait'].'/admin/admin_users.php?m=del&id='.$row['id'].'">[Удал]</a><a href="http://'.$set['url_sait'].'/admin/admin_users.php?m=edit&id='.$row['id'].'">[Измен]</a><br/>
</b>
';
}
echo '</div>';
}
navigation($all,$set['onpage_s'],$page,'http://'.$set['url_sait'].'/pages/search.php?g='.intval($_GET['g']).'&c='.htmlspecialchars(mysql_escape_string(trim($_GET['c']))).'&page=',$total);
}
}
elseif(isset($_GET['g']) AND $_GET['g'] == 2)
{
$poisk = mysql_query("SELECT * FROM `".$prefix."users` WHERE `name` LIKE '%".htmlspecialchars(mysql_real_escape_string(trim($_GET['c'])))."%'");
$all = mysql_num_rows($poisk);
if($all == 0)
{
echo '<div class="link">Поиск не дал результатов!</div>';
}
else
{
echo '<div class="link">Найдено совпаденй: '.$all.'</div>';
$total=intval(($all-1)/$set['onpage_s'])+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0)
{
$page = 1;
}
if($page > $total)
{
$page = $total;
}
$past=intval($all/$set['onpage_s']);
$start=$page*$set['onpage_s']-$set['onpage_s'];
$n = 0;
$query = mysql_query("SELECT * FROM `".$prefix."users` WHERE `name` LIKE '%".htmlspecialchars(mysql_real_escape_string(trim($_GET['c'])))."%' ORDER BY `url` ASC LIMIT ".$start.",".$set['onpage_s']."");
while($row = mysql_fetch_array($query))
{
$start++;
$n++;
$int = $n/2;
if(is_integer($int))
{
$div = '<div class="link">';
}
else
{
$div = '<div class="link2">';
}
$about=mb_substr($row['about'],0,35);
echo $div;
echo '• <a href="http://'.$row['url'].'"><strong>'.$row['name'].'</strong></a> [<b>ID:'.$row['id'].'</b>]<br/>';
echo '[<small>'.$row['url'].'</small>]</br>';
if(mb_strlen($row['about']) > 35)
{
echo ''.$about.'<br/>....<a href="http://'.$set['url_sait'].'/sait/'.$row['id'].'"><b>[Подробнее]</b></a></br>';
}
else
{
echo ''.$about.'<br/><a href="http://'.$set['url_sait'].'/sait/'.$row['id'].'"><b>[Подробнее]</b></a></br>';
}
if(admin==1)
{
echo '
<b>
<a href="http://'.$set['url_sait'].'/admin/admin_users.php?m=del&id='.$row['id'].'">[Удал]</a><a href="http://'.$set['url_sait'].'/admin/admin_users.php?m=edit&id='.$row['id'].'">[Измен]</a><br/>
</b>
';
}
echo '</div>';
}
navigation($all,$set['onpage_s'],$page,'http://'.$set['url_sait'].'/pages/search.php?g='.intval($_GET['g']).'&c='.htmlspecialchars(mysql_escape_string(trim($_GET['c']))).'&page=',$total);
}
}
elseif(isset($_GET['g']) AND $_GET['g'] == 3)
{
$poisk = mysql_query("SELECT * FROM `".$prefix."users` WHERE `about` LIKE '%".htmlspecialchars(mysql_real_escape_string(trim($_GET['c'])))."%'");
$all = mysql_num_rows($poisk);
if($all == 0)
{
echo '<div class="link">Поиск не дал результатов!</div>';
}
else
{
echo '<div class="link">Найдено совпаденй: '.$all.'</div>';
$total=intval(($all-1)/$set['onpage_s'])+1;
$page=abs(intval($_GET['page']));
if(empty($page) OR $page < 0)
{
$page = 1;
}
if($page > $total)
{
$page = $total;
}
$past=intval($all/$set['onpage_s']);
$start=$page*$set['onpage_s']-$set['onpage_s'];
$n = 0;
$query = mysql_query("SELECT * FROM `".$prefix."users` WHERE `about` LIKE '%".htmlspecialchars(mysql_real_escape_string(trim($_GET['c'])))."%' ORDER BY `about` ASC LIMIT ".$start.",".$set['onpage_s']."");
while($row = mysql_fetch_array($query))
{
$start++;
$n++;
$int = $n/2;
if(is_integer($int))
{
$div = '<div class="link">';
}
else
{
$div = '<div class="link2">';
}
$about=mb_substr($row['about'],0,35);
echo $div;
echo '• <a href="http://'.$row['url'].'"><strong>'.$row['name'].'</strong></a> [<b>ID:'.$row['id'].'</b>]<br/>';
echo '[<small>'.$row['url'].'</small>]</br>';
if(mb_strlen($row['about']) > 35)
{
echo '<strong>'.$about.'</strong><br/>....<a href="http://'.$set['url_sait'].'/sait/'.$row['id'].'"><strong>[Подробнее]</strong></a></br>';
}
else
{
echo '<strong>'.$about.'</strong><br/><a href="http://'.$set['url_sait'].'/sait/'.$row['id'].'"><strong>[Подробнее]</strong></a></br>';
}
if(admin==1)
{
echo '
<b>
<a href="http://'.$set['url_sait'].'/admin/admin_users.php?m=del&id='.$row['id'].'">[Удал]</a><a href="http://'.$set['url_sait'].'/admin/admin_users.php?m=edit&id='.$row['id'].'">[Измен]</a><br/>
</b>
';
}
echo '</div>';
}
navigation($all,$set['onpage_s'],$page,'http://'.$set['url_sait'].'/pages/search.php?g='.intval($_GET['g']).'&c='.htmlspecialchars(mysql_escape_string(trim($_GET['c']))).'&page=',$total);
}
}
}
echo '<div class="vote"><a href="../index.php">На главную</a><br/></div>';
echo '<div class="window2"><table width="100%"><tr><td width="50%"> <a href="http://crazy-mobil.ru/">
<table width="100%"><tr><td width="20%"><img src="http://igru6ek.ru/images/promo/utopia.png" width="40" alt="" />
</td><td width="80%">А ты осмелишься бросить вызов?</td></tr></table></a></td><td width="50%"><a href="http://crazy-mobil.ru/">
<table width="100%"><tr><td width="20%"><img src="http://igru6ek.ru/images/promo/beastmaster.png" width="40" alt="" />
</td><td width="80%">Останови страшную борьбу!</td></tr></table></a></td></tr></table></div>
</div><div class="footer">
<table cellspacing="0" cellpadding="0" width="100%" border="0"></tr><td class="markcell-cell1" width="50%">
<script type="text/javascript" src="http://mobtop.ru/c/101383.js"></script><noscript><a href="http://mobtop.ru/in/101383"><img src="http://mobtop.ru/101383.gif" alt="MobTop.Ru - Рейтинг и статистика мобильных сайтов"/></a></noscript>
<span><a href="/"></a></span> <a href="/"></a>';
include("/Core/footer.php");
?>