Credit goes to FLASH, this is all his code!
For those who used it in 1.x, the same code works fine in 2.x.
Here's the TCL (not using the one from 1.x, made my own using eggdrop's TCL instead of pure TCL sockets).
Save as tcl and load into eggdrop... if you don't know how, you probably shouldn't be trying to run this....
Dont forget to edit where it says to...
And voila, your IRC announce works again! I've modified the code to NOT show the uploader's name, I changed the colors, and I added a sleep(2) delay since eggdrop's sockets are slower.. we need to wait for the socket to open before sending out the data.
If you want the exact code from 1.x, just go get it from torrents-upload.php :P
For those who used it in 1.x, the same code works fine in 2.x.
Here's the TCL (not using the one from 1.x, made my own using eggdrop's TCL instead of pure TCL sockets).
Save as tcl and load into eggdrop... if you don't know how, you probably shouldn't be trying to run this....
listen 6543 script xxGRAB #CHANGE THIS TO YOUR EGGDROP'S LISTEN PORT!
proc xxGRAB { NewIDX } {
control $NewIDX torrent:CTL
putlog "TORRENT: Received connection $NewIDX"
}
proc torrent:CTL { IDX Args } {
putlog "TORRENT: $Args"
putserv "PRIVMSG #My.Channel :$Args"
}
putlog "### Torrent announcer loaded"Open up backend/config.php, and the bottom, add://Setup IRC Announcer
$IRCANNOUNCE = true;
$ANNOUNCEIP = "1.2.3.4"; //Change this to your eggdrop IP
$ANNOUNCEPORT= "1234"; //Change this to your eggdrop listen port
In torrents-upload.php, find:
//END SCRAPE
write_log("Torrent $id ($name) was Uploaded by $CURUSER[username]");
//insert email notif, irc, req notif, etc here
Below, add:
// start irc announce hack v1.0 by FLASH
if ($IRCANNOUNCE)
{
$rs = mysql_query(" SELECT * FROM categories WHERE id='" . intval($catid) . "' LIMIT 1");
$cat_details = mysql_fetch_assoc($rs);
$msg_bt = chr(3)."2 New Torrent: (".chr(3)."10 $torrent".chr(3)."2 ) Size: (".chr(3)."10 ".mksize($torrentsize).chr(3)."2 )
Category: (".chr(3)."10 ". $cat_details["parent_cat"].": ". $cat_details["name"].chr(3)."2 ) Link: (".chr(3)."10 {$site_config['SITEURL']}/torrents-details.php?id=$id&hit=1".chr(3)."2 )\r\n";
$fs = fsockopen($ANNOUNCEIP, $ANNOUNCEPORT, $errno, $errstr);
if($fs) {
sleep(2);
fwrite($fs, $msg_bt);
fclose($fs);
}
}
//end irc announce hack v1.0 by FLASHDont forget to edit where it says to...
And voila, your IRC announce works again! I've modified the code to NOT show the uploader's name, I changed the colors, and I added a sleep(2) delay since eggdrop's sockets are slower.. we need to wait for the socket to open before sending out the data.
If you want the exact code from 1.x, just go get it from torrents-upload.php :P
