{"desc":"The ChatBox is comming soon. It will be available in version 3.6."}
 

FCChat – The Global Configuration Template

Index Using the global configuration template to acheive seemless updates.


where is it

Please note: This topic does not apply to WordPress, Joomla 1.6+, Drupal 7+, or PhpBB 3+ installations, which have a built in configuration and support for automatic updates.

If you are not using one of the above, then editing the global configuration template (FCChat/config/global.config.js) is the recommended way to configure your chat. Of course, you can also edit the main configuration file (FCChat/config/config.js) directly, but the drawback of doing this is that your configuration will not be saved when you update the chat, unless you make a backup of the config file before updating, and manually re-implement it in the updated version.

FCChat is updated frequently, with a new version coming out about every 2 weeks. To take advantage of this, you will want to make these updates as easy and automatic as possible. The global configuration template allows you to acheive this.

Setting up the FCChat Global Configuration Template

The global configuration template file (global.config.js) is found in the FCChat/config/ folder. You will need to copy this file to the root of your site, so that it can be accessed from http://www.yoursite.com/global.config.js. Your site’s root directory is where FCChat looks for this file, by default.

Configuring your chat with the FCChat Global Configuration Template

Now that the global.config.js file has been copied to the root directory of your site, you may use this file to configure your chat. Open the file with a text editor. The first section of this file, shown below, contains an area where you will put your configuration changes.

/*
* GLOBAL CONFIGURATION FILE
* 
* Refer to tutorial: http://www.fastcatsoftware.com/chat/userguide/globalconfig.asp 
* 
*/
(function(){
	
FCChatConfig.global = {
/************** Global config vars go here  **************************************************/
/* Example: hides the embedded chat widget. Uncomment to try*/		
//control_visible:false,


You will add your configuration changes after the line that says “Global config vars go here”.

The first thing you will want to do is copy your chat_id and host parameters into this file, placing them like this:
/*
* GLOBAL CONFIGURATION FILE
* 
* Refer to tutorial: http://www.fastcatsoftware.com/chat/userguide/globalconfig.asp 
* 
*/
(function(){
	
FCChatConfig.global = {
/************** Global config vars go here  **************************************************/
chat_id:"1234",
host:"1.1.1.128",
/* Example: hides the embedded chat widget. Uncomment to try*/		
//control_visible:false,


Of course, we have just used dummy values for the chat_id and host parameters. You will insert your own, site specific values.

The file FCChat/config/config.js (which we refer to as the main configuration file) holds all the configuration settings for the chat client, whereas the global.config.js file is basically a blank template. The idea behind the global configuration template is that you will copy settings that you want to change from the main configuration file to the global.config.js file, and then make changes to them there. These changes will then override the default values in the main configuration file.

Here is an example.

Let’s say you want to change the default language from english to spanish.

In the main configuration file, there is an option for setting the language:
language_template:"english.js",

You will copy this line to the global.config.js file, and then change the language to spanish. Now your global.config.js file might look like this:
/*
* GLOBAL CONFIGURATION FILE
* 
* Refer to tutorial: http://www.fastcatsoftware.com/chat/userguide/globalconfig.asp 
* 
*/
(function(){
	
FCChatConfig.global = {
/************** Global config vars go here  **************************************************/
chat_id:"1234",
host:"1.1.1.128",
language_template:"spanish.js",
/* Example: hides the embedded chat widget. Uncomment to try*/		
//control_visible:false,


And that’s it. Your chat would, at this point, be in spanish.

A second example.

Next, we will change the style templates.

In the main configuration file, there is an option for setting the style templates:
templates:{
	alldomains:{
		widget:"widget_white_sidebar.js",
		toolbar:"toolbar_white.js",
		application_window:"chatcenter_white.js"
	}
},

Here, you have the choice of copying the entire excerpt above, or just a portion of it, to the global.config.js file. We will only be changing the “application_window” in this example, so we will not need the “widget” or “toolbar” options. Our global.config.js now looks like this:
/*
* GLOBAL CONFIGURATION FILE
* 
* Refer to tutorial: http://www.fastcatsoftware.com/chat/userguide/globalconfig.asp 
* 
*/
(function(){
	
FCChatConfig.global = {
/************** Global config vars go here  **************************************************/
chat_id:"1234",
host:"1.1.1.128",
language_template:"spanish.js",
templates:{
	alldomains:{
		application_window:"chatcenter_midnight_blue.js"
	}
},
/* Example: hides the embedded chat widget. Uncomment to try*/		
//control_visible:false,


Note: if you alter the structure of an option, as we have done above, make sure the placement of commas is correct. A comma should never be followed by a right brace, as this may cause the chat to malfunction.

Wrapping it up

You may copy any parameter from the main configuration file to the global.config.js file, and set it according to your needs. And, once more, these changes will override any settings found in the main configuration file.

If you have any questions about setting up or implementing the global configuration for your site. Contact us at support@fastcatsoftware.com.




Solution Graphics