Joomla

Step 1:
Visit CometChat Administration Panel->Click on Add CometChat tab and fill the following details:

a) Site URL: Enter your domain name without http

b) Platform: Select ‘Joomla’ from the drop-down

Click on ‘Save’ button.

joomlaadmin

Step 2:
a) Visit the ‘Add CometChat’ tab to get the HTML code that you need to add to your site’s template. Now, login to your Joomla Administration and go to Extensions->Template Manager->Active template and add the below code and CometChat HTML code just before </head> tag.

<?php
$chat_id = $chat_name = $chat_avatar = $chat_link = $chat_displayname = '';
$user = JFactory::getUser();
if (!$user->guest) {
	$chat_id = $user->id;
	$chat_name = $user->username;
	$chat_displayname = $user->name;
	/*If you are using JomSocial also add the below code:*/
	/****START****/
	if(class_exists('CFactory')) {
		$cuser = CFactory::getUser($chat_id);
		$chat_avatar = $cuser->getThumbAvatar();
		$chat_link = JURI::base().'?option=com_community&view=profile&userid='.$chat_id;
	}
	/****END****/
}
?>
<script>
	var chat_id = '<?php echo $chat_id; ?>';
	var chat_name = '<?php echo $chat_name; ?>';
	var chat_avatar = '<?php echo $chat_avatar; ?>';
	var chat_link = '<?php echo $chat_link; ?>';
	var chat_displayname = '<?php echo $chat_displayname; ?>';
</script>

joomlafloat

b) To embed CometChat to your site, visit “Add CometChat” tab in CometChat Administration Panel and copy the HTML code displayed in the section “Embed CometChat in your site page” and paste it to the page where you want to embed CometChat.

joomlaembed

Not finding what you need?

The CometChat team is here to help!