Please Help to Install CometChat in Elgg 1.8.19!!!

Hii...I am new in Elgg and I have learn a lot of things about manage it, but... I'm really confuse about something: I can't make the cometchat run anymore! I found the <head> tag (they teach you to put the code in the 1.7 version, but in the 1.8.19 Elgg the tag and the rest is placed in: >views/default/page/default.php. So... I put my code:

<link type="text/css" href="/; rel="stylesheet" charset="utf-8">
<script type="text/javascript" src="/; charset="utf-8"></script> 

( I put the directory after try without, just to see if could work ;( ...)

the code they gave me:

<link type="text/css" href="/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8">

<script type="text/javascript" src="/cometchat/cometchatjs.php" charset="utf-8"></script>

And nothing appears on my website );

I hope someone could help me... 

I hosted my elgg on Byethost24, and in another version the chat worked right, so.. I think that's something missing to do or...i don't know... Just waiting for some tips and help (;

Thank you everybody!



  • You need to create the separate plugin for it

    Add in your start.php

    function cometchat_init() {
        elgg_extend_view('page/elements/head', 'cometchat/cometchat');

    Create file cometchat\views\default\cometchat\cometchat.php and add:



    <link type="text/css" href="/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8">

    <script type="text/javascript" src="/cometchat/cometchatjs.php" charset="utf-8"></script>

    Be sure, that CometChat's location is right in there

  • Thank you so much @RvR! I'll try it right now! Thanks a lot, i hope it works! ;D

  • Hii, I tryed it but, i think something is wrong... i created the files and put it in cometchat's directory, but, after i activated the plugin it just not works... Did i something wrong? Missing files to convert it in a plugin or a wrong directory? I'ld apreciate your help! Thank you for your reply!

  • Where is CometChat's location? Did you install it? Configurate?

    If you installed cometchat on your server already and its location is http://your-site/cometchat then you could try my example\skeleton plugin.

    Sic! It's NOT a plugin with integrated CometChat, just an example for you.

    Put it in mod folder of your server and activate after.

    Your files/folders structure must be:

    cometchat (your vendor)
    ------- / cometchat
    (my skeleton)


    If you want to use CometChat for Elgg then you need buy it via official website

  • Oh..I'll try your skeleton and example, but I have my Cometcha Integration for Elgg, but the problem is, after the installation, I can't find the correct place to put it, and it don't run anyway :/ Thank you for your tips, I'll try right now!

  • @Anna


    Cometchat is a commercial product, and they provide elgg support for their chat. Making it as a plugin will not work, since it works in a different way. Try getting support from them.

  • @RJ I tryed to contact. but they said me that I have to do it myself, or they can help me to install, but it's paid. The problem isn't the installation, it's when I try to make it run, for example:

    In elgg 1.7 the head.php file has the <head> tag, as a html document, but, in the elgg 1.8 and 1.9, the head.php file, neither header.php file has the tag, or something like that...and if a post the code I get from cometchat install, it brokes. So, I'm trying to find the right place to put it, but i'ts really hard to me haha I found the html.php file, and nothing change after I try to put the code there. Any tip or help will be apreciated, if someone could tell me where find the correct file, either how to install it in elgg 1.9 (;

  • @AnnaKatherina Please followup on the problem here. Did you try contacting cometchat support?

    The <head> tag is in though you shouldn't edit it directly, but rather create the plugin that will extend page/elements/head view or more properly, use elgg_register_js, elgg_register_css, elgg_load_js, elgg_load_css functions.

    RvR gave you good explanation on how to create plugin.

  • Thank you a lot for your help! I'll try something!