Quote:
Originally Posted by hobbybox
Chris,
Id like to create a box in vBadvanced for this chat...I dont want a link on my Navbar...
What code can I use to call the names of those in the chat room into a box (i know the code for the box and what not) so they are listed 1 after another (with a scroll bar if needed)
|
If I understand correctly, you want to show a list of Who's Chatting in a box -- not the chat room itself?
For a who's chatting box, you'd basically just have to query the addonchat_who table (note that the vBulletin table prefix is not used) then parse the data for display -- usually you'd use a template and a cached template bit to display the content.
Here is a generic example of echoing the usernames using VB commands...
PHP Code:
$result = "";
$query = "SELECT id,username,subroom,hidden,uid,admin FROM addonchat_who";
$addonchat_who_list = $db->query_read($query);
while($addonchat_who = $db->fetch_array($addonchat_who_list) {
/* This is where you'd build your template guts (using a bit if needed) */
$result .= $addonchat_who['username'] . "<br>\n";
}
/* This is where you'd display your template */
print $result;