vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Irc post Notifier -With eggdrop (https://vborg.vbsupport.ru/showthread.php?t=39974)

Floris 09-05-2002 07:37 PM

It would be great if someone with .tcl and .php knowledge could clean up the files so that irc post thread stuff is removed and it wont timeout on the ident to the bot etc, which would save SO much time when posting new threads/posts.

Currently I only let it do threads, since they are made less.
new reply would be great, but ppl seriously complain a lot about the lag on the forum.

Floris 09-07-2002 10:36 PM

I just run into a bug.
When someone starts a poll, it will announce the thread (which is actually poll.php?something.. so the user could edit the post (bad vB!) or they get a msg that the poll can't be edited because i am not the owner of it. It SHOULD say the url to the thread, and not the poll :P

moosey 09-12-2002 03:20 PM

Works fine for me just one thing though it updates to the IRC Chan all most instantly but then it sits there for a minute or so b4 it post the actual message in the forum?

Great work btw :-)

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);
        fputs($fp,"8,5 New thread in: \002" .$forumname[title]. ".\002 Poster: \002".$postusername.".\002 Subject: \002 ".$subject.".\002 LINK: \002 http://www.simplymaya.co.uk/forums/".$goto.". \002 \n\n");

        for($i=0;$i<30000;$i++)
        {
            $g=$i;
        }

    }
else

{
        global $postusername, $subject, $forumid, $threadinfo;
        $forumname = $DB_site->query_first("SELECT title FROM forum WHERE forumid=".$forumid);
        fputs($fp," 5,15New reply in: \002".$forumname[title]." \002 Subject: \002".$threadinfo[title].".\002 Thread starter: \002".$threadinfo[postusername]."\002, Replies:\002".($threadinfo[replycount] + 1).". \002 \n\n\n");

        for($i=0;$i<30000;$i++)
        {
            $g=$i;
        }

}


  fputs($fp, "QUIT :Message delivered\n");
    fclose ($fp);
}




?>

I modified the irc.php file works like a dream now thanks very much :)

Floris 01-10-2003 08:45 AM

No matter what I do, the private forum, with forumid XX keeps getting posted, while all the other forums that are not listed don't get posted.

Uhm,

forums to include: 1,2,3,4,5
private mod forums: 6,7,8

and it posts on irc: 1,2,3,4,5,8

So .. how to exclude that one that it shouldn't but still does?

DPoole 01-12-2003 02:04 AM

can anyone help and to save myself a load of grief can you answer this quick question

i dont have eggdrop from shell so if i was to say run it from me comp (localhost) would that not make it work ? as at moment this is only way for me to get an eggdrop up and running.

Mephisteus 01-19-2003 02:45 PM

I have an eggdrop installed and did the file edits, but I think I edited the wrong parts. Since there are multiple appearences of the lines you have to find. Could someone post their newreply & newthread part? I am listening on port 22, this is the port I connect to using SSH. I also get an tcl error when I connect. WHAT'S GOING WRONG!? PS. I'm new to eggdrop :p

spaceb 01-23-2003 04:47 AM

Thanks for the hack it's really a great one but there's a ptoblem..
Either it's posting from all the forums , or either if i choose not to post all forums, it dosen't post at all..

I'm using an eggdrop and a vbb version 2.2.7.. maybe it dosen't work on this version or something ? :/

Killer 02-05-2003 02:14 PM

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?

Killer 02-05-2003 08:52 PM

I found the buggy thing :)

Take newreply.php and search for:

Code:

if($ircdata[ircthread] == "1")
Replace ircthread with ircreply

The ON/OFF - Option for New Reply Notification should work now :)

Nicarlo 02-24-2003 11:13 PM

no matter what i do it never dispays the new thread although it does display the new reply's how can i fix this ?


All times are GMT. The time now is 05:38 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01172 seconds
  • Memory Usage 1,767KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete