News:

Follow us on Bluesky!

Main Menu

topic and irc

Started by Elite_Iso, February 08, 2005, 09:57:26 AM

Previous topic - Next topic

Elite_Iso

is this posible to make announce the eggdrop on a channel IRC when there is new a topic on the forum

Midgard

possible, but, we make an TCL script ;)

Oldiesmann

If you use PHP's IRC Gateway library (something your host has to install), then yes, it is possible.

More info: http://www.php.net/ircg

TLM

#3
*drags up old post*
Check to see if your host supports sockets, some do some dont.
open Sources/Post.php, and about line 1465, just before the following...

if (!empty($_POST['announce_topic']))
redirectexit('action=announce;sa=selectgroup;topic=' . $topic . (!empty($_POST['move']) && allowedTo('move_any') ? ';move' : '') . (empty($_REQUEST['goback']) ? '' : ';goback'));

add the following along with filling in the blanks


$fp = fsockopen("<domain/ip of bot>", <port bot is set to listen for telnet connection on>, $errno, $errstr, 3);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "<username of an account privilaged to .say to a channel>\r\n";
$out .= "<password for the username>\r\n";
if ($newTopic) {
$out .= ".say <#channel> New Topic: " . $_POST[subject] . " - URL: http://<url to forums>/index.php?topic=" . $topic . ".new#new\r\n\r\n";
} elseif (isset($_REQUEST['poll'])) {
$out .= ".say <#channel> New Poll: " . $_POST[subject] . " - URL: http://<url to forums>/index.php?topic=" . $topic . ".new#new\r\n\r\n";
} elseif (isset($_POST['calendar']) && (!isset($_REQUEST['deleteevent']))) {
$out .= ".say <#channel> New Calendar Event: " . $_POST[subject] . " - URL: http://<url to forums>/index.php?topic=" . $topic . ".new#new\r\n\r\n";
} else {
$out .= ".say <#channel> New Post: " . $_POST[subject] . " - URL: http://<url to forums>/index.php?topic=" . $topic . ".new#new\r\n\r\n";
}
fwrite($fp, $out);
sleep(1);
fclose($fp);
}


But there is obvious issues needing to be delt with, eg, permissions, dont wanna be putting out things guests cant see, and what if the bot is down.  But that should work provided you fill in the blanks.

TLM

Or to improve on what I have posted, just simply install a RSS reader in a IRC bot and turn RSS feeds on on the forum.  Then point the bots reader to the forums rss data.

Advertisement: