vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Please upgrade this code to be used on VB4 (https://vborg.vbsupport.ru/showthread.php?t=258924)

fer_75 02-15-2011 04:07 PM

Please upgrade this code to be used on VB4
 
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:
Quote:


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 Code:

<?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'] != ) {
        
$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($profileURL).rawurlencode($avatarURL).$realchatAuthKey.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>


All times are GMT. The time now is 01:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01018 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete