vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   users in chat, confusing API (https://vborg.vbsupport.ru/showthread.php?t=166005)

Chadi 12-23-2007 11:22 PM

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.

Chadi 12-26-2007 07:52 PM

I'm willing to pay $100 for someone to figure this out. Thanks.

MoT3rror 12-26-2007 08:24 PM

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.

Chadi 12-26-2007 09:04 PM

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.

ragtek 12-26-2007 09:09 PM

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

Chadi 12-26-2007 09:10 PM

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");


ragtek 12-26-2007 09:16 PM

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

Chadi 12-26-2007 09:19 PM

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

Shows code only

ragtek 12-26-2007 09:23 PM

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;)

Chadi 12-26-2007 09:38 PM

Ok now it works via that link but not forumhome


All times are GMT. The time now is 11:07 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.03183 seconds
  • Memory Usage 1,746KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete