I installed the hack, too. Works fine. But one problem: Some of the buttons in admin CP seem to have no function or not the function they should have. Look at the end of my posting, there u can see what the bot does depending on what files are checked ind admin CP. I only want to turn off the notification on new replys!
I would be very thankful for hints to solve this problem.
Below u can see my edited files:
newreply.php:
Code:
// irc addon
$ircdata = $DB_site->query_first("SELECT * FROM ircaddon");
if($ircdata[ircthread] == "1") {
$Action = "reply";
$fid = trim($ircdata[ircforum]);
$ircforum=explode(" ", preg_replace("/[[:space:]]+/", " ", $fid) );
while (list($key,$val)=each($ircforum))
{
if ((strstr(" ".$forumid," ".trim($val))!="") || ($ircdata[ircforum] == 0))
{
require("irc.php");
}
}
}
//
newthread.php:
Code:
// Create a notice on irc channel
$ircdata = $DB_site->query_first("SELECT * FROM ircaddon");
if($ircdata[ircthread] == "1") {
$Action = "new";
$fid = trim($ircdata[ircforum]);
$ircforum=explode(" ", preg_replace("/[[:space:]]+/", " ", $fid) );
while (list($key,$val)=each($ircforum))
{
if ((strstr(" ".$forumid," ".trim($val))!="") || ($ircdata[ircforum] == 0))
{
require("irc.php");
}
}
}
//
irc.php:
Code:
<?
global $goto, $DB_site, $Action, $ircdata;
$fp = fsockopen ($ircdata[ircserver], $ircdata[ircport], $errno, $errstr, 30);
if (!$fp)
{
echo "$errstr ($errno)<br>\n";
}
else
{
if($Action == 'new')
{
global $postusername, $subject, $forumid;
$forumname = $DB_site->query_first("SELECT title FROM forum WHERE forumid=".$forumid);
if($ircdata[ircchannel1] != FALSE)
fputs($fp,"\002[\00311,01X\00300,01]\002 New thread in: \002".$forumname[title]."\002 Poster: \002".$postusername."\002 Subject: \002".$subject."\002 \002[\00311,01X\00300,01]\002\n\n");
for($i=0;$i<30000;$i++)
{
$g=$i;
}
if($ircdata[ircchannel2] != FALSE)
fputs($fp, "PRIVMSG ".$ircdata[ircchannel2]." :New thread in ".$forumname[title].". Poster: ".$postusername.". Subject: ".$subject.". Link: http://yourdomain.com/".$goto."\n");
for($i=0;$i<30000;$i++)
{
$g=$i;
}
if($ircdata[ircchannel3] != FALSE)
fputs($fp, "PRIVMSG ".$ircdata[ircchannel3]." :New thread in ".$forumname[title].". Poster: ".$postusername.". Subject: ".$subject.". Link: http://yourdomain.com/".$goto."\n");
}
else if($Action == 'reply')
{
global $postusername, $subject, $forumid, $threadinfo;
$forumname = $DB_site->query_first("SELECT title FROM forum WHERE forumid=".$forumid);
if($ircdata[ircchannel1] != FALSE)
fputs($fp, "\002[\00311,01X\00300,01]\002 New reply in: \002".$forumname[title]."\002 Subject: \002".$threadinfo[title]."\002 Thread starter: \002".$threadinfo[postusername]."\002 New poster: \002".$threadinfo[lastposter]."\002 \002[\00311,01X\00300,01]\002\n\n\n");
for($i=0;$i<30000;$i++)
{
$g=$i;
}
if($ircdata[ircchannel2] != FALSE)
fputs($fp, "PRIVMSG ".$ircdata[ircchannel2]." :There is a reply to a post in ".$forumname[title]." with the subject: ".$threadinfo[title].". Thread starter: ".$threadinfo[postusername].", New poster: ".$threadinfo[lastposter].". Link: http://yourdomain.com/".$goto."\n\n\n");
for($i=0;$i<30000;$i++)
{
$g=$i;
}
if($ircdata[ircchannel3] != FALSE)
fputs($fp, "PRIVMSG ".$ircdata[ircchannel3]." :There is a reply to a post in ".$forumname[title]." with the subject: ".$threadinfo[title].". Thread starter: ".$threadinfo[postusername].", New poster: ".$threadinfo[lastposter].". Link: http://yourdomain.com/".$goto."\n\n\n");
}
for($i=0;$i<30000;$i++)
{
$g=$i;
}
for($i=0;$i<23;$i++)
{
$info .= fgets ($fp,1280);
}
fputs($fp, "QUIT :Message delivered\n");
fclose ($fp);
}
?>
What the bot does:
[x] = set to "on" in Admin CP
[ ] = set to "off" in Admin CP
1) Irc Post Notification Addon
2) Irc All New Threads Notification Addon
3) Irc All New Reply's Notification Addon
Case 1: 1) [ ] 2) [ ] 3) [x] ---> Bot does nothing
Case 2: 1) [ ] 2) [ ] 3) [ ] ---> Bot does nothing
Case 3: 1) [ ] 2) [x] 3) [ ] ---> Bot posts new threads and new replies
Case 4: 1) [x] 2) [ ] 3) [ ] ---> Bot does nothing
Case 5: 1) [ ] 2) [x] 3) [x] ---> Bot posts new threads and new replies
Case 6: 1) [x] 2) [x] 3) [ ] ---> Bot posts new threads and new replies
Case 7: 1) [x] 2) [ ] 3) [x] ---> Bot does nothing
Case 8: 1) [x] 2)[x] 3)[x] ---> Bot posts new threads and new replies
I am running vBB 2.2.6
Any hints to make the bot only post on new threads?