Skip to content
General IRCd

Categories With Anope

A TG007 community discussion started by DJ24966.

Discussion 15 posts
Page 1 of 1
Open
Topic #11544 · 15 published posts · 4,773 views

I was asking err0r on MSN, and he told me to ask here, so here it goes.

 

Is it possible to split your chats up into categories with Anope, or Unreal? I noticed in my roomlist file it had a Category field that was left blank, and was wondering if it were possible. It would be nice to have to make things cleaner.

 

If someone could give me some insight I'd really appreciate it.

 

Thanks

Anybody have an info?

sorry DJ, but i doubt anyone here knows. You may need to try and find a forum specifically focused at the software you are using. That could be hard to find, but try and google it, you may come across something which could help you out.

 

We here are more directed towards mIRC (when it comes to IRC), rather then the actual task of setting up an IRC. Though, we would love for you to stick around in the event others run into the same issues you have experienced, so that you can help out.

yes it is poss

an easy way would be to use #[gn]roomname [gn] being general and set your room list to read that and list it seperate etc

My code does NOT have bugs. It just develops random features.

yes it is poss

an easy way would be to use #[gn]roomname [gn] being general and set your room list to read that and list it seperate etc

 

 

Thanks, I'll give it a shot!

Ok, I've been able to get it working for the most part, but the rooms show up like this in the room list.

 

]TheLobby

 

It will join the correct room though, but is it possible to get rid of the ] in the text?

 

<?php
include("header.php"); 
error_reporting(E_ALL ^ E_NOTICE);
    $botnick = "Chatterup";
    $server = "chatterup.webhop.net";
    $port = "6667";
    $channel = "GN";
?>
<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="http://chatterupchat.webhop.org/chat/channel.aspx?value=[GN<?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>

 

 

<?php
include("header.php"); 
error_reporting(E_ALL ^ E_NOTICE);
    $botnick = "Chatterup";
    $server = "chatterup.webhop.net";
    $port = "6667";
    $category = "GN";
?>
<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 ("\[$category\](.*)", $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 '[' . $category . ']' . $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>

 

I changed $channel variable to $category so it made more sense, and modified the regular expression where it "parses" the channel name. You had it "parsing" everything after "GN", which is incorrect, you want to parse everything after "[GN]", which is represents the category you want. So i modified the "link" so that it wasn't based on GN, but based on $category.

Edited Nov 17, 2008 7:20 AM by The Gate Keeper

Thanks alot.

does it work though? of course i didn't test it, just code it, so you need to tell us the result.

does it work though? of course i didn't test it, just code it, so you need to tell us the result.

 

:oops: lol. It works fine as far as I can tell. I haven't noticed anything yet to say otherwise.

1 last request. Is it possible to have the roomlist page detect which channels are registered, and display a logo beside the room name, letting the user know it's an official channel?

 

Thanks

depends on how you have them stored as "registered"...

They are registered with Chanserv through anope.

what are the commands you type to get the list...?

what is returned...?

 

These questions need to be asked so i can parse the information for you.

what are the commands you type to get the list...?

what is returned...?

 

These questions need to be asked so i can parse the information for you.

 

Sorry for the delay, We took some time off for the Holidays. Happy New year.

 

Anyway, back to business.

 

As of right now, you can just do /list and it will return every channel opened up on the server. I'm wanting it to display a logo beside the registered channels.