This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

tcl/php pack to display phpBB board messages in #channel

Support & discussion of released scripts, and announcements of new releases.
G
Garp
Voice
Posts: 29
Joined: Mon Sep 15, 2003 7:58 pm

tcl/php pack to display phpBB board messages in #channel

Post by Garp »

Days ago I found here a snippet to post invision bord messages into a channel. Now I prepared a package to make it easy for phpBB users.

Please test it and give me some response about it if possible. You can download it at http://phpbb2egg.pixelsndots.com/phpbb2egg.zip - it's easy to install.

For tests I've installed http://phpbb2egg.pixelsndots.com, the posts are displayed in #phpBB2egg on undernet.

Still there is a lot to do but it works fine. I've tested it with phpBB2.0.7
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

The .zip file dosen't seem to be there..
Once the game is over, the king and the pawn go back in the same box.
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

photon?
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Nice, just what i needed :)
t
the_crow
Halfop
Posts: 42
Joined: Fri Feb 28, 2003 7:37 am
Location: Lisboa, Portugal

Post by the_crow »

can anyone tell me if this really work with you?? i tried this thing, but the egg didn't give me any signal :|
t
the_crow
Halfop
Posts: 42
Joined: Fri Feb 28, 2003 7:37 am
Location: Lisboa, Portugal

Post by the_crow »

i found the error, but i don't know how to correct...
can you give me a light :)


error: Tcl error [phpbb2eggincoming]: invalid idx
N
Nash0r

Post by Nash0r »

*bump*

Any updates on this one?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Eleet, I like the idea. :mrgreen:
I would recommend the owner of the script should submit it on egghelp.org's TCL Archive and other famous on the web so the public is aware of such a script. :wink:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

awyeah wrote:Eleet, I like the idea. :mrgreen:
I would recommend the owner of the script should submit it on egghelp.org's TCL Archive and other famous on the web so the public is aware of such a script. :wink:
The scripts require some more work before they can be released IMO...the php provided has some weird stuff in it (a while loop that looks like it's supposed to emulate sleep(), (try fflush() instead?) no timeout for the socket etc..) and the tcl part is insecure (just find the port and you're free to talk through the bot :P)
Have you ever read "The Manual"?
User avatar
AxS
Halfop
Posts: 46
Joined: Wed Apr 09, 2003 11:57 am

Post by AxS »

Anyone managed to fix this script so that it works with phpBB 2.0.10 ? I have a no go and as user said...as is, it seems not workable - can someone fix the code? Please? Or is there another script out there that does what this one set out to do? :roll:

Thanx peeps
X
Xandor
Voice
Posts: 3
Joined: Mon Mar 14, 2005 11:00 am

Post by Xandor »

It works in the 2.0.13 but i found i needed to change one more thing in the "phpbb2egg.php".
find the following (line 14):

Code: Select all

$nick = $userdata[user_id];
and change it to

Code: Select all

$nick = $userdata[username];

it needs to be $userdata[username] or it wont find the username, and only post the user's ID.
i'm working a little on trying to improve the script a little. I'll post it here when/if i get it done :)
User avatar
cambodia
Halfop
Posts: 73
Joined: Sun Aug 22, 2004 1:03 am
Location: cambodia

Post by cambodia »

do this work with php 2.0.10 ?
f
falcon69
Voice
Posts: 6
Joined: Sat Aug 13, 2005 2:49 am

Post by falcon69 »

the_crow wrote:i found the error, but i don't know how to correct...
can you give me a light :)


error: Tcl error [phpbb2eggincoming]: invalid idx
theres plenty of topics on this out there...but i cant seem to find a fix for it...any ideas?? anyone??? please???
G
Garp
Voice
Posts: 29
Joined: Mon Sep 15, 2003 7:58 pm

phpbb2egg package improved

Post by Garp »

I did some work on the phpbb2egg pack and would like to get some comments on it.

phpbb2egg.tcl:

Code: Select all

listen 7777 script phpbb2eggaccept pub
set check(pass) "agoodpasshere"


proc phpbb2eggaccept {idx} {
control $idx phpbbincoming
}

proc phpbbincoming {idx args} {
global check

set args [join $args]
set inc(pass) [lindex [split $args] 0]
set inc(chan) [lindex [split $args] 1]
set inc(message) [join [lrange [split $args] 2 end]]

 if { $inc(message) != ""} {
  killdcc $idx
 }
 if {[string match [md5 $check(pass)] $inc(pass)]} {

  set line [split $inc(message) ";"]
   foreach line $line {
    putserv "PRIVMSG $inc(chan) :\00304$line"

   }
 } else { return 0 }

}
putlog "\00312phpbb2egg.tcl beta 0.0.2"
phpbb2egg.php:

Code: Select all

<?php


$bb2egg['channel'] = "#your_channel";
$bb2egg['ids'] = "4 5 6 7 8"; // forums to display posts from
$bb2egg['botip'] = "255.255.255.255"; // your bot's ip
$bb2egg['botport'] = "7777"; // a nice port
$bb2egg['boardurl'] = "www.yourdomain.com";
$bb2egg['pass'] = "agoodpasshere";




function send2egg($mode, $forumid, $topic_id, $user_id, $subject, $message, $poll_title)
{

### echo "$mode, $forumid, $topic_id, $user_id, $subject, $message, $poll_title";
        global $userdata, $bb2egg;

        // something to do?

        if ( check_id($forumid) == 0 )
        {
        	return;
        }


        $nick = $userdata[$user_id];

        if ( $nick == "" ) { $nick = "A Guest"; }

		//strip BBCode off
        $message = preg_replace("#\[(.*?)]#si", "", $message);

        // shorten longer postings to 300 signs
        $text = wordwrap($message, 300, "\0") . ' ...';


		//here we ask for several cases and do some formating stuff with tcl readable colors.
		if ( $poll_title != '' )
		{
			$text2  = "\00300,02 New poll! \00301,99 on our board:<br>";
		}
		else if ( $mode == 'newtopic' )
		{
			$text2  = "\00300,02 New topic! \00301,99 on our board:<br>";
		}
		else
		{
			$text2  = "\00300,02 Fresh! \00301,99 from our board:<br>";
 		}

        if ( $poll_title != '' )
        {
	        $text2  .= "\00300,04 $nick \00302,99 asks: $poll_title <br>";
        }

 		else if ( $subject != '' )
 		{
	        $text2  .= "\00300,04 $nick \00302,99 about the subject $subject :<br>";
	        $text2 .= "\00302,99$message <br>";
        }

        else
        {
	        $text2  .= "\00300,04 $nick".":";
        	$text2 .= "\00302,99$message <br>";
        }



        	$text2 .= "Link: \037\00312,99" . $bb2egg['boardurl'] . "/viewtopic.php?t=$topic_id\003\037\ ";


        phpbb2egg($text2);

}



function phpbb2egg($text)
{
global $bb2egg;

        if ( $text == '') {
        return;
        }

        $text = ereg_replace(";", ":", $text);
        $text = ereg_replace("<br>", ";", $text);



            $fp = fsockopen($bb2egg['botip'], $bb2egg['botport'], $errno, $errstr, 30);

            if ($fp) {
                fputs($fp, md5($bb2egg['pass']) ." ". $bb2egg['channel'] ." $text\n");
                usleep(500);
                fclose($fp);
            }

}


function check_id($current)
{
global $bb2egg;

        $forumids=explode(" ", $bb2egg['ids']);

        while ( list($n, $id) = each($forumids))
        {

            if ($id == $current)
            {
				return 1;
            }

        }

        return 0;



}


?>
the zip file with a Readme ( adding stuff to posting.php in phpbb and some maybe useful remarks) are availible here : http://phpbb2egg.pixelsndots.com/phpbb2egg.zip
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

I keep getting the "Lost connection while identing"

I have changed usleep to all sorts of values, nothing work.

any suggestions?
Post Reply