DJ24966 Posted November 10, 2008 Share Posted November 10, 2008 I have decided to move from a IRCX server to an IRCD to take advantage of the features. The following will display all the current channels within an IRCX server, but is not working with an IRCD Server. <?php error_reporting(E_ALL ^ E_NOTICE); $botnick = "Chatterup"; $server = "server"; $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://chatterupchat.webhop.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> Here is the page in question: http://chatterup.webhop.net/site/?n=pages/roomlist Thanks Link to comment https://forums.phpfreaks.com/topic/132172-ircd-list/ Share on other sites More sharing options...
monkeytooth Posted November 10, 2008 Share Posted November 10, 2008 Look into IRCD commands themself I didnt test or try anything and its been awhile since I ran my own IRCD server but from what I remember LIST isnt a command unless added in on IRCD I think if i remember right that LIST by itself was an addition with ANOPE. IRCD i think uses /list /channel or something to a similar effect without the Channel Services Anope provided. Dont quote me on this again its just a thought and I breifly looked through your code but that stuck out to me so I thought I would comment on it, and like I also said its been awhile since I ran my own IRCD Link to comment https://forums.phpfreaks.com/topic/132172-ircd-list/#findComment-686992 Share on other sites More sharing options...
DJ24966 Posted November 10, 2008 Author Share Posted November 10, 2008 Look into IRCD commands themself I didnt test or try anything and its been awhile since I ran my own IRCD server but from what I remember LIST isnt a command unless added in on IRCD I think if i remember right that LIST by itself was an addition with ANOPE. IRCD i think uses /list /channel or something to a similar effect without the Channel Services Anope provided. Dont quote me on this again its just a thought and I breifly looked through your code but that stuck out to me so I thought I would comment on it, and like I also said its been awhile since I ran my own IRCD I dunno, I can do /list in mirc and the roomlist is showing fine, so thats where your point confuses me. I'm trying various things in that section hoping to hit on something, but so far, nothing has changed. Link to comment https://forums.phpfreaks.com/topic/132172-ircd-list/#findComment-687004 Share on other sites More sharing options...
DJ24966 Posted November 11, 2008 Author Share Posted November 11, 2008 bump Link to comment https://forums.phpfreaks.com/topic/132172-ircd-list/#findComment-687465 Share on other sites More sharing options...
DJ24966 Posted November 11, 2008 Author Share Posted November 11, 2008 Another bump Link to comment https://forums.phpfreaks.com/topic/132172-ircd-list/#findComment-687868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.