Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[MOD] IRC Announce for Eggdrop
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2007-09-26 02:03:28
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....

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 FLASH



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
2007-09-26 10:26:37
yeah i decided against v2 having IRC stuff built in as it wasnt really n00b friendly.  Good mod though
Unknown User
2007-09-27 22:49:57
Note: because of the sleep(2) it'll take longer for the page to load. (which is why i put it in a seperate file and used exec to start it)
Unknown User
2007-09-27 23:26:09
You're absolutely right, but this was the simplest way to fix the rehash issue with the pure TCL code  :P

But it's a great idea to put into a seperate file and call it, thanks for the tip :P
Unknown User
2007-11-03 12:33:11
i keep getting this

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /opt/lampp/htdocs/torrents-upload.php on line 254

and line 254 is the line containing

Quote:
$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["name"].chr(3)."2 )  Link: (".chr(3)."10 $site_config['SITEURL']/torrents-details.php?id=$id&hit=1".chr(3)."2 )\r\n";

by the way i made it so that is all one single line
Unknown User
2007-11-04 01:32:49
$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["name"].chr(3)."2 )  Link: (".chr(3)."10 {$site_config['SITEURL']}/torrents-details.php?id=$id&hit=1".chr(3)."2 )\r\n";


*Updated*
Unknown User
2007-11-07 05:35:58
Should be..

$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";


Fixes the category issues
Unknown User
2008-04-23 22:03:55
Thanks for the mod!

This adds to the above by adding IRC announce of shoutbox messages:

In shoutbox.php, look for:

//INSERT MESSAGE

if (!empty($_POST['message']) && $CURUSER) {

$_POST['message'] = sqlesc($_POST['message']);

$query = "SELECT COUNT(*) FROM shoutbox WHERE message=".$_POST['message']." AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP('".get_date_time()."')-UNIX_TIMESTAMP(date) < 30";

$result = mysql_query($query);

$row = mysql_fetch_row($result);



if ($row[0] == '0') {

$query = "INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', ".$_POST['message'].", '".get_date_time()."', '".$CURUSER['id']."')";

mysql_query($query);

}





Insert below that chunk:



		// start irc announce hack

if ($IRCANNOUNCE) {

$msg_shout = 'Shoutbox: '. $CURUSER['username'] .' said ' . $_POST['message'] . "\r\n";

$fs = fsockopen($ANNOUNCEIP, $ANNOUNCEPORT, $errno, $errstr);

if($fs) {

sleep(1);

fwrite($fs, stripslashes($msg_shout));

fclose($fs);

}

}

// end irc announce hack
Unknown User
2008-08-14 03:19:08
Hi get a problem running the tcl this comes up

[03:12] wrong # args: should be "listen port type ?mask?/?proc ?flag??"

while executing

"listen 6610 script xxGRAB #CHANGE THIS TO YOUR EGGDROP'S LISTEN PORT!"

(file "scripts/uploads.tcl" line 1)

invoked from within

"source scripts/uploads.tcl"

(file "eggdrop.conf" line 1346)

can you help me figure this out just to get it running?
Unknown User
2008-08-14 15:15:30
try:

listen 2500 script announce:grab pub



proc announce:grab {idx} { control $idx announce:control }



proc announce:control {idx text} {

putlog "IRC Announce, received: $text"

putserv "PRIVMSG #channel :$text"

return 1

}


change 2500 to the port.
Unknown User
2008-08-15 12:30:51
"TheDoctorUK, post: 45531":
Hi get a problem running the tcl this comes up
[03:12] wrong # args: should be "listen port type ?mask?/?proc ?flag??"

while executing

"listen 6610 script xxGRAB #CHANGE THIS TO YOUR EGGDROP'S LISTEN PORT!"

(file "scripts/uploads.tcl" line 1)

invoked from within

"source scripts/uploads.tcl"

(file "eggdrop.conf" line 1346)

can you help me figure this out just to get it running?

Try "listen 6610 script xxGRAB pub".
Unknown User
2008-08-30 02:24:23
ok got script running but it posts 5 lines with the shoutbox mod added and dont work for 15 mins, is there a setting i need to change in my ircd or eggdrop configs to prevent it from being spam filtered?

**** FIXED *****

Next Below :)
Unknown User
2008-08-30 03:02:21
i`ve written another mod but it ouputs this when i click submit

( &TorrentServ )  New News: (  ) Link: ( [url="http://www.scifitorrents.net/comments.php?type=news&id="]http://www.scifitorrents.net/comments.php?type=news&id=[/url] )

here is the code i`ve used

Find in admincp.php

if ($action=="news" && $do=="add"){
stdhead("News Management");

navmenu();

begin_frame("Add News");

print("<CENTER><form method=post action=admincp.php name=news>\n");

print("<input type=hidden name=action value=news>\n");

print("<input type=hidden name=do value=takeadd>\n");

print("<center><B>News Title:</B> <input type=text name=title><br>\n");

echo "<BR>".textbbcode("news","body")."<br>";

print("<br><br><div align=center><input type=submit value='Submit' class=btn></div>\n");

print("</form><br><br></CENTER>\n");

end_frame();

stdfoot();

add below that

// start irc announce hack
if ($IRCANNOUNCE) {

$msg_newsadd = chr(3)."2 New News: (".chr(3)."10 $title".chr(3)."2 ) Link: (".chr(3)."10 {$site_config['SITEURL']}/comments.php?type=news&id=$id".chr(3)."2 )\r\n";

$fs = fsockopen($ANNOUNCEIP, $ANNOUNCEPORT, $errno, $errstr);

if($fs) {

sleep(1);

fwrite($fs, stripslashes($msg_newsadd));

fclose($fs);

}

}

// end irc announce hack

i think i put it in the wrong place
Unknown User
2008-08-30 08:17:22
you need to put it where it actually adds it to the database
Unknown User
2008-10-22 20:46:34
hello,

i have install it but i have an problem :

Quote:
Warning: fsockopen() [function.fsockopen]: unable to connect to ***:3333 (Connection timed out) in /home/***/public_html/torrents-upload.php on line 309

my line 309 is :

Quote:
$fs = fsockopen($ANNOUNCEIP, $ANNOUNCEPORT, $errno, $errstr);

in my config.php it's good ip and good port for my egg shell.

you don't have idea or other solution for irc annouce please.
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728