ircsearch.php:
Replace yoursite.com with your site url, #channel with your channel.

all creds to TS all i did was change the ircsearch.php to work with v2.05
<?
header("Content-Type: text/plain");
require_once("backend/functions.php");
require_once("languages/english.lang");
dbconn(false);
function sqlwildcardesc($x){
return str_replace(array("%","_"), array("\\%","\\_"), mysql_real_escape_string($x));
}
$searchstr = unesc($_GET["search"]);
$cleansearchstr = searchfield($searchstr);
$char1 = 50; //cut length
$char1 = 50; //cut length
$shortname = CutName(htmlspecialchars($row["name"]), $char1);
if (!$_GET["orderby"])
$orderby = "ORDER BY torrents.id DESC";
else
$orderby = "ORDER BY ".$_GET["orderby"];
$wherea = array();
$wherea[] = "banned != 'yes'";
switch ($_GET["incldead"] ) {
case 1:
break;
case 2:
$wherea[] = "visible = 'no'";
default:
$wherea[] = "visible = 'yes'";
}
if (!$_GET["limit"])
$limit = "LIMIT 3";
else
$limit = "LIMIT {$_GET['limit']}";
if ($_GET["cat"] > 0) {
$wherea[] = "category = " . sqlesc($_GET["cat"]);
}
$wherebase = $wherea;
if (isset($cleansearchstr)) {
$wherea[] = "MATCH (torrents.name) AGAINST ('".mysql_real_escape_string($searchstr)."' IN BOOLEAN MODE)"; }
$where = implode(" AND ", $wherea);
if ($where != "")
$where = "WHERE $where";
$res = mysql_query("SELECT COUNT(*) FROM torrents $where $limit") or die(mysql_error());
$count = $row[0];
if (!$count && isset($cleansearchstr)) {
$wherea = $wherebase;
$searcha = explode(" ", $cleansearchstr);
$sc = 0;
foreach ($searcha as $searchss) {
if (strlen($searchss) <= 1)
continue;
$sc++;
if ($sc > 5)
break;
$ssa = array();
foreach (array("torrents.name") as $sss)
$ssa[] = "$sss LIKE '%" . sqlwildcardesc($searchss) . "%'";
$wherea[] = "(" . implode(" OR ", $ssa) . ")";
}
if ($sc) {
$where = implode(" AND ", $wherea);
if ($where != "")
$where = "WHERE $where";
$res = mysql_query("SELECT COUNT(*) FROM torrents $where") or die(mysql_error());
$row = mysql_fetch_array($res);
$count = $row[0];
}
}
if ($count) {
$query = "SELECT torrents.id, torrents.category, torrents.leechers, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments,torrents.numfiles,torrents.filename,torrents.owner," .
"categories.name AS cat_name, users.username, users.privacy FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $orderby $limit";
$res = mysql_query($query) or die(mysql_error());
}
else
unset($res);
if ($count) {
while ($row=mysql_fetch_array($res)) {
echo chr(3)."9".chr(2)." $site_config[SITENAME] ".chr(2).chr(3)."10 ".chr(3)."13Name: ".chr(3)."10(".chr(3)."4 {$row['name']} ".chr(3)."10) ".chr(3)."13Size: ".chr(3)."10( ".chr(3)."09".mksize($row['size']).chr(3)."10 )".chr(3)."13 Category: ".chr(3)."10(".chr(3)."4 $row[cat_name] ".chr(3)."10) ".chr(3)."13Uploader: ".chr(3)."10(".chr(3)."04 $row[username] ".chr(3)."10)".chr(3)."13 Seeders: ".chr(3)."10(".chr(3)."09 $row[seeders] ".chr(3)."10)".chr(3)."13 Leechers: ".chr(3)."10(".chr(3)."04 $row[leechers] ".chr(3)."10) ".chr(3)."13Link: ".chr(3)."10(".chr(3)."15 $site_config[SITEURL]/torrents-details.php?id=$row[id]".chr(3)."10 )\n";
}
}
else {
if (!isset($cleansearchstr)) {
die(NO_UPLOADS);
}
else {
die(NO_RESULTS);
}
}
?>ircsearch.tcl:package require http
bind pub - !search search
proc search {n u h c a} {
if {[string tolower $c]==[string tolower "#channel"]} {
if {$a!=""} {
set a [::http::mapReply $a]
putquick "PRIVMSG $c :Searching... Please Wait..."
set data [::http::geturl http://yoursite.com/ircsearch.php?search=$a]
putquick "PRIVMSG $c :Search Results:"
foreach line [split [::http::data $data] \n] {
putquick "PRIVMSG $c :$line"
}
} else { putquick "PRIVMSG $c :Use: !search Search terms" }
}
}
if you want it to PM the results to the user, use this tcl instead:
package require http
bind pub - !search search
proc search {n u h c a} {
if {[string tolower $c]==[string tolower "#channel"]} {
if {$a!=""} {
set a [::http::mapReply $a]
putquick "PRIVMSG $n :Searching... Please Wait..."
set data [::http::geturl http://yoursite.com/ircsearch.php?search=$a]
putquick "PRIVMSG $n :Search Results:"
foreach line [split [::http::data $data] \n] {
putquick "PRIVMSG $n :$line"
}
} else { putquick "PRIVMSG $n :Use: !search Search terms" }
}
}Replace yoursite.com with your site url, #channel with your channel.

all creds to TS all i did was change the ircsearch.php to work with v2.05