Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 12-23-2007, 11:22 PM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default users in chat, confusing API

I installed and integrated Real Chat into my vbulletin forum. However, I wish to display on the forumhome (custom location and WOL area) how many members are in live chat and what room (if easily done).

I'm just not understanding this api doc at all and hope someone can help me out here.

http://www.realchat.com/doc/scripting-api.html

Thanks in advance.
Reply With Quote
  #2  
Old 12-26-2007, 07:52 PM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm willing to pay $100 for someone to figure this out. Thanks.
Reply With Quote
  #3  
Old 12-26-2007, 08:24 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Make a plugin with these options

Hook Location: forumhome_start
Title: API chat on forumhome(whatever you want to call this plugin it doesn't matter)
Execution order: 1
Plugin PHP Code:
PHP Code:
function getAPI($command) {
        
$er error_reporting(0);
        
$result file_get_contents("http://chathost:controlport/?api.".$command);
//Replace http://chathost:controlport with the link to the your api chat
        
error_reporting($er);
        return 
$result;
    }

$apichat['currentuserslocation'] = getAPI("whowhere"); 
Plugin is Active: Yes

Remember to replace http://chathost:controlport with the link to the your api chat or this will not work. I suggest trying this on a test board before you put it on your main site to make sure it works. I suggest creating a new product by Plugins & Products -> Manage Product -> Add New Product. Then add the plugin to the product you created.

Then you can put $apichat[currentuserlocation] in your FORUMHOME template.
Reply With Quote
  #4  
Old 12-26-2007, 09:04 PM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the help, but its not working.

I tried this:

Code:
function getAPI($command) {
        $er = error_reporting(0);
        $result = file_get_contents("http://147.202.66.3:8085/?api.".$command);
//Replace http://chathost:controlport with the link to the your api chat
        error_reporting($er);
        return $result;
    }

$apichat['currentuserslocation'] = getAPI("whowhere");
I also tried it with this link:

http://147.202.66.3:8085/?0,0,0,0,0

I did enable / activate plugin too.
Reply With Quote
  #5  
Old 12-26-2007, 09:09 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
The Scripting API commands allow you to retrieve information from your RealChat Server. For example, you can show your visitors who is online from a cutsom ASP or PHP page, before they enter the chat room.

API commands are served by the built-in Control Center HTTP server and are accessible from trusted IPs only.
check if the ip is allowed
Reply With Quote
  #6  
Old 12-26-2007, 09:10 PM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, because it shows it directly this way:

http://147.202.66.3:8085/?api.UserCount

0 is correct

But I cannot get the plugin setup right to display usercount in forumhome

--------------- Added [DATE]1198710896[/DATE] at [TIME]1198710896[/TIME] ---------------

Tried this also, won't work

Code:
function getAPI($command) {
        $er = error_reporting(0);
        $result = file_get_contents("http://147.202.66.3:8085/?api.".$command);
        error_reporting($er);
        return $result;
    }

$apichat['currentuserslocation'] = getAPI("usercount");
Reply With Quote
  #7  
Old 12-26-2007, 09:16 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

make a php file and put the plugin code into it
PHP Code:
    function getAPI($command) {
        
$er error_reporting(0);
        
$result file_get_contents("http://147.202.66.3:8085/?api.".$command);
        
error_reporting($er);
        return 
$result;
    }
     
    echo 
"Number of users: ".getAPI("UserCount")."<br/>";
    echo 
"Rooms available: ".getAPI("RoomList"); 
and call the file from your browser

Because i'm getting an error if i want to try file_get_contents() from your ip, and if i call it direct http://147.202.66.3:8085/?api.UserCount i'm gettin the message that its forbidden
Reply With Quote
  #8  
Old 12-26-2007, 09:19 PM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://talkjesus.com/rcplugin.php" target="_blank">http://talkjesus.com/rcplugin.php</a>

Shows code only
Reply With Quote
  #9  
Old 12-26-2007, 09:23 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

with <? around, sorry
here's my try: www.ragtek.org/sandbox/chat.php
my server isn't allowed to get the info
also my clientpc isn't allowed when i click the link
Reply With Quote
  #10  
Old 12-26-2007, 09:38 PM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok now it works via that link but not forumhome
Reply With Quote
Reply

Thread Tools
Display Modes

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 12:28 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09310 seconds
  • Memory Usage 2,273KB
  • Queries Executed 12 (?)
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
  • (2)bbcode_code
  • (2)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)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete