Jump to content

Channel List


DJ24966

Recommended Posts

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

if you are going to be doing this, you should learn php, learn IRC, and in general, learn to program. the problems with the code seems to just be some small syntactical issues...

try...

<?php
    $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>

Edited by The Gate Keeper
Link to comment
Share on other sites

modified previous post. Sorry.

 

Added: what languages do you know? If you've learn a traditional/more commericalized language such as C/C++/C#/Java, php should come to you in a snap. And even mIRC...

Edited by The Gate Keeper
Link to comment
Share on other sites

1 last thing, Lets say I have a java applet, what would I change in order for it to carry over and join the selected room. I know I would change the chat.php link to the location of the applet.

 

I tried this on the applet page, but it does not seem to work.

 

<param name="rmname="<?php echo $rmname; ?>"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...