Skip to:
Content
Pages
Categories
Search
Top
Bottom

Help with Cometchat

  • @kgumhiok

    Participant

    I have this code, but is not working, any help to make it work with buddypress?

    function getUserID() {
    
    $userid = 0;	
    
    if (!empty($_SESSION['basedata']) && $_SESSION['basedata'] != 'null') {
    
    		$_REQUEST['basedata'] = $_SESSION['basedata'];
    	}
    
    	if (!empty($_REQUEST['basedata'])) {
    
    		if (function_exists('mcrypt_encrypt')) {
    
    			$key = KEY_A.KEY_B.KEY_C;
    
    			$uid = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($_REQUEST['basedata']), MCRYPT_MODE_CBC, md5(md5($key))), "");
    
    			if (intval($uid) > 0) {
    
    				$userid = $uid;
    
    			}
    
    		} else {
    
    			$userid = $_REQUEST['basedata'];
    
    		}
    
    	}
    
    	if (!empty($_SESSION['userid'])) {
    
    		$userid = $_SESSION['userid'];
    	}
    
    	$userid = intval($userid);
    
    	return $userid;
    }
    
    function chatLogin($userName,$userPass) {
    
    	$userid = 0;
    	if (filter_var($userName, FILTER_VALIDATE_EMAIL)) {
    
    		$sql = ("SELECT * FROM <code>&quot;.TABLE_PREFIX.DB_USERTABLE.&quot;</code> WHERE email ='".$userName."'");
    
    	} else {
    
    		$sql = ("SELECT * FROM <code>&quot;.TABLE_PREFIX.DB_USERTABLE.&quot;</code> WHERE username ='".$userName."'");
    
    	}
    
    	$result = mysql_query($sql);
    
    	$row = mysql_fetch_array($result);
    
    	$salted_password = md5($row1['value'].$userPass.$row['salt']);
    
    	if ($row['password'] == $salted_password) {
    
    		$userid = $row['user_id'];
    
    	}
    
    	if ($userid && function_exists('mcrypt_encrypt')) {
    
    		$key = KEY_A.KEY_B.KEY_C;
    
    		$userid = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $userid, MCRYPT_MODE_CBC, md5(md5($key))));
    
    	}
    
    	return $userid;
    }
    
    function getFriendsList($userid,$time) {
Viewing 2 replies - 1 through 2 (of 2 total)
  • @danbp

    Participant

    Hi @kgumhiok,

    you say nothing about what you want to do ! And you use a premium plugin which is not part of BuddyPress. Sorry but i’m afraid we can’t help you. Ask eigther on plugin support.

    @kgumhiok

    Participant

    Oh i just dont know how to integrate cometchat with buddypress so it takes friends and recognice logged in users, i dont know if there is something i need to mod on that code

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help with Cometchat’ is closed to new replies.
Skip to toolbar