The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to put this in the menu
I made this little screen scrape to see how many users there are in my (external) Videochat:
PHP Code:
Code:
<td> <a href="http://www.magiciansthegathering.com/forums/chat.php">Videochat</a> </td> So how do I do this? Thanks in advance! |
#2
|
||||
|
||||
get rid of the last line of the code, put it in a plugin, and use the $output in your template.
Edit, re-reading your above post, it depends whats in that chat .php file. I think we need to know a bit more to help. Do you have direct access to that chat php file? |
#3
|
|||
|
|||
It's just a number which changes when there are more people in the chat room.
This is the original PHP (the php in question only got the 'online_users' from this): PHP Code:
I tried to make a plugin but I didn't get it to work (but that could be just me). |
#4
|
||||
|
||||
Ok, I can see what that does,
So just to clarify, which site/page are you trying to display this number of online users? somewhere on http://mtgstream.com/ or somewhere on http://www.magiciansthegathering.com? I'm guessing the 2nd as that looks like a vb installation. If so, I assume you own both sites? or just the 2nd one? Are they both hosted on the same server? You could perhaps give http://www.magiciansthegathering.com access remotly to the other sites database (cpanel etc can do that if hosted solution), then make a modified version of the code you posted above, but instead of all the Code:
include("globals.php"); include("includes/inc.php"); doDB(); doLicence(); include("config.php"); After that it becomes much easier to intergrate with vB, and you can then start to do what I mentioned in my first post. |
#5
|
|||
|
|||
Okay, wait, I'm getting slightly confused now, so let me answer the questions.
Both sites are owned by me but they are not hosted on the same server. The chat (mtgstream.com) is hosted on a dedicated flash server because the chat application requires that. This one does have cPanel but magiciansthegathering.com doesn't. I would like the PHP output to show in the menu (header-template) like 'Videochat (2)' in which 2 should be the amount of people online in the chat on mtgstream.com. So what exactly should I do? Also, I was wondering about the hook the plugin should be linked to. Thanks a lot for the help! |
#6
|
||||
|
||||
Ok, at the moment, your PHP hosted on mtgstream.com is only able to connect to the database and pull the data in the query because it contains the lines of code I posted above. Somewhere in one of those other files mentioned in those lines, there will be some lines of code establishing a connection to that websites database in order to run the query:
Code:
SELECT user_name FROM prochatrooms_users WHERE online_time >='$expire_secs' ".$hide_admins." Once you have done that, you can re-write your php you posted above, miss out the lines of code I quoted and instead pull the data directly from mtgstream.com's. If your not sure how to do that, you can learn how to do this here: http://php.net/manual/en/function.mysql-connect.php Once you have done that, you can use most of the rest of your existing code to arrive at having the number of users online in your chat in a vairable. For example your PHP you posted above uses the "$online_users" vairable to store the number of uses online in your chat. You can't use the 'echo' command with vB, you instead need to refrence your $online_users vairable in your template, after you have added your finalised php to a plugin. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|