News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

cometchat 2.04 + smf 2

Started by !RFAN, January 18, 2011, 09:58:21 PM

Previous topic - Next topic

!RFAN

i want to integrate cometchat and smf 2

i installed it and its login function is working fine... which means "Who is online" is visible to members who are logged in .. otherwise it shows a notification to log in..
but it never shows the name of members logged in..

can anybody tell me how can i integrate it??
Cometchat supports only smf 1+ and not smf 2

i think there are some changes required in integration.php

file is attached..

!RFAN

little more information: i have ultimate profile installed..

!RFAN

sorry for disturbing guys.. i have done it :D

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

!RFAN

yup, why not.
but i'm still working on some issues of it. like screen share and a/v chat are not working. let me do it then i'll share all the info

khemara

I think cometchat already released the official support version for SMF.

!RFAN

Yess you are right but that is for smf 1.1+ only not for smf2

khemara

Hm. If we want to install it manually, here is the guide: http://www.cometchat.com/knowledgebase/installation/install-cometchat-with-smf

I guess that link might be available only for their customers.

!RFAN


theshiningeagle

rfan

im realy realy tired from tring to make this intgration

can you please tell me how to do it
for sm 1.1.2 for smf 2.0 any one of those

and hey the tutorial on cometchat site is realy funny
anyone knows how to copy the bar and put it and anyone knows install.php good
and is the av chat , screenshare and send file is working ? or not \\\

if u learn me how to do it i will make a video tutorial with easy step by step way for the people who suffer like me and you in the past

i will be very thankful

!RFAN

#10
i can do

PS.. everything is working perfectly for me

evilgeniusxp


evilgeniusxp

this is what !RFAN pm'd me

Quote from: !RFAN on February 19, 2011, 08:00:33 PM
yes why not? :D
what i will get in return??

Thanks


you will get my thanks in return.... actually you will not get anything because you dont deserve anything.... keep your secrets... dont help anyone else out.. be a douche... i bet you dont even have it working anyway. i have other resources..

Rhineus

#13
Hello,

I can't get this installed... It's giving me 3 errors and it says it can't connect to the database. As you can see here "http://forum.my-poetry.co.cc/cometchat/install.php [nofollow]". I've uploaded to my smf forum like this...
  my-poetry.co.cc/ccpic.php [nofollow]
and
  my-poetry.co.cc/cometchat/ [nofollow]

Except I don't have vbpic.php, I have ccpic.php, but that how it was when I downloaded it. I have cometchat version 2.04 and SMF 2.0 as well. Maybe it don't like sub-domains. Can anyone help? Thx :)

EDIT: Changed the site links

NoFeaR / NFSMW


!RFAN

i can provide integration services. :)
I have done it on my site.

ProtoGT

Open integration.php, starting at line 31 look for the following values/code like below then replace it with the code below. Other option is to download the attached file to replace your current integration.php. This will fix any issues you may have with CC and SMF.

define('DB_USERTABLE','members');
define('DB_USERTABLE_NAME','real_name');
define('DB_USERTABLE_USERID','id_member');
define('DB_USERTABLE_LASTACTIVITY','last_login');
define('ADD_LAST_ACTIVITY', '1');
define('DISPLAY_ALL_USERS', '1');
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/* FUNCTIONS */

function getUserID() {
$userid = 0;
global $cookiename; //from Settings.php

if(isset($_COOKIE[ $cookiename ]) && !empty($_COOKIE[ $cookiename ]))
{
$cookie = $_COOKIE[$cookiename];
$user_settings = unserialize($cookie);

if(isset($user_settings[0]) && !empty($user_settings[0]))
{
$userid = $user_settings[0];
}
}

return $userid;
}


function getFriendsList($userid,$time) {

if (defined('DISPLAY_ALL_USERS') && DISPLAY_ALL_USERS == 1) {
$sql = ("select DISTINCT ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." userid, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_NAME." username, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_LASTACTIVITY." lastactivity, CONCAT(".TABLE_PREFIX.DB_USERTABLE.".avatar, '^',COALESCE((SELECT concat (ID_ATTACH,'_', file_hash) from ".TABLE_PREFIX."attachments where ".TABLE_PREFIX."attachments.".DB_USERTABLE_USERID." = ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID."),'')) avatar, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." link, cometchat_status.message, cometchat_status.status from ".TABLE_PREFIX.DB_USERTABLE." left join cometchat_status on ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = cometchat_status.userid where ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." <> '".mysql_real_escape_string($userid)."' and ('".$time."'-lastactivity < '".((ONLINE_TIMEOUT)*2)."') and (cometchat_status.status IS NULL OR cometchat_status.status <> 'invisible' OR cometchat_status.status <> 'offline') order by username asc");
}
else  {

$sql = "select buddy_list from ".TABLE_PREFIX."members where ID_MEMBER = '".mysql_real_escape_string($userid)."'";

$res=mysql_fetch_array(mysql_query($sql));

$sql = ("select DISTINCT ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." userid, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_NAME." username, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_LASTACTIVITY." lastactivity, CONCAT(".TABLE_PREFIX.DB_USERTABLE.".avatar,'^',COALESCE((SELECT concat (ID_ATTACH,'_', file_hash) from ".TABLE_PREFIX."attachments where ".TABLE_PREFIX."attachments.".DB_USERTABLE_USERID." = ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID."),'')) avatar, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." link, cometchat_status.message, cometchat_status.status from ".TABLE_PREFIX.DB_USERTABLE." left join cometchat_status on ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = cometchat_status.userid where ".TABLE_PREFIX.DB_USERTABLE.'.'.DB_USERTABLE_USERID." IN (".$res[0].") order by username asc");
}

return $sql;
}

function getUserDetails($userid) {
$sql = ("select ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." userid, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_NAME." username, ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_LASTACTIVITY." lastactivity,  ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." link,  ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." avatar, cometchat_status.message, cometchat_status.status from ".TABLE_PREFIX.DB_USERTABLE." left join cometchat_status on ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = cometchat_status.userid where ".TABLE_PREFIX.DB_USERTABLE.".".DB_USERTABLE_USERID." = '".mysql_real_escape_string($userid)."'");
return $sql;
}

function updateLastActivity($userid) {
$sql = ("update `".TABLE_PREFIX.DB_USERTABLE."` set ".DB_USERTABLE_LASTACTIVITY." = '".getTimeStamp()."' where ".DB_USERTABLE_USERID." = '".mysql_real_escape_string($userid)."'");
return $sql;
}

function getUserStatus($userid) {
$sql = ("select cometchat_status.message, cometchat_status.status from cometchat_status where userid = '".mysql_real_escape_string($userid)."'");
return $sql;
}

function getLink($link) {
    return BASE_URL.'../index.php?action=profile;u='.$link;
}

function getAvatar($image) {

$avatar = explode("^", $image);
$mem_avatar = $avatar['0'];
$id_attach = $avatar['1'];


    if(!empty($mem_avatar))
{

if (is_file(dirname(dirname(__FILE__)).'/avatars/'.$mem_avatar))
{
return BASE_URL.'../avatars/'.$mem_avatar;
}
else
{
return $mem_avatar;
}
}
else
{

if(!empty($id_attach))
{


if (is_file(dirname(dirname(__FILE__)).'/attachments/'.$id_attach))
{
copy(dirname(dirname(__FILE__))."/attachments/".$id_attach ,dirname(dirname(__FILE__))."/cometchat/images/".$id_attach) ;
return BASE_URL.'../images/'.$id_attach;

}
else
{
return BASE_URL.'../images/noavatar.gif';
}


}
else
{
return BASE_URL.'../images/noavatar.gif';
}
}

}


function getTimeStamp() {
return time();
}

function processTime($time) {
return $time;
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/* HOOKS */

function hooks_statusupdate($userid,$statusmessage) {

}

function hooks_forcefriends() {

}

function hooks_activityupdate($userid,$status) {

}

function hooks_message($userid,$unsanitizedmessage) {

}

!RFAN


WinkWay

Hey guys,

Thanks for all the help people have posted so far on this thread. I am installing cometchat for my SMF forum too and its almost finished but im on a small issue like another on here..

I am logged in and I see this on my CometChat bar - "You have no friends in your friends list, Please add a few friends to use chat".

i tried adding a few people to 'Buddys' via their profile, they came online but it still said the same message. So I went into integrate.php and changed it to show ALL users regardless if your friends with them, even with that it shows that no one is online.

I've checked the database driven thing in settings etc and everything mentioned in this thread but cant get it to show who is online. Here is a little extract from my Integrate.php, I changed the usertable table to match with the default smf_members but the rest I dont know if they need changing.

define('DB_USERTABLE',            'smf_members'                              );
define('DB_USERTABLE_NAME',         'real_name'                        );
define('DB_USERTABLE_USERID',      'id_member'                        );
define('DB_USERTABLE_LASTACTIVITY',   'last_login'                                     );
define('ADD_LAST_ACTIVITY', '1');
define('DISPLAY_ALL_USERS', '1');

Anything else I should check?

Jordan
http://www.here4there.com [nofollow]
(Demo Account) User - Demo1 Password password

razors edge

If you purchase the version which includes AV chat they will do the installation and integration for you. If you were having trouble doing the integration and getting AV chat to work, this tells me you do not have a legit copy of the software.


Advertisement: