Jaime82
03-10-2009, 02:51 AM
Hi Everyone,
I'm trying to integrate the new version of Realchat and Vbulletin 3.7.0. Below I will post the code RealChat gives you to use to integrate it with Vbulletin. I need to know what to put where it says rawurlencode("test") for it to pull usernames from Vbulletin.
Any help would be greatly appreciated.
Thank you!
Jaime
<?php
/**
* Nickname, avatar and profile URLs.
* These are usually pulled from the database.
*/
$nickName = rawurlencode("test"); // rawurlencode is important
$profileURL = rawurlencode("http://www.example.com/");
$avatarURL = rawurlencode("http://www.example.com/avatar.jpg");
/**
* This string must match the Authentication Key, that you
* specified in the RealChat Control Center, Server Settings.
*/
$authKey = "KUASRDJMLBVVVPKR";
/**
* Valid chat launching link generated with the Control Center.
*/
$link = "http://chathost:port/?0,0,0,0,0";
/**
* Generates a HMAC-protected link, based on the source link,
* username, avatar and profile URLS, and authKey.
*/
function HMACLink($nickName, $profileURL, $avatarURL, $link, $authKey) {
$cpID = substr(strrchr($link, ','), 1);
$hmac = md5($cpID.$nickName.$profileURL.$avatarURL.$authKe y.date('Ymd'));
return $link."&nn=".$nickName."&pu=".$profileURL."&au=".$avatarURL."&hmac=".$hmac;
}
/**
* The dedicated chat URL for this user.
* It should be used for Chat Now buttons, etc.
*/
$hmacLink = HMACLink( $nickName, $profileURL, $avatarURL, $link, $authKey );
// a test
echo '<a href="'.$hmacLink.'">Chat Now!</a>';
?>
I'm trying to integrate the new version of Realchat and Vbulletin 3.7.0. Below I will post the code RealChat gives you to use to integrate it with Vbulletin. I need to know what to put where it says rawurlencode("test") for it to pull usernames from Vbulletin.
Any help would be greatly appreciated.
Thank you!
Jaime
<?php
/**
* Nickname, avatar and profile URLs.
* These are usually pulled from the database.
*/
$nickName = rawurlencode("test"); // rawurlencode is important
$profileURL = rawurlencode("http://www.example.com/");
$avatarURL = rawurlencode("http://www.example.com/avatar.jpg");
/**
* This string must match the Authentication Key, that you
* specified in the RealChat Control Center, Server Settings.
*/
$authKey = "KUASRDJMLBVVVPKR";
/**
* Valid chat launching link generated with the Control Center.
*/
$link = "http://chathost:port/?0,0,0,0,0";
/**
* Generates a HMAC-protected link, based on the source link,
* username, avatar and profile URLS, and authKey.
*/
function HMACLink($nickName, $profileURL, $avatarURL, $link, $authKey) {
$cpID = substr(strrchr($link, ','), 1);
$hmac = md5($cpID.$nickName.$profileURL.$avatarURL.$authKe y.date('Ymd'));
return $link."&nn=".$nickName."&pu=".$profileURL."&au=".$avatarURL."&hmac=".$hmac;
}
/**
* The dedicated chat URL for this user.
* It should be used for Chat Now buttons, etc.
*/
$hmacLink = HMACLink( $nickName, $profileURL, $avatarURL, $link, $authKey );
// a test
echo '<a href="'.$hmacLink.'">Chat Now!</a>';
?>