PDA

View Full Version : [MOD] Admin Search


PL_90
10-07-2007, 02:30 AM
With this mod you can search the urls in the admin-area.. ;)


1. Open /admin/index.php and find:


<form action="update_frame.php" method="post">
<select class="phpdigSelect" name="site_ids[]" multiple="multiple" size="10">
<?php
//list of sites in the database
$query = "SELECT site_id,site_url,port,locked FROM ".PHPDIG_DB_PREFIX."sites ORDER BY site_url";
$result_id = mysql_query($query,$id_connect);
while (list($id,$url,$port,$locked) = mysql_fetch_row($result_id))
{
if ($port)
$url .= " (port #$port)";
if ($locked) {
$url = '*'.phpdigMsg('locked').'* '.$url;
}
print "\t<option value='$id'>$url</option>\n";
}
?>
</select>




2. ... replace it with this code:


<form action="" method="get">
Search: <input type="text" size="30" name="like"> <input type="submit" value="GO">
</form>

<form action="update_frame.php" method="post">
<select class="phpdigSelect" name="site_ids[]" multiple="multiple" size="10">

<?
$suche_where = (!empty($_REQUEST['like']) ? "WHERE `site_url` LIKE '%".$_REQUEST['like']."%' " : "ORDER BY `upddate` ASC");
$query = "SELECT * FROM ".PHPDIG_DB_PREFIX."sites ".$suche_where;
$result_id = mysql_query($query,$id_connect);
while ($lista = mysql_fetch_array($result_id))
{
if ($lista['port'])
$url .= " (port #$lista[port])";
if ($lista['locked']) {
$url = '*'.phpdigMsg('locked').'* '.$lista['site_url'];
} else {
$url = $lista['site_url'];
}
print "\t<option value='$lista[site_id]'>$url</option>\n";
}
?>
</select>



Have fun.. ;)