...

View Full Version : Roomlist help



Whatnot
02-01-2012, 05:02 PM
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


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

mlseim
02-01-2012, 05:20 PM
$room = $match[3];
$room = str_replace("#","",$room);

Whatnot
02-02-2012, 05:38 AM
Thank you
works :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum