File size: 2.04Kb
<?php
// This is main page;
require './config.php';
tmp_page (to_utf('Поиск'));
echo '<p>';
if (!isset($go))
{
echo to_utf ('Введите ник пользователя, которого ищите:').'<br/>';
echo '<input name="sname" type="text" maxlength="25"/><br/>';
echo to_utf('Где ищем:<br/>');
echo "<select name='cat_id'>\n";
$select =mysql_query("select * from `cataloge` order by `id` desc;");
while ($cats=mysql_fetch_array($select))
echo '<option value="'.$cats['id'].'">'.$cats['catname'].'</option>';
echo "</select><br/>\n";
echo utf_url($this_uri,'Поиск', true, array('sname','cat_id','go'=>''));
}
else
{
$count =sql("select count(*) from `users` where `nick` like '%".$_POST['sname']."%' and `tocat`='$cat_id'");
$count=$count[0];
if ($count==0) echo to_utf('Пользователей не найдено!');
else
{
$is_page =is_page($count);
$db = mysql_query("select * from `users` where `nick` like '%".$_POST['sname']."%' and `tocat`='$cat_id' order by `id` desc;");
for ($i=$is_page['start']; $i<$is_page['finish']; $i++)
{
$result = mysql_fetch_array($db);
$nick =stripslashes($result['nick']);
$countph = sql("select count(*) from `photo_id` where `user_id`='$result[id]';");
if ($countph[0] > 0)
$image='<img src="./image.php?pre='.$prev.'&id='.(int)$result['id'].'" alt="'.$nick.'"/> ';
else
$image = '';
echo $image;
echo '<a href="./user.php?id='.(int)$result[0].'&cat='.$cat_id.'">'.stripslashes($result[1]).'</a><br/>';
};
echo '<br/>'.to_utf('Стр. ');
echo listpages ($is_page['p'],2,$is_page['pages'],'&cat='.$cat);
echo ' ('.($is_page['start']+1).'-'.$is_page['finish'].to_utf(' из ').$count.')';
};
};
echo '<br/><br/>';
echo '» '.utf_url ('./register.php', 'Регистрация') . '<br/>';
echo '» '.utf_url ('./register.php?rules', 'Правила') . '<br/>';
echo '» '.utf_url ('./profile.php', 'Вход') . '<br/>';
echo '</p><p align="center">'.utf_url('./', 'Фотоальбом').'<br/>'. $copy ;
tmp_foot();
?>