| View previous topic :: View next topic |
| Author |
Message |
Garp Voice
Joined: 15 Sep 2003 Posts: 29
|
Posted: Tue Mar 16, 2004 3:43 am Post subject: tcl/php pack to display phpBB board messages in #channel |
|
|
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 |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Mar 16, 2004 10:27 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
spock Master
Joined: 12 Dec 2002 Posts: 319
|
|
| Back to top |
|
 |
]Kami[ Owner

Joined: 24 Jul 2003 Posts: 590 Location: Slovenia
|
Posted: Thu Mar 18, 2004 12:03 pm Post subject: |
|
|
Nice, just what i needed  _________________ Slovene Eggdrop Page |
|
| Back to top |
|
 |
the_crow Halfop
Joined: 28 Feb 2003 Posts: 42 Location: Lisboa, Portugal
|
Posted: Sat May 15, 2004 12:09 am Post subject: |
|
|
can anyone tell me if this really work with you?? i tried this thing, but the egg didn't give me any signal  |
|
| Back to top |
|
 |
the_crow Halfop
Joined: 28 Feb 2003 Posts: 42 Location: Lisboa, Portugal
|
Posted: Sat May 15, 2004 10:54 am Post subject: |
|
|
i found the error, but i don't know how to correct...
can you give me a light
error: Tcl error [phpbb2eggincoming]: invalid idx |
|
| Back to top |
|
 |
Nash0r Guest
|
Posted: Wed Jul 28, 2004 8:13 pm Post subject: |
|
|
*bump*
Any updates on this one? |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Thu Jul 29, 2004 3:15 am Post subject: |
|
|
Eleet, I like the idea.
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.  _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Thu Jul 29, 2004 7:11 am Post subject: |
|
|
| awyeah wrote: | Eleet, I like the idea.
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.  |
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 ) _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
AxS Halfop

Joined: 09 Apr 2003 Posts: 46
|
Posted: Tue Oct 26, 2004 8:26 pm Post subject: |
|
|
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?
Thanx peeps |
|
| Back to top |
|
 |
Xandor Voice
Joined: 14 Mar 2005 Posts: 3
|
Posted: Mon Mar 14, 2005 11:06 am Post subject: |
|
|
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: | | $nick = $userdata[user_id]; |
and change it to
| Code: | | $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  |
|
| Back to top |
|
 |
cambodia Halfop

Joined: 22 Aug 2004 Posts: 73 Location: cambodia
|
Posted: Fri Mar 18, 2005 3:28 pm Post subject: |
|
|
| do this work with php 2.0.10 ? |
|
| Back to top |
|
 |
falcon69 Voice
Joined: 13 Aug 2005 Posts: 6
|
Posted: Sat Aug 13, 2005 3:37 am Post subject: |
|
|
| 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??? |
|
| Back to top |
|
 |
Garp Voice
Joined: 15 Sep 2003 Posts: 29
|
Posted: Fri Apr 07, 2006 9:23 pm Post subject: phpbb2egg package improved |
|
|
I did some work on the phpbb2egg pack and would like to get some comments on it.
phpbb2egg.tcl:
| Code: |
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: |
<?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 |
|
| Back to top |
|
 |
dotslasher Halfop

Joined: 10 Aug 2003 Posts: 62
|
Posted: Thu May 25, 2006 6:54 am Post subject: |
|
|
I keep getting the "Lost connection while identing"
I have changed usleep to all sorts of values, nothing work.
any suggestions? |
|
| Back to top |
|
 |
|