Channel List

These are old archives. They are kept for historic purposes only.
Post Reply
DJ24966
Posts: 26
Joined: Thu Nov 06, 2008 7:18 am

Channel List

Post by DJ24966 » Thu Nov 06, 2008 7:21 am

Is it possible to have a webpage that will display the currently open channels, and all the user to click the channel and join the chat?

If anybody at all could help, I'd greatly appreciate it.

Thanks

Jobe1986
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Re: Channel List

Post by Jobe1986 » Thu Nov 06, 2008 9:39 am

It is possible if you use a service such as Denora stats to save the data to a MySQL DB for you to use in your web page.
Your IP: Image

[dx]
Posts: 107
Joined: Sat Jun 16, 2007 1:03 am

Re: Channel List

Post by [dx] » Sun Nov 09, 2008 1:49 pm

And <a href could be edited to address irc://irc.network.net but dunno if denora support php edit :-)

Guess no.

DJ24966
Posts: 26
Joined: Thu Nov 06, 2008 7:18 am

Re: Channel List

Post by DJ24966 » Mon Nov 10, 2008 5:53 pm

I found a php channel list for an IRCX server, and it works fine for that, someone said it would take minimal changes in order for it to work with IRCD.

Here is the php code for that if anybody is interested.

Code: Select all

<?php
error_reporting(E_ALL ^ E_NOTICE);
    $botnick = "Chatterup";
    $server = "address";
    $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;">&nbsp;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;">&nbsp;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;">&nbsp;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; ?>">&nbsp;<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; ?>">&nbsp;
      <?php echo $topic; ?></td>
  </tr>
                      <?php
                    }
                }
            }
        }
        fclose($fp);
    }
?>
</table>
</body>
</html>
Would anybody here be able to make the required changes? I have tried, but I'm lost.

Thanks!

DJ24966
Posts: 26
Joined: Thu Nov 06, 2008 7:18 am

Re: Channel List

Post by DJ24966 » Tue Nov 11, 2008 9:48 pm

Any takers?

zunkies
Posts: 11
Joined: Sat Feb 04, 2012 6:20 am

Re: Channel List

Post by zunkies » Sat Feb 11, 2012 10:09 pm

Here mine it does work rember to fill in the two bits server and channel
the server your server name or ip
channel is a room name one room that always stay open like a official room without the # so if it called #ringer then just put in ringer

The bit that says

Code: Select all

a href="chat.php?autojoin
change the chat.php to what every you call your chat file

also works with lightirc

Code: Select all

<? include('includes/pages/header.php'); ?>

<?php
error_reporting(E_ALL ^ E_NOTICE);
        $botnick = "RoomLister";
        $server = "server name or ip";
        $port = "6667";
        $channel = "name of 1 room that is always open";
?>
<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>
<blockquote>
<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;">&nbsp;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;">&nbsp;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;">&nbsp;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, 500);
                                        //echo "$fget <br>\n";
                                        $match = explode(" ", $fget);
                                        $fget = str_replace ("\n", "", $fget);
                                        $fget = str_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") {
                                         $room = $match[3];
                                         $room = str_replace("#","",$room);
          $count = $match[4];
          $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 $count; ?></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; ?>">&nbsp;<a href="chat.php?autojoin=<?php echo $room; ?>&nick=<?php echo $username; ?>">
                  <?php echo $room; ?>
                  </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; ?>">&nbsp;
                  <?php echo $topic; ?></td>
  </tr>
                                                                                  <?php
                                                        }
                  
                        }
                        fclose($fp);
        }
?>
</table></blockquote>
<table width="99%" align="center">

  <tr>

    <? require('includes/pages/footer.php') ?></div></td>

  </tr>

</table>
</body>
</html>

cards
Posts: 85
Joined: Sat Jun 12, 2004 5:04 am

Re: Channel List

Post by cards » Sun Feb 12, 2012 3:59 am

Most web hosts are going to kill a page utilizing Sockets like that. YOur best option would be to use Denora/Mysql and create a custom php page
NetAdmin
irc.420-HighTimes.com

Post Reply