Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2011, 04:07 PM
fer_75 fer_75 is offline
 
Join Date: Jun 2007
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:32 PM.


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.09018 seconds
  • Memory Usage 2,178KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete