Version: 1.00, by ICThawk
Developer Last Online: Mar 2014
Category: Chat Modifications -
Version: 4.1.4
Rating:
Released: 08-31-2011
Last Update: Never
Installs: 15
Uses Plugins
Re-useable Code Translations
No support by the author.
So I have been using vBulletin for awhile and have been very frustrated with the current lack of integration with AJAX Chat by blueimpu. So, I have decided to do the integration myself and with the help of other users on vB.org I have put together a few plugins.
Add Popup Link for Chat:
I started by adding in the Chat popup link to my navbar. In your navbar template, add the following code to display the Chat Link.
Displaying UserNames of Those Online:
Just like in the above there are two parts to this plugin. Modifying a template and creating a plugin. First we need to modify your FORUMHOME template. Right below the <!-- end logged in users --> line add the following.
HTML Code:
<!-- chat users --><div id="wgo_onlineusers" class="wgo_subblock section"><h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/users_online.png" alt="Users In Chat" />{vb:raw num_chatting} Users In Chat</h3><div><p>{vb:raw chat_userlist}</p></div></div><!-- end chat users -->
Next we need to create a new plugin. The Hook is global_start and the PHP code is:
PHP Code:
global $vbulletin;
$results = $vbulletin->db->query_read_slave("SELECT userName FROM ajax_chat_online");
while ($row = $vbulletin->db->fetch_array($results))
$chat_userlist[] = $row['userName'];
if (is_array($chat_userlist))
{
$chat_userlist = implode(', ', $chat_userlist);
$vbulletin->db->free_result($results);
}
else
{
// set $chat_userlist to a "no one chatting" message if you want, or leave blank.
$chat_userlist = '';
}
vB_Template::preRegister('FORUMHOME', array('chat_userlist' => $chat_userlist));
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I was wondering if anyone had luck or knows how to make the chat window show on the forum home page also that way if no one wanted to have it in a popup they can just have it on the page under the navbar.
That's what the second half ICThawk's original post does for you. Look carefully at the "Displaying the UserNames of Those Online" section. Those two pieces of code will show the usernames of users that are chatting. Just don't forget to turn on the plugin after you create it (I keep doing that and wondering why my plugin doesn't work...
Unless I'm missing something this is for the Forum, not a CMS widget. When I add the code to a widget (not the plugin code) it just generates an error.
Can anyone tell me if the BlueImp chat has a private chat function?
It does. I was trying to determine this without installing it.
Another question. Has anyone figured out how to integrate it into VB so that you can click on a username and go to their profile to see more than just the username?
Is there a way to do this with a variable height, so that the iframe takes up all space on the screen without causing scrollbars AND the header/footer remains on the page? My Google-Fu with this seems to be super weak.