Редирект с http://rwc.mine.nu/bans.php Открытый код модуля поиска по банам. 1. Создайте файл ./includes/ajax_bans_search.php. 2. Вставьте в него код: Код: <?php echo "<style> small { color: #638290; font-size: 0.7em; } </style>"; if (!$_GET) { //someone is calling the file directly, which we don't want echo 'This file cannot be called directly.'; die; } require_once ('../config.php'); require_once("../lang/$default_language.php"); require_once('../includes/class.database.php'); require_once('../includes/common.php'); require_once('../includes/db_connect.php'); if (strlen(trim(strip_tags($_GET['searchterm']))) <= 2) {echo "<div align='center'<span style='color:red'>$lang[err_search] </span></div><br/>";die;} $searchTerm = trim($_GET['searchterm']); $searchTerm = strip_tags($searchTerm); // remove any html/javascript. $searchTerm = EscapeStr($searchTerm); $sql = "SELECT * from bans WHERE name <> '' AND LOWER(name) LIKE LOWER('%{$searchTerm}%') LIMIT $search_limit"; $qry_result = $db->query($sql) or die(mysql_error()); //Build Result String echo "<table><tr><td style='padding-left:8px;' height='20px'>$lang[search_term_used] <b>$searchTerm</b></td></tr>"; $total_matches = $db->num_rows($qry_result); $sql2 = "SELECT id from bans WHERE name <> '' AND LOWER(name) LIKE LOWER('%{$searchTerm}%')"; $qry_result2 = $db->query($sql2) or die(mysql_error()); $total_matches2 = $db->num_rows($qry_result2); if ($total_matches < 1) {echo "<tr><td><div align='center'<span style='color:red'>$lang[no_maches] <b>{$searchTerm}</b></span><br/></div></td></tr>";} if($total_matches2 >= $search_limit) $extotal = ", но показано только $search_limit игроков"; echo "<tr><td style='padding-left:8px;' height='20px'>$lang[search_found] ".$total_matches2." $lang[search_users]$extotal</td></tr></table>"; echo "<center><table style='width:75%;'><tr> <th width='10px'><div align='center'>ID</div></th> <th width='70px'><div align='left'>Имя</div></th> <th width='200px'><div align='left'>Причина бана</div></th> <th width='100px'><div align='left'>В игре</div></th> <th width='100px'><div align='right'>Дата бана</div></th> <th width='10px'><div align='center'></div></th> <th width='100px'><div align='left'>Дата разбана</div></th> <th width='90px'><div align='left'>Забанен админом</div></th> <th width='90px'><div align='center'>Сервер</div></th> </tr>"; $date_format = "j F"; $date_format2 = "j F \<\a\>Y\<\/\a\> \г\г\."; while ($list = $db->fetch_array($qry_result,'assoc')) { $name=$list["name"]; $name2=trim(strtolower($list["name"])); $banname=$list["name"]; $ntitle = "title='$name'"; $admin=$list["admin"]; $id=$list["id"]; $ip=$list["ip"]; $realm=$list["server"]; $gn=$list["gamename"]; $begin=$list["date"]; if(!$begin) $begin = time(); /* REALM SCAN*/ if ($realm == 'war3.alkar.net' || $realm == 'Alkar') $realm = '<a href="http://games.alkar.net/">Alkar</a>'; else if ($realm == 'w3.gamergrad.ru' || $realm == 'Gamer Grad') $realm = '<a href="http://gamergrad.ru/">Gamer Grad</a>'; else if ($realm == 'bnet.it-ground.net' || $realm == 'iT-Ground') $realm = '<a href="http://it-ground.net/index.php">iT.Ground</a>'; else if ($realm == '') $realm = '<a href="http://rwc.3nx.ru/">Сервер не определен</a>'; else if ($realm == 'wc3.theabyss.ru') $realm = '<a href="http://ru.iccup.com/">ICCup</a>'; else if ($realm == 'bnet.sibnet.ru') $realm = '<a href="http://game.sibnet.ru/">SibNet</a>'; else if ($realm == '89.221.200.141') $realm = '<a href="http://rwc.3nx.ru/404">Game Tracker-AZ</a>'; else if ($realm == '88.205.252.7') $realm = '<a href="http://games.nadym.ru/f/index.php">Nadym Server</a>'; if ($realm == 'europe.warcraft3.eu') $realm = '<a href="http://games.balticum.lt/">Europe-1</a>'; else if ($realm == '77.232.136.21') $realm = '<a href="http://songofdota.ru/">Лига SoD</a>'; else if ($realm == '188.165.23.200') $realm = '<a href="http://eurobattle.net/">EuroBattle</a>'; else if ($realm == 'bnet.a42.ru') $realm = '<a href="http://gamezone.o-go.ru/forum/">Game Zone</a>'; else if ($realm == 'playground.ru' OR $realm == 'pg.ru') $realm = '<a href="http://www.PlayGround.ru">PlayGround.ru</a>'; else if ($realm == '84.21.231.34') $realm = '<a href="http://vdote.org/">VDote.org</a>'; else if ($realm == 'rwc.mine.nu') $realm = '<a href="http://rwc.3nx.ru/">RwC League</a>'; echo "<!-- Bans search by LongMan (C)-->"; $end=$list["expiredate"]; $exend = strtotime($end); if(date("Y",time()) != date("Y",strtotime($begin))) $begin=date($date_format2,strtotime($begin)); else $begin=date($date_format,strtotime($begin)); if(date("Y",time()) != date("Y",strtotime($end)) && $end) $end=date($date_format2,strtotime($end)); else if($end) $end=date($date_format,strtotime($end)); if(!$end) $end = "<span style=color:red>Навсегда</span>"; $name = preg_replace("/$searchTerm/is",'<span style="color:#2c38bf;">'.$searchTerm.'</span>',$name); $begin = str_replace("January", "Января", $begin); $begin = str_replace("February", "Февраля", $begin); $begin = str_replace("March", "Марта", $begin); $begin = str_replace("April", "Апреля", $begin); $begin = str_replace("May", "Мая", $begin); $begin = str_replace("June", "Июня", $begin); $begin = str_replace("July", "Июля", $begin); $begin = str_replace("August", "Августа", $begin); $begin = str_replace("September", "Сентября", $begin); $begin = str_replace("October", "Октября", $begin); $begin = str_replace("November", "Ноября", $begin); $begin = str_replace("December", "Декабря", $begin); $end = str_replace("January", "Января", $end); $end = str_replace("February", "Февраля", $end); $end = str_replace("March", "Марта", $end); $end = str_replace("April", "Апреля", $end); $end = str_replace("May", "Мая", $end); $end = str_replace("June", "Июня", $end); $end = str_replace("July", "Июля", $end); $end = str_replace("August", "Августа", $end); $end = str_replace("September", "Сентября", $end); $end = str_replace("October", "Октября", $end); $end = str_replace("November", "Ноября", $end); $end = str_replace("December", "Декабря", $end); $gid = ""; $sql2 = "SELECT id from games WHERE gamename = '$gn' LIMIT 1"; $result2 = $db->query($sql2); $list2 = $db->fetch_array($result2,'assoc'); $gid=$list2["id"]; if($gid) $gn = "<a href=game.php?gameid=$gid>$gn</a>"; else $gn = "$gn<br><small>Ссылка не найдена</a>"; if (trim(strtolower($banname)) == $name2 && ($exend > time() || !$exend)) { $reason = trim($list["reason"]); $name = "<span style='color:#bf2c2f'>$name</span>"; $ntitle = "title='Забанен'"; } else $reason = trim($list["reason"])."<br><small>Бан истек</small>"; echo "<tr class='row'><div align='left'> <td>$id</td> <td style='padding-left:0px; width='50px' align=left> <a href=user.php?u=$name2>$name</a><br><small>IP: $ip</small></td> <td align=left>$reason</td> <td align=left>$gn</td> <td align=right>$begin</td> <td align=center><span style=color:red>-></span></td> <td align=left>$end</td> <td align=left><a href=user.php?u=$admin>$admin</a></td> <td>$realm</td> </div> </tr>"; } echo "</table></div></center>"; ?> Потом сохраните его в кодировке UTF-8 Без BOM. 3. Открываем bans.php, редактируем: Вставляем перед Код: $result_per_page = $bans_per_page; include('pagination.php'); Это PHP: <span class="syntaxdefault"> </span><span class="syntaxcomment">//Search ban<br /></span><span class="syntaxdefault"> echo </span><span class="syntaxstring">'<br /> <div align="center"><br /> <form name="myForm" method="post" action="javascript:requestActivities()"><br /> <table class="tableSearchH" border="1"><br /> <tr><th><div align="center">Найти бан</div></tr><br /> <tr><br /> <td align="center" ><br /> <input class="inputSearch" size="30" maxlength="30" type="text" id="text1" size="42"/><br /> <input maxlength="42" type="hidden" value="includes/ajax_bans_search.php?searchterm=" id="buildUrl2" size="42"/><br /> <input maxlength="42" type="hidden" id="text2"/><br /> <input maxlength="42" type="hidden" id="text3"/><br /> <input maxlength="42" type="hidden" id="text4"/></td><br /> </tr><br /> <tr><br /> <td class="inputSearchButtons"><br /> <input type="button" onclick="requestActivities()" class="inputButton" value="'</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">$lang</span><span class="syntaxkeyword">[</span><span class="syntaxstring">"search_player"</span><span class="syntaxkeyword">].</span><span class="syntaxstring">'" /><br /> </td></tr></table></form></div><br /> '</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault"> <br /> <br /> echo </span><span class="syntaxstring">"<div id='divActivities2'><br/><br/>"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment">//End sb<br /> </span><span class="syntaxdefault"></span>