Chatbox module tutorial

Last modification: 2013-10-13 06:00:53

This module brings standard shoutbox/chatbox functionality. But it's mutch more flexible.

Some main features

  • Option to embed directly in page.
  • Each page can have separate chatbox. Let say each event should have it's own chatbox. It's peace of cake to do it with Live Helper Chat
  • Option to have a widget

How to make separate chatboxes for different pages?

There are two options to make this work

  1. "Auto creation by chatbox identifier enabled" check this in Chatbox general settings page. Checking this item eliminates permission checking. So withing every unique dientifier chat will be created. I recommend user this one only if you are using it in intranet envireoment etc. Second option is much more advanced and should be used in general.
  2. Do not check above item and use secret hash.

<script type="text/javascript">
var LHCChatboxOptions = {hashchatbox:'empty',identifier:'article_id_1',status_text:'Chatbox'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'http://demo.livehelperchat.com/index.php/chatbox/getstatus/(position)/bottom_right/(top)/300/(units)/pixels/(width)/300/(height)/300/(chat_height)/220';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>

Here is algorithm how hashchatbox value should be calculated. In our case identifier is article_id_1 and let say secret hash is change_me.

hashchatbox = <?php echo sha1('change_me'.sha1('change_me'.'article_id_1'))?>

So our final embed script value should look like.

<script type="text/javascript">
var LHCChatboxOptions = {hashchatbox:'<?php echo sha1('change_me'.sha1('change_me'.'article_id_1'))?>',identifier:'article_id_1',status_text:'Chatbox'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'http://demo.livehelperchat.com/index.php/chatbox/getstatus/(position)/bottom_right/(top)/300/(units)/pixels/(width)/300/(height)/300/(chat_height)/220';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>

Also need to notice that page ambed and widget embed has different variables options variable:

LHCChatboxOptionsEmbed - for page embed

LHCChatboxOptions - for widget

Also we support now defined nick and option to disable nick change. Example

var LHCChatboxOptions = {identifier:'default',status_text:'Chatbox','nick':'remdex44','disable_nick_change':true};

var LHCChatboxOptionsEmbed = {identifier:'default','nick':'remdex44'};

If you ommit nick and disable_nick_change variables that means that user can change his nick.

Example:

 

Support project

Developing application takes a lot of time. You can support application by donating. There is no company behind this application and it takes away my free time. Every donation matters and does not matter how small it is!


Paypal, one time donation
Monthly donation
Bitcoin
Skrill
remdex@gmail.com