Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Roomlist help

  1. #1
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts

    Roomlist help

    ok my room list shows # before the name is there a way to remove it so that the link autojoin=blah&nick=blah
    not autojoin=#blah&nick=blah

    Code:
    <? include('includes/pages/header.php'); ?>
    
    <?php
    error_reporting(E_ALL ^ E_NOTICE);
            $botnick = "RoomLister";
            $server = "irc.zunkies.com";
            $port = "6667";
            $channel = "zunkies";
    ?>
    <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];
              $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>

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,495
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    $room = $match[3];
    $room = str_replace("#","",$room);

  • #3
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    Thank you
    works


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •