Файл: muzxit.ru/pages/ex.php
Строк: 39
<?php
$sh = functions::checkout($_POST['search']);
$query = mysql_real_escape_string($sh);
echo '<div class="phdr2">Поиск по сайту</div>';
echo '<div class="mn">' .
'<p><form action="index.php" method="post">' .
'<input type="text" name="search" value="' . $query . '" />' .
'<input type="submit" value="Найти"/>' .
'</form></p></div>';
$search_db = functions::rus_lat(mb_strtolower($sh));
$search_db = strtr($search_db, array (
'_' => '\_',
'%' => '\%'
));
if(empty($sh)) {} else {
$totalfort = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE MATCH `text` AGAINST ('$query' IN BOOLEAN MODE) AND `type` = 't' " . ($rights >= 7 ? "" : " AND `close` != '1'")), 0);
$totalfor = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE MATCH `text` AGAINST ('$query' IN BOOLEAN MODE) AND `type` = 'm' " . ($rights >= 7 ? "" : " AND `close` != '1'")), 0);
$totaldown = mysql_result(mysql_query("SELECT COUNT(*) FROM `download` WHERE MATCH `name` AGAINST ('$query' IN BOOLEAN MODE) AND `type` = 'file'"), 0);
$totalib = mysql_result(mysql_query("SELECT COUNT(*) FROM `lib` WHERE MATCH `text` AGAINST ('$query' IN BOOLEAN MODE) AND `type` = 'bk'"), 0);
$totalibt = mysql_result(mysql_query("SELECT COUNT(*) FROM `lib` WHERE MATCH `name` AGAINST ('$query' IN BOOLEAN MODE) AND `type` = 'bk'"), 0);
$totaluser = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `name_lat` = '" . mysql_real_escape_string($search_db) . "'"), 0);
if($totaluser > 0) {
echo '<div class="menu"><img src="/images/contacts.png" /><a href="/users/search.php?search='.$search_db.'">Foydalanuvchilar</a>: (' . $totaluser . ') </div>';
}
else {
echo '<div class="menu"><img src="/images/contacts.png" />Foydalanuvchilar: (topilmadi!) </div>';
}
echo '<div class="menu">';
if($totalib > 0) {
echo '<img src="/images/guestbook.gif" /><a href="/library/search.php?search='.$query.'">Kutubxona</a>: (' . $totalib . ') | ';
}
else {echo '<img src="/images/guestbook.gif" /> Kutubxona: (maqolalar yo'q!) | ';
}
if($totalibt > 0) {
echo '<a href="/library/search.php?search='.$query.'&t=1"> Maqola nomi</a>: (' . $totalibt . ') ';
}
else{echo 'Maqolalar: (topilmadi!)';
}
echo'</div>';
if($totaldown > 0) {
echo '<div class="menu"><img src="/images/file.gif" /> <a href="/download/index.php?act=search&srh='.$query.'"> Fayllar</a>: (' . $totaldown . ') </div>';
}
else {
echo '<div class="menu"><img src="/images/file.gif" /> Fayllar: (fayl yo'q!) </div>';
}
echo '<div class="menu">';
if($totalfor > 0) {
echo '<img src="/images/users.png" /> <a href="/forum/search.php?search='.$query.'"> Forum</a>: (' . $totalfor . ') | ';
}
else {
echo '<img src="/images/users.png" /> Forum: (topilmadi!) | ';
}
if($totalfort > 0) {
echo '<a href="/forum/search.php?search='.$query.'&t=1"> Mavzular</a>: (' . $totalfort . ')';
}
else {
echo 'Mavzular: (mavzu yo'q!)';
}
echo'</div>';
}
/*
--------------------------------------------------------------
конец
----------------------------------------------------------------
*/