Codeigniter

CodeIgniter Chat Integration – Enable Real Time Chat Between Users

Creating an engaged community takes much more than an interesting idea. With CometChat’s ready-to-use chat API, it only takes seconds to add chat to your CodeIgniter website and help achieve increased user engagement and retention.

Don’t believe us? Go ahead and try our 7-day free trial and find out for yourself!

codeigniter chat

How CometChat works with CodeIgniter websites

All it takes is 3 simple steps & less than 5 minutes to set up real time chat on your website

Step 1

Register with CometChat

Signup for a free trial with CometChat to get your API key for installation

Step 2

Copy-paste the code to intialise chat

Copy and paste the code before </body> tag on every page you want CometChat to appear

Step 3

Chat is up and running

That’s all! Your website is chat-ready now. You can further customise the chat settings from Admin Panel

                      <script>
						var chat_appid = 'APP_ID';
						</script>
						session->userdata('id') && $this->session->userdata('id') > 0) { ?>
						 <script>
							var chat_id = "<?php echo $this->session->userdata('id'); ?>";
							var chat_name = "<?php echo $this->session->userdata('name'); ?>"; 
							var chat_link = "<?php echo $this->session->userdata('link'); ?>"; //Similarly populate it from session for user's profile link if exists
							var chat_avatar = "<?php echo $this->session->userdata('avatar'); ?>"; //Similarly populate it from session for user's avatar src if exists
							var chat_role = "<?php echo $this->session->userdata('role'); ?>"; //Similarly populate it from session for user's role if exists
							var chat_friends = '<?php echo $this->session->userdata('friends'); ?>'; //Similarly populate it with user's friends' site user id's eg: 14,16,20,31
							</script>
						
						<script>
						(function() {
						    var chat_css = document.createElement('link'); chat_css.rel = 'stylesheet'; chat_css.type = 'text/css'; chat_css.href = 'https://fast.cometondemand.net/'+chat_appid+'x_xchat.css';
						    document.getElementsByTagName("head")[0].appendChild(chat_css);
						    var chat_js = document.createElement('script'); chat_js.type = 'text/javascript'; chat_js.src = 'https://fast.cometondemand.net/'+chat_appid+'x_xchat.js'; var chat_script = document.getElementsByTagName('script')[0]; chat_script.parentNode.insertBefore(chat_js, chat_script);
						})();
					</script>
				

                    

                      <script>
var chat_appid = 'APP_ID';
</script>
session->userdata('id') && $this->session->userdata('id') > 0) { ?>
 <script>
	var chat_id = "<?php echo $this->session->userdata('id'); ?>";
	var chat_name = "<?php echo $this->session->userdata('name'); ?>"; 
	var chat_link = "<?php echo $this->session->userdata('link'); ?>"; //Similarly populate it from session for user's profile link if exists
	var chat_avatar = "<?php echo $this->session->userdata('avatar'); ?>"; //Similarly populate it from session for user's avatar src if exists
	var chat_role = "<?php echo $this->session->userdata('role'); ?>"; //Similarly populate it from session for user's role if exists
	var chat_friends = '<?php echo $this->session->userdata('friends'); ?>'; //Similarly populate it with user's friends' site user id's eg: 14,16,20,31
	</script>

<script>
var chat_height = '600px';
var chat_width = '990px';

document.write('<div id="cometchat_embed_synergy_container" style="width:'+chat_width+';height:'+chat_height+';max-width:100%;border:1px solid #CCCCCC;border-radius:5px;overflow:hidden;"></div>');

var chat_js = document.createElement('script'); chat_js.type = 'text/javascript'; chat_js.src = 'https://fast.cometondemand.net/'+chat_appid+'x_xchatx_xcorex_xembedcode.js';

chat_js.onload = function() {
    var chat_iframe = {};chat_iframe.module="synergy";chat_iframe.style="min-height:"+chat_height+";min-width:"+chat_width+";";chat_iframe.width=chat_width.replace('px','');chat_iframe.height=chat_height.replace('px','');chat_iframe.src='https://'+chat_appid+'.cometondemand.net/cometchat_embedded.php'; if(typeof(addEmbedIframe)=="function"){addEmbedIframe(chat_iframe);}
}

var chat_script = document.getElementsByTagName('script')[0]; chat_script.parentNode.insertBefore(chat_js, chat_script);
</script>

                    

These companies are changing the world. Like others, they’re using CometChat

Get the best of CometChat on your CodeIgniter Website

Communication

Allow your users to connect with each other using CometChat’s communication features. Users can use features like real-time text chat, voice & video calling, real-time language translation, broadcasting and more.

Users can have personal and group text chats, They can make conversations even more expressive with classic emojis or choose from our vibrant set of stickers.

Users can communicate with each other by Voice & Video Calls and Conferences for a more personalised conversations.

Users can connect with each other without any barriers. Users can translate their conversations easily and receive all incoming conversations in a language that they are most comfortable.

Users can not only chat with each other but also share photos, documents, spreadsheets and a bunch of other stuff in a snap.

Users can Broadcast videos or text messages to multiple users at the sametime.

CometChat Voice & Video Calling & ConferenceCometChat One-on-one Chat & Group ChatCometChat Real-time Language TranslationCometChat Broadcast Voice, Video & Text ChatCometChat File Sharing

Collaborate

Users can collaborate with each other using CometChat’s collaboration tools. They can share files using the file sharing features. Users can also sketch their ideas on a virtual whiteboard and work on a collaborative document all in real time.

With collaborative whiteboard, users can sketch, drawn and share ideas & thoughts to life all in realtime on a virtual whiteboard

Users can collaborate and work on a single document ensuring they can achieve more whilst staying on your website.

CometChat Collaborative WhiteboardCometChat Collaborative Writeboard

Monetize

CometChat comes with distinct features dedicated solely towards monetizing your website.

CometChat has distinct features dedicated solely towards monetizing your website. Role based access control can be used to restrict CometChat features to specific user roles allowing monetization opportunities for you.

Credit deduction feature allows you to deduct credits from user accounts if and when they use different CometChat features

The In-App Advertisements feature can be used to add ads to chat window and generate extra revenue.

CometChat Role Based Access ControlCometChat Credit DeductionCometChat Custom Advertisement

Customize

You can customize CometChat to fit your needs. Customize various aspects of CometChat, right from color to language, whatever suits your website.

Tweak and change CometChat settings from the Admin Panel to make CometChat fit your need.

Customize the colors of your Chatroom by choosing from hundreds of color options in CometChat.

Choose between CometChat’s Docked and Embedded Layouts to find whats suits your website best.

You can also localize CometChat to the language of your choice. Users can select from over 9 languages.

CometChat Fine Tune SettingsCometChat Colors CometChat LanguagesCometChat Multiple Layouts
CometChat