Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
AJAX Chat Integration Details »»
AJAX Chat Integration
Version: 1.00, by ICThawk ICThawk is offline
Developer Last Online: Mar 2014 Show Printable Version Email this Page

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.

HTML Code:
<a class="navtab" href="#" onClick="MyWindow=window.open('http://www.wavingthewheat.com/chat/index.php','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=800,height=600'); return false;">Chat ({vb:raw num_chatting})</a>
Next you will need to create a new plugin. Set the Hook Location to global_bootstrap_init_start and add the following into the PHP Code box.

PHP Code:
$result mysql_query("SELECT * FROM ajax_chat_online");   
$num_chatting mysql_num_rows($result);   
vB_Template::preRegister('navbar',array('num_chatting' => $num_chatting));
vB_Template::preRegister('FORUMHOME',array('num_chatting' => $num_chatting)); 


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.
2 благодарности(ей) от:
Pianobiz, trueoak

Comments
  #12  
Old 04-20-2012, 02:52 AM
oshrizak oshrizak is offline
 
Join Date: Dec 2011
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #13  
Old 05-22-2012, 08:32 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by feaelin View Post
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.
Reply With Quote
  #14  
Old 08-01-2012, 06:32 PM
thedukeboard thedukeboard is offline
 
Join Date: Jul 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is pretty much exactly what I was looking for.

Question/help:

I'd like to add that first bit of code that links to the chat and shows active users to be inside a navtab. Is this possible? Thanks in advance.
Reply With Quote
  #15  
Old 08-11-2012, 08:56 AM
dorans's Avatar
dorans dorans is offline
 
Join Date: Dec 2010
Location: Novi Sad, Srbija
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by feaelin View Post

Code:
{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
  <head>
    <title>{vb:raw vboptions.bbtitle}</title>
    {vb:raw headinclude}
  </head>
  <body>   
    {vb:raw header}
    {vb:raw navbar}

    <div class="blockbody">
      <div class="blockrow">
        <!-- Custom Code Start Here -->
        <center>
          <iframe src="http://DOMAINNAME.COM/chat/" width="80%" height="640>
          </iframe>
        </center>
        <!-- / Custom Code Ends here -->
      </div>
    </div>
    {vb:raw footer}
  </body>
</html>
Missing a quotation mark at the end ...
Attached Images
File Type: jpg AJAX Chat Integration - vBulletin.jpg (26.5 KB, 0 views)
Reply With Quote
  #16  
Old 08-22-2012, 04:44 PM
peppefark peppefark is offline
 
Join Date: Jun 2010
Location: Sicily ITALY
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

I installed the chat but I can not integrate with vbulletin, please help me!!!

thanks
Reply With Quote
  #17  
Old 09-03-2012, 01:40 AM
wishtheend wishtheend is offline
 
Join Date: Dec 2009
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any way to have this work with the vsa Chatbox?
https://vborg.vbsupport.ru/showthread.php?t=235271

Love that chat, but can't figure out how to get a Who's Chatting put together for that one.
Reply With Quote
  #18  
Old 09-03-2012, 09:49 PM
satwobex satwobex is offline
 
Join Date: Sep 2012
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello!

Where can I find the "hook"?

Thanks!
Reply With Quote
  #19  
Old 06-05-2013, 05:44 PM
JustAskJulie JustAskJulie is offline
 
Join Date: Nov 2002
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone tell me if the BlueImp chat has a private chat function?
Reply With Quote
  #20  
Old 06-15-2013, 04:38 PM
JustAskJulie JustAskJulie is offline
 
Join Date: Nov 2002
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JustAskJulie View Post
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?
Reply With Quote
  #21  
Old 06-20-2013, 05:47 AM
jonastio jonastio is offline
 
Join Date: Jun 2013
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by feaelin View Post
Code:
{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
  <head>
    <title>{vb:raw vboptions.bbtitle}</title>
    {vb:raw headinclude}
  </head>
  <body>   
    {vb:raw header}
    {vb:raw navbar}

    <div class="blockbody">
      <div class="blockrow">
        <!-- Custom Code Start Here -->
        <center>
          <iframe src="http://DOMAINNAME.COM/chat/" width="80%" height="640">
          </iframe>
        </center>
        <!-- / Custom Code Ends here -->
      </div>
    </div>
    {vb:raw footer}
  </body>
</html>
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:01 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09230 seconds
  • Memory Usage 2,351KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (2)bbcode_html
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete