View Full Version : 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.
I'm willing to pay $100 for someone to figure this out. Thanks.
MoT3rror
26 Dec 2007, 22:24
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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.
Thanks for the help, but its not working.
I tried this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
I also tried it with this link:
http://147.202.66.3:8085/?0,0,0,0,0
I did enable / activate plugin too.
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
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 1198710896 at 1198710896 ---------------
Tried this also, won't work
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
make a php file and put the plugin code into it
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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
http://talkjesus.com/rcplugin.php
Shows code only
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;)
Ok now it works via that link but not forumhome
MoT3rror
27 Dec 2007, 00:06
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.
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
--------------- Added 1198714951 at 1198714951 ---------------
I also corrected the missing "s" in what you told me to put in forumhome template
currentuserslocation
That still didn't fix it.
MoT3rror
27 Dec 2007, 00:23
Does this page (http://www.talkjesus.com/rcplugin.php) have this code
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
If it does, check to makesure your ip is allowed to access this page (http://147.202.66.3:8085/?api.Usercount) 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.
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
yes
but the problem is because of the ip
We are not allowed to view it
http://talkjesus.com:8085/?api.UserCount
It shows "1" properly, since I'm in chat.
However, still not showing up on forumhome :(
MoT3rror
27 Dec 2007, 00:38
Yes but the problem is this page (http://www.talkjesus.com/rcplugin.php) is still outputting
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).
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:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
MoT3rror
27 Dec 2007, 00:54
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.
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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.
Thanks, but how do I get it to appear in the WOL section (footer)?
MoT3rror
27 Dec 2007, 00:59
The template WHOSONLINE. You can just use the same variable. $apichat[currentuserlocation]
Wow, that template is really confusing me
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
I want to create a new section for the "who's in chat" right below "users registered today" and above "total members visited 24hrs...."
http://www.talkjesus.com/
Hint please? Thanks.
MoT3rror
27 Dec 2007, 05:01
Sorry told you the wrong template. It is in FORUMHOME and find this code.
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This is the start of the who online at the bottom of the page.
I can't tell you exactly where to past your code because I don't have those mods installed but use the comments tags and that should tell you where everything begins and ends.
JasonP007
29 Dec 2007, 23:32
hello MoT3rror, i have created the plugin, but not the product, could you walk me through this phase please? i also have realchat integrated and would like to show "who is in chat" and "how many are in chat"
i would really appreciate it...
jason
www.stocknetworkonline.com
MoT3rror
29 Dec 2007, 23:46
Plugins & Products -> Manage Products -> Add/Import Product
Then when you create the plugin choose the product you called it.
Here is a mod for flash chat.
http://www.vbulletin.org/forum/showthread.php?t=120926&highlight=flash+chat
JasonP007
30 Dec 2007, 00:24
the link for flashchat? will that help me with realchat?
ok, i did that much and this appears on my forums page at the top???
Parse error: syntax error, unexpected '<' in /home/stocknet/public_html/snoforums.php(63) : eval()'d code on line 1
MoT3rror
30 Dec 2007, 14:45
This will only work for API Chat. You will have to use something else for other chats.
Put this code in the plugin for APIChat
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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.
JasonP007
30 Dec 2007, 17:48
I created a product --> then created the plugin and placed the code in there --> lastly i placed the $apichat[currentuserlocation] in the FORUMHOME --> resulting in nothing to display on the forum homepage.
Any advice would be greatly appreciated... I see on chadi's site that he was able to get this to work. I have the same chat software imbedded in my vBulliten so when a vBulliten member enters chat they enter with the registered name.
Thanks in advance...
Jason
MoT3rror
30 Dec 2007, 22:32
Did you allow your website IP address in Real Chat. Also the variable you need to put in is $apichat[currentuserslocation]. Forgot the s after user
JasonP007
31 Dec 2007, 01:35
I am not sure what you mean by my website IP address in RealChat? This is the start of the url...
http://64.131.88.242:8080/?nn=
MoT3rror
31 Dec 2007, 03:07
Is the IP address of your website/server, that your website is stored on, allowed to access your chat.
API commands are served by the built-in Control Center HTTP server and are accessible from trusted IPs only.
Ok, not sure what happened here. I had to do a backup file restore earlier in the morning. It was a backup that I made prior to making some changes (and then restoring the backup due to some mishaps). Everything worked fine prior to the backup I generated, including Real Chat user count out put. After the restore, the out put worked fine until I just noticed now it shows blank.
Odd enough, it worked immediately after the restore was done. I stopped, restarted realchat daemon and that did not help. On a side note, the chat itself works fine. No templates were re-modified either, port is still open in firewall of course. I'm a little confused why this is happening. Nothing at all was modified on the server nor anything within realchat / vbulletin after the restore was completed.
forumhome:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Plug-in is active too
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Another thing I just noticed, even Wimpy mp3 player is showing up in the frame crushed, tiny - or minimized to say. Two other members confirmed they see the same result.
The template in VB is still the same.
vBulletin® v3.6.12, Copyright ©2000-2009, Jelsoft Enterprises Ltd.