Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: Elite_Iso on February 08, 2005, 09:57:26 AM

Title: topic and irc
Post by: Elite_Iso on February 08, 2005, 09:57:26 AM
is this posible to make announce the eggdrop on a channel IRC when there is new a topic on the forum
Title: Re: topic and irc
Post by: Midgard on February 08, 2005, 10:01:51 AM
possible, but, we make an TCL script ;)
Title: Re: topic and irc
Post by: Oldiesmann on February 08, 2005, 11:58:58 AM
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
Title: Re: topic and irc
Post by: TLM on April 08, 2005, 04:15:41 PM
*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.
Title: Re: topic and irc
Post by: TLM on April 23, 2005, 03:45:59 PM
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.