Facebook like chat for elgg
Here is the FreiChatx integration for Elgg 1.8. This plugin will add a live chat to your Elgg site just like facebook or google chat. Powered by php and jQuery.
Supported version Elgg 1.8 .
Downloads for older version available at http://code.google.com/p/frei-chat/downloads/list
Bugs, support questions etc.. @ http://code.google.com/p/frei-chat/
Original Project can be found at @ http://evnix.com/drupal2/
Installation Information (Please follow strictly)
- BACKUP your Elgg DATABASE
- Download the plugin from here
- Unzip > Upload to mod/
- Enable it in the Administration > Plugins
- Click on Chat > Settings
- Follow Step 1 (install the chat) (don’t turn on chat with out installing it)
- Click on the install link and it will open in a new tab
- Accept the license and click agree
- Select the CMS as Elgg and hit Submit
- Now you will be presented with an error message that the settings.php is not readable. Change the path of the settings.php to your_elgg_installation_path/engine/settings.php and hit submit*
- The error should disappear now and click on submit
- Your Elgg site’s Database details will be shown on next page. Input your specific password for the chat admin panel and save it
- Now you will be taken to a page. Leave it there and come back to Elgg > Administration > Plugins > Chat > Settings
- Turn on the chat (Step 2)
- If you need, you can configure the chat options by clicking on the chat admin link in Elgg > Administration > Plugins > Chat > Settings
To Upgrade :
- Backup your exisitng plugin
- Overwrite all the files excluding the arg.php & config.dat located inside your_elgg\mod\chat\vendors\freichat
- Remove the folder named “page” and its contents from mod\chat\views\default (If any exists)
Tips (By Matt Beckett of Elgg community):
- The default configuration allows anonymous users to chat also, this can be removed by changing line 3 of views/default/chat/chat.php to
if (elgg_get_plugin_setting(‘chat_installed’, ‘chat’) == ‘yes’ && isloggedin()) {
- if you want chat between friends only, here’s an answer.Edit the file /vendors/freichat/server/drivers/elgg.php. Go to the bottom of the file and find this code:
// 7. Get Appropriate UserData from FreiChatX Table
if ($this->usr_list_wanted == true) {
$result = $this->getList();Directly below this line, and before the “return $result;” add the following code:
$query = “SELECT guid_two FROM ” . DBprefix . “entity_relationships WHERE guid_one = ” . $_SESSION[$this->uid . 'usr_ses_id'] . ” AND relationship = ‘friend’”;
$friendsarray = $this->db->query($query)->fetchAll();//fix odd result format
$friends = array();
foreach($friendsarray as $array){
$friends[] = $array[0];
}if(count($friends) == 0){
// we have no friends
// so we can’t see anyone online
$result = array();
}
else{
//filter the list by friends now
for($i=0; $i<count($result); $i++){
if(!in_array($result[$i]['session_id'], $friends)){
// this user is not our friend, remove them
unset($result[$i]);
}
}
}$result = array_values($result);
Disclaimer : This is a third party integration for Elgg. Team Webgalli won’t be responsible for any error / security bugs happening to your site due to errors in this library. Use at your own risk
The original project can be found at : http://code.google.com/p/frei-chat/
Bugs, support questions etc.. @ http://code.google.com/p/frei-chat/
Hope you like it







0 Comments