flOid
01-11-2008, 12:28 PM
I'm just at programming my first vBulletin plugin. It's supposed to display current users in a IRC chat room using the a mysql statserv database. Here's the code, hook location is forumhome_start (should display within the "What's going on" section):
$doQuery=$db->query_read("SELECT nick FROM denora.user WHERE hostname NOT LIKE 'localhost.net' AND hostname NOT LIKE '%mydomain.tld%' AND online = 'Y'");
$numrows=mysql_num_rows($doQuery);
$chatters2 = "";
if($numrows>0)
{
while($chatters=mysql_fetch_array($doQuery))
{
$chatters2 .= $chatters[0];
$chatters2 .= ", ";
}
}
$chatusers = substr_replace($chatters2,"",-2);
The general code used to work in my previous IPB. However, it's just not working when I put the $chatusers variable now in the forumhome template.
What am I missing?
$doQuery=$db->query_read("SELECT nick FROM denora.user WHERE hostname NOT LIKE 'localhost.net' AND hostname NOT LIKE '%mydomain.tld%' AND online = 'Y'");
$numrows=mysql_num_rows($doQuery);
$chatters2 = "";
if($numrows>0)
{
while($chatters=mysql_fetch_array($doQuery))
{
$chatters2 .= $chatters[0];
$chatters2 .= ", ";
}
}
$chatusers = substr_replace($chatters2,"",-2);
The general code used to work in my previous IPB. However, it's just not working when I put the $chatusers variable now in the forumhome template.
What am I missing?