Help with Cometchat
-
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>".TABLE_PREFIX.DB_USERTABLE."</code> WHERE email ='".$userName."'"); } else { $sql = ("SELECT * FROM <code>".TABLE_PREFIX.DB_USERTABLE."</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)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Help with Cometchat’ is closed to new replies.