MyBB Community Forums

Full Version: Add to who's online box
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Svizy Wrote:Fist of all I would like to thank Devilson for posting this here, since I don't want to register just to post 1 post Toungue

Recently I've added a chatroom to my forum, which is located on a seperate page (chat.php).
I would like to show which and how many registered users are currently located on that page (chat.php), but I want it to be shown on forum index bellow "Who's Online".
I've already added a "category" under "Who's Online", I only don't know how would I show up the users. I have almost no PHP experiance so I can't code it on my own.

If you're confused about what I'm talking about, please check this picture (I've photoshoped so you guys know what I mean Toungue)

Can someone help me with this?

Please contact me at [email protected] (msn/yahoo), [email protected] or just leave responce here and I'll inslave Devilson and use him to answer your questions and thank you for the sollution when its done (if its possible) Big Grin

Regards,
Svizy
First of all you need to state what type of chat you're using.
'Svizy Wrote:You don't need to know the type of chat, because I want to show users on the page (chat.php) and not dirrectly from the chat.
Create a new PHP file with this coding, and name it chat.php:

<?php

define("IN_MYBB", 1);
define("KILL_GLOBALS", 1);
require "global.php";

add_breadcrumb("Chat Page", "chat.php");

eval("\$Chat= \"".$templates->get("Chat")."\";");
output_page($Chat);
?>

Then, create a new Global template, name it "Chat" and input this code:

<html>
<head>
<title>Website title - Chat Page</title>
{$headerinclude}
</head>
<body>
{$header}


Input the content you want here.


{$footer}
</body>
</html>
Svizy Wrote:Thanks for the help Ian7, but I already have a custom page with chat on it. Let me explain it again. I want to show on forum homepage who and how many people are browsing the page which contains chatroom (chat.php).
Ah, I was thinking the "Who's Online" list.
But you know what, I think it should do it like that if he used that custom code method to create the page.

I've done it before, and it appears under "Who's Online" the page.
Assuming the Who's Online box works just like the Page/list, it should display them there as well.

And "Svizy", you might as well register an account now.
This goes beyond 1 post, and to be honest, it annoys me to assist someone through the post of another person.

I'm sure many MyBB members feel the same way.
You want the support? Why is it so difficult to make an account and ask? It's not. Even if it was for just 1 post, support is a two way street.
Support MyBB by creating an account & crediting the software on your website, and you get support back for any technical assistance needed.
(2010-03-17, 07:48 PM)lan7 Wrote: [ -> ]Ah, I was thinking the "Who's Online" list.
But you know what, I think it should do it like that if he used that custom code method to create the page.

I've done it before, and it appears under "Who's Online" the page.
Assuming the Who's Online box works just like the Page/list, it should display them there as well.

And "Svizy", you might as well register an account now.
This goes beyond 1 post, and to be honest, it annoys me to assist someone through the post of another person.

I'm sure many MyBB members feel the same way.
You want the support? Why is it so difficult to make an account and ask? It's not. Even if it was for just 1 post, support is a two way street.
Support MyBB by creating an account & crediting the software on your website, and you get support back for any technical assistance needed.
I've already created a custom page using that way (user submited tutorial). You should really check the picture to get what I actually want.

I want to make a similar box as "Who's Online" is, but I want that it shows only users that are browsing the specific page (chat.php).

Reason why I didn't want to register is, because I believe that I won't really use the support here, because I mostly solve my own problems by myself, with help of my friends or by posting at MyBBSource. But you're correct, I should have registered istead of inslaving Devilson Toungue
Just open up the file you want it to display on and do a SQL command to check how many rows are in the chat online and set it as $chatonline or something

http://www.immortaltechnique.co.uk/ << like in my header.

then just add {$chatonline} where you need to use it.
(2010-03-18, 10:01 AM)Aaron Wrote: [ -> ]Just open up the file you want it to display on and do a SQL command to check how many rows are in the chat online and set it as $chatonline or something

http://www.immortaltechnique.co.uk/ << like in my header.

then just add {$chatonline} where you need to use it.
As far as I know I cannot use php in mybb templates so this wont work. I would need to make a function in some file (functions.php?), but I'm not experianced in PHP enough.
There exists a plugin: Who is in Chat?. The site is in german language but the plugin has also an english language file.
Pages: 1 2