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)

MoT3rror 12-26-2007 10:06 PM

Have you put $apichat[currentuserlocation] in the place where you want the number of users currently in chat in your FORUMHOME template to show on your page.

Chadi 12-26-2007 10:12 PM

Yes I have. It should appear on right side of shout box above 4 icons, in the blank small purple box next to "members currently in live chat".

Tried this code also

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

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

I also corrected the missing "s" in what you told me to put in forumhome template

currentuserslocation


That still didn't fix it.

MoT3rror 12-26-2007 10:23 PM

Does this page have this code
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"); 

If it does, check to makesure your ip is allowed to access this page because it is not showing 0 or anything for me after Number of Users and Rooms available. This IP needs to be the IP address of your webserver.

Chadi 12-26-2007 10:29 PM

That's because Usercount is supposed to be UserCount (case sensitive)

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

The exact code in that rcplugin.php page is this:


Code:

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


ragtek 12-26-2007 10:33 PM

yes

but the problem is because of the ip
We are not allowed to view it

Chadi 12-26-2007 10:38 PM

http://talkjesus.com:8085/?api.UserCount

It shows "1" properly, since I'm in chat.

However, still not showing up on forumhome :(

MoT3rror 12-26-2007 10:38 PM

Yes but the problem is this page is still outputting
Quote:

Number of users:
Rooms available:
with no numbers. So the problem is the connection between your webserver and the API Chat getting the data(numbers).

Chadi 12-26-2007 10:43 PM

Ok fixed! :) Thanks for all the help folks.

Actually, maybe you can help me get this in WOL area, a new section that is (kind of like FlashChat WOL's area) where it shows you the usernames in chat and if you hover, what room they're in.

I fixed the problem by adding the IP address to trusted IP in RC admin panel

i used this in forumhome

$apichat[currentuserlocation]

And this in plugin:

Code:

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

$apichat['currentuserlocation'] = getAPI("UserCount");


MoT3rror 12-26-2007 10:54 PM

Well you can use this but it is not going to do what you are talking about.
WhoWhere - lists all of the users in all rooms; with one room per line, formatted as: roomID: roomName: userList.
Insert this code at the end of the plugin.
PHP Code:

$apichat['current_users'] = getAPI("WhoWhere"); 

That will get you the list of users and the room. What you are talking about would take some changes in how the API Chat works or some trial and error with PHP.

Chadi 12-26-2007 10:57 PM

Thanks, but how do I get it to appear in the WOL section (footer)?


All times are GMT. The time now is 06:10 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.02883 seconds
  • Memory Usage 1,747KB
  • 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
  • (3)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
  • (3)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