DJ24966 Posted November 12, 2008 Share Posted November 12, 2008 Can anybody with some advanced PHP knowledge get this working? It should connect to my IRCD server, and display the currently open channels, which will then allow the user to click the channel, and join it. <?php error_reporting(E_ALL ^ E_NOTICE); $botnick = "Chatterup"; $server = "chatterup.webhop.net"; $port = "6667"; $channel = ""; ?> <html> <head> <meta http-equiv="Content-Language" content="en"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Room List</title> </head> <body> <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" id="AutoNumber1" style="border-collapse: collapse"> <tr> <td width="8%" height="20" align="center" valign="middle" bgcolor="#FFFFCC" style="border-left:1px solid #333333;border-bottom:1px solid;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"> Users</td> <td width="15%" height="20" align="left" valign="middle" bgcolor="#FFFFCC" style="border-bottom:1px solid;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"> Roomname:</td> <td width="77%" height="20" align="left" valign="middle" bgcolor="#FFFFCC" style="border-right:1px solid #333333;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"> Topic:</td> </tr> <?php $fp = fsockopen($server, $port, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { fputs($fp,"USER $botnick $botnick 127.0.0.1 :php\n"); $nick = $botnick . rand(10000,99999); fputs($fp,"NICK $nick\n"); while (!feof($fp)) { usleep(50); $fget = @fgets($fp, 128); //echo "$fget <br>\n"; $match = explode(" ", $fget); $fget = ereg_replace ("\n", "", $fget); $fget = ereg_replace ("\r", "", $fget); if (isset($match[0]) && $match[0] == "PING") { fputs($fp, "PONG :" . $match[1]); } elseif(isset($match[1])) { if ($match[1] == "001") { fputs($fp,"LIST\n"); } else if ($match[1] == "433") { $nick = $botnick . rand(10000,99999); fputs($fp,"NICK $nick\n"); } else if ($match[1] == "323") { fputs($fp, "QUIT :bye!\n"); break; } else if ($match[1] == "322") { $match[3] = ereg_replace ("#", "", $match[3]); if (eregi ("$channel(.*)", $match[3], $chan)) { $topic = explode(":", $fget); unset($topic[0]); unset($topic[1]); $topic = implode(":", $topic); if ($color == "FBFBF7") { $color = "FFFFFF"; } else { $color = "FBFBF7"; } ?> <tr> <td width="8%" align="center" valign="middle" bgcolor="#<?php echo $color; ?>" style="border-top:1px solid #333333;border-left:1px solid #333333;border-bottom:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"><?php echo $match[4]; ?></td> <td width="15%" style="border-bottom:1px solid #333333;bordertop:1px solid #333333;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;" bgcolor="#<?php echo $color; ?>"> <a href="http://webchat.chatcore.org/chat/channel.aspx?value=<?php echo $chan[1]; ?>&member=XS803m"> <?php echo $chan[1]; ?> </a></td> <td width="77%" style="border-right:1px solid #333333;border-bottom:1px solid #333333;FONT-FAMILY:;border-top:1px solid #333333; verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"bgcolor="#<?php echo $color; ?>"> <?php echo $topic; ?></td> </tr> <?php } } } } fclose($fp); } ?> </table> </body> </html> It seems to just time out. If someone could fix this for me I'd be mighty great full. Thanks!! Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted November 12, 2008 Share Posted November 12, 2008 If this is urgent, then please pay someone to fix it. Everyone here contributes their time, effort and knowledge for free. Your problem is no more urgent than anyone else's is. You've not even described your problem properly. What do you mean by 'times out'? What actually happens? Do you get a blank screen? An error message? Quote Link to comment Share on other sites More sharing options...
DJ24966 Posted November 12, 2008 Author Share Posted November 12, 2008 http://chatterup.webhop.net/site/?n=pages/roomlist As you can see, the page will load, but just takes forever, and never gets the information. Quote Link to comment Share on other sites More sharing options...
DJ24966 Posted November 12, 2008 Author Share Posted November 12, 2008 bump. Quote Link to comment Share on other sites More sharing options...
DJ24966 Posted November 13, 2008 Author Share Posted November 13, 2008 bump Quote Link to comment Share on other sites More sharing options...
haku Posted November 13, 2008 Share Posted November 13, 2008 I'd try to answer, but it appears to be urgent, and I'm slow. Quote Link to comment Share on other sites More sharing options...
DJ24966 Posted November 13, 2008 Author Share Posted November 13, 2008 I'd try to answer, but it appears to be urgent, and I'm slow. Really though, can you help at all? I've been trying to figure this out for days. Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted November 13, 2008 Share Posted November 13, 2008 Remove your error suppressing @'s on your functions i.e. fputs() fgets(). Add conditionals to error if the functions fail: if(!fputs()) { } Can you connect to your server through port 6667? Does your server name resolve correctly from the target chatterup.webhop.net? Is there a firewall in the way, etc. Some simple debugging, easy enough. Dont post as URGENT it wont do you any favors! As GingerRobot stated, you can pay people to investigate. Quote Link to comment Share on other sites More sharing options...
DJ24966 Posted November 13, 2008 Author Share Posted November 13, 2008 Remove your error suppressing @'s on your functions i.e. fputs() fgets(). Add conditionals to error if the functions fail: if(!fputs()) { } Can you connect to your server through port 6667? Does your server name resolve correctly from the target chatterup.webhop.net? Is there a firewall in the way, etc. Some simple debugging, easy enough. Dont post as URGENT it wont do you any favors! As GingerRobot stated, you can pay people to investigate. Sorry, I don't really understand exactly what you are wanting me to do. As for can my server be accessed, yes, We were running an IRCX server, and had a roomlist php file working fine, we moved on to a more reliable IRCD server, and are in the need of a fix for it. We are able to connect to the chat just fine through 6667. Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted November 13, 2008 Share Posted November 13, 2008 So you didn't write this application? Quote Link to comment Share on other sites More sharing options...
DJ24966 Posted November 13, 2008 Author Share Posted November 13, 2008 So you didn't write this application? No, you can find the code anywhere online, it's just the fact that site, and people that built it will not even help anybody. http://www.tg007.net/forum/index.php?showtopic=2538 Quote Link to comment Share on other sites More sharing options...
DJ24966 Posted November 13, 2008 Author Share Posted November 13, 2008 bump Quote Link to comment Share on other sites More sharing options...
haku Posted November 14, 2008 Share Posted November 14, 2008 This forum is not for altering 3rd party scripts, it's for people who are having troubles with scripts they are writing themselves. There used to be a 3rd party script section of this forum. If it's still there, that's where you want to ask. Quote Link to comment Share on other sites More sharing options...
flyhoney Posted November 14, 2008 Share Posted November 14, 2008 Remove all the '@'s from the code and turn on error reporting by placing this at the very beginning of the script: error_reporting(E_ALL); ini_set("display_errors", 1); Quote Link to comment Share on other sites More sharing options...
DJ24966 Posted November 14, 2008 Author Share Posted November 14, 2008 http://chatterup.webhop.net/site/pages/list.php Notice: Undefined offset: 1 in C:\wamp\www\site\pages\list.php on line 45 Notice: Undefined offset: 1 in C:\wamp\www\site\pages\list.php on line 50 Notice: Undefined offset: 1 in C:\wamp\www\site\pages\list.php on line 53 Notice: Undefined offset: 1 in C:\wamp\www\site\pages\list.php on line 56 Quote Link to comment Share on other sites More sharing options...
flyhoney Posted November 14, 2008 Share Posted November 14, 2008 Sorry, I just don't know enough about IRC protocol to really help you here. Quote Link to comment Share on other sites More sharing options...
DJ24966 Posted November 14, 2008 Author Share Posted November 14, 2008 Sorry, I just don't know enough about IRC protocol to really help you here. Well, I changed a few things, and have gotten further. <?php error_reporting(E_ALL); ini_set("display_errors", 1); $botnick = "Chatterup"; $server = "chatterup.webhop.net"; $port = "6667"; $channel = ""; ?> <html> <head> <meta http-equiv="Content-Language" content="en"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Room List</title> </head> <body> <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" id="AutoNumber1" style="border-collapse: collapse"> <tr> <td width="8%" height="20" align="center" valign="middle" bgcolor="#FFFFCC" style="border-left:1px solid #333333;border-bottom:1px solid;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"> Users</td> <td width="15%" height="20" align="left" valign="middle" bgcolor="#FFFFCC" style="border-bottom:1px solid;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"> Roomname:</td> <td width="77%" height="20" align="left" valign="middle" bgcolor="#FFFFCC" style="border-right:1px solid #333333;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"> Topic:</td> </tr> <?php $fp = fsockopen($server, $port, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { fputs($fp,"USER $botnick $botnick 127.0.0.1 :php\n"); $nick = $botnick . rand(10000,99999); fputs($fp,"NICK $nick\n"); while (!feof($fp)) { usleep(50); $fget = @fgets($fp, 128); echo "$fget <br>\n"; $match = explode(" ", $fget); $fget = ereg_replace ("\n", "", $fget); $fget = ereg_replace ("\r", "", $fget); if ($match[1] == "001") { fputs($fp,"LIST\n"); } else if ($match[0] == "PING") { fputs($fp, "PONG :" . $match[1]); } else if ($match[1] == "433") { $nick = $botnick . rand(10000,99999); fputs($fp,"NICK $nick\n"); } else if ($match[1] == "323") { fputs($fp, "QUIT :bye!\n"); break; } else if ($match[1] == "322") { $match[3] = ereg_replace ("#", "", $match[3]); if (eregi ("$channel(.*)", $match[3], $chan)) { $topic = explode(":", $fget); unset($topic[0]); unset($topic[1]); $topic = implode(":", $topic); if ($color == "FBFBF7") { $color = "FFFFFF"; } else { $color = "FBFBF7"; } ?> <tr> <td width="8%" align="center" valign="middle" bgcolor="#<?php echo $color; ?>" style="border-top:1px solid #333333;border-left:1px solid #333333;border-bottom:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"><?php echo $match[4]; ?></td> <td width="15%" style="border-bottom:1px solid #333333;bordertop:1px solid #333333;border-top:1px solid #333333;FONT-FAMILY: verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;" bgcolor="#<?php echo $color; ?>"> <a href="./chat.php?action=Chat&rmname=[EN]<?php echo $chan[1]; ?>"> <?php echo $chan[1]; ?> </a></td> <td width="77%" style="border-right:1px solid #333333;border-bottom:1px solid #333333;FONT-FAMILY:;border-top:1px solid #333333; verdana;FONT-SIZE: 8pt;TEXT-DECORATION: none;"bgcolor="#<?php echo $color; ?>"> <?php echo $topic; ?></td> </tr> <?php } } } fclose($fp); } ?> </table> </body> </html> Now I get this - :chatterup.webhop.net NOTICE AUTH :*** Looking up your hostname... :chatterup.webhop.net NOTICE AUTH :*** Found your hostname (cached) PING :2C109BD4 :2C109BD4!nospoof@chatterup.webhop.net PRIVMSG Chatterup36427 :VERSION ERROR :Closing Link: Chatterup36427[127.0.0.1] (Ping timeout) Quote Link to comment Share on other sites More sharing options...
corbin Posted November 14, 2008 Share Posted November 14, 2008 http://www.irchelp.org/irchelp/rfc/chapter4.html#c4_6_2 Looks like your script isn't sending a PONG back. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.