Code: Select all
add to functions.php or create a seperate file and add to newthread.php
require_once('./your_new_file_name.php');
// THE PHP
function irc_send($ta,$text) {
// options
$serverip = "123.123.123.123"; // PUT IP OF YOUR BOT HERE
$serverport = "13481";
// check if target and text aint empty
if ($ta=="" || $text=="") {
return;
}
// do splitchar
$text = ereg_replace(";", ":", $text);
$text = ereg_replace("<br>", ";", $text);
// add md5 hash
$line="$ta $text";
// open socket and put the line
$socket = @fsockopen ($serverip, $serverport, $null, $null, 30);
if (!$socket) {
echo " no connection made ";
}
if ($socket) {
@fputs($socket,"$line\n");
for($i=0;$i<400000;$i++)
{
$g=$i;
}
fclose($socket);
}
}
function irc_checkid($forumid) {
$public[forumids] ="2 4 5 6 9 10 11 13 14 15 16 17 18 19 20 21 27 28 29 30 31 32 33 34";
$public[chan] ="#yourchan";
$forumids=explode(" ", $public[forumids]);
while ( list($n, $id) = each($forumids)) {
if ($forumid == $id) {
return "$public[chan]";
}
}
return "";
}
// END OF FUNCTIONS
Now in newthread.php
somewhere just before the following :
eval("standardredirect(\"".gettemplate("redirect_postthanks")."\",\"$goto\");");
ADD THIS
$text2 = "\002[\00311,01Board\00300,01]\002 New thread in: \002$forumname[title]\002 Poster: \002$postusername \002 Subject: \002 $subject\002<br>";
$text2 .= 002[\00311,01Board\00300,01]\002 Link: http://www.mydomain.com/showthread.php?threadid=$threadid\002";
$chan=irc_checkid($forumid);
irc_send($ta=$chan,$text=$text2);
OK NOW THE TCL
listen 13481 script vbulletinaccept
proc vbulletinaccept {idx} {
control $idx vbincoming
}
proc vbincoming {idx args} {
putlog "$args"
set line [join $args]
if {[join $args] != "" } {
set chan [lindex $line 0]
set line [lrange $line 1 end]
set line [join $line]
set line [split $line ";"]
foreach line $line { putserv "PRIVMSG $chan :$line" }
putlog "$line"
}
killdcc $idx
}
putlog "vbulletin.tcl Loaded..."