PDA

View Full Version : Please upgrade this code to be used on VB4


fer_75
02-15-2011, 04:07 PM
Hi all,

The instruction and code bellow is to integrate VB and Realchat, it work perfect but in VB3.

Can someone please make the right modification in order to have it working on VB4?

Please, this would be awesome.

Thank you!

realchat.php content:


1. Edit the vBulletin file global.php, as described below:

Find the following line:
require_once(CWD . '/includes/init.php');
Add the following line right below:
require_once(CWD . '/realchat.php');




<?php
/**
* This string must match the Authentication Key, that you
* specified in RealChat Control Center, Server Settings.
* Should look like: "AZUUG"
*/
$realchatAuthKey = "XGTHZU";

/**
* Valid chat launching link generated with RealChat Control Center.
* Should look like: "http://host:port/?0,0,0,0,0"
*/
$realchatURL = "http://64.00.00.00:8080/?5,0,2,0,0";

/**
* Should the chat open in new pop up window?
*/
$realchatPopup = false;

/** Do not modify below this point **/
function chatLink() {
global $realchatAuthKey, $realchatURL, $realchatPopup, $vbulletin;
if ($realchatURL == "") return "javascript:alert('Please edit realchat.php to complete the installation.')";

if ( $vbulletin->userinfo['userid'] != 0 ) {
$nickName = $vbulletin->userinfo[username];
$profileURL = $vbulletin->options[bburl]."/member.php?u=".$vbulletin->userinfo[userid];
$avatarURL = $vbulletin->options[bburl]."/image.php?u=".$vbulletin->userinfo[userid];
$cpID = substr(strrchr($realchatURL, ','), 1);
$hmac = md5($cpID.rawurlencode($nickName).rawurlencode($pr ofileURL).rawurlencode($avatarURL).$realchatAuthKe y.date('Ymd'));
$u = "nn=".rawurlencode($nickName)."&pu=".rawurlencode($profileURL)."&au=".rawurlencode($avatarURL)."&hmac=".$hmac."&cu=".$bbRoot;
return $realchatPopup ? "javascript:realchatPopup('".$realchatURL."','".$nickName."','".$profileURL."','".$avatarURL."','".$hmac."');" : $realchatURL."&".$u;
}
else {
return $vbulletin->options[bburl]."/login.php";
}
}
$chatLink = chatlink();
?>


Finally the chat is called: <a href="$chatLink">Chat</a>