Who's Online for all forum pages

Started by Kruss, November 18, 2009, 01:20:17 PM

Previous topic - Next topic

Kruss

Hi everyone

I just wanted to ask, is it possible to make the Who's Online visible to all pages on the forum? And if so, how can I do it? Like, for example...if you're reading a post, you can't see who's online. You have to go back to the main page to check.

Thanks in advance! :)

Arantor

I wouldn't recommend it. It's a fairly expensive query computationally, meaning that it will slow your forum down a fair amount to have it on every page.

sangwe11

Quote from: Arantor on November 18, 2009, 02:16:45 PM
I wouldn't recommend it. It's a fairly expensive query computationally, meaning that it will slow your forum down a fair amount to have it on every page.

Maybe have it a admin only pop-up option, meaning it doesn't generate until you click a button for a jquery popup ?

Kruss

Quote from: Arantor on November 18, 2009, 02:16:45 PM
I wouldn't recommend it. It's a fairly expensive query computationally, meaning that it will slow your forum down a fair amount to have it on every page.

Oh, that's right. I didn't consider that. Thanks, Arantor. 

I'll mark this case as closed because I don't think I want to pursue this anymore.

sangwe11

Quote from: Kruss on November 18, 2009, 02:29:22 PM
Quote from: Arantor on November 18, 2009, 02:16:45 PM
I wouldn't recommend it. It's a fairly expensive query computationally, meaning that it will slow your forum down a fair amount to have it on every page.

Oh, that's right. I didn't consider that. Thanks, Arantor. 

I'll mark this case as closed because I don't think I want to pursue this anymore.

Did you not see my comment ? ;D

Arantor

Sure you could have some kind of AJAX style popup, which wouldn't load the forum down as much. Probably wouldn't even be that hard to do.

sangwe11

#6
Quote from: Arantor on November 18, 2009, 02:39:36 PM
Sure you could have some kind of AJAX style popup, which wouldn't load the forum down as much. Probably wouldn't even be that hard to do.

jQuery("#whois_popup").load("http://website.com/index.php?action=who;" + " #bodyarea");

Edit: Thats for SMF 1.1.X ^^

For SMF 2.0, use the following (make sure you change http://website.com to you site url)

jQuery("#whois_popup").load("http://sangwe11.co.cc/smf_2_rc2/index.php?action=who;" + " #whos_online");

That will fetch the who is data from the who is page, and display it in a div called whois_popup (you need to include the jquery script file first though)

Just add a button, but that as the onclick.

If you need any more help, just holla :D

Arantor

While that may be elegant, I personally really really wish people wouldn't suggest such solutions, because it actually creates far more server load than it needs to because you're still creating a full page load and all the associated queries instead of creating an action/subaction/something that generates less load. Even using SSI.php to get the data (from ssi_whosOnline, btw rather than action=who) would be less load heavy.

Kruss

Quote from: sangwe11 on November 18, 2009, 02:37:27 PM
Quote from: Kruss on November 18, 2009, 02:29:22 PM
Quote from: Arantor on November 18, 2009, 02:16:45 PM
I wouldn't recommend it. It's a fairly expensive query computationally, meaning that it will slow your forum down a fair amount to have it on every page.

Oh, that's right. I didn't consider that. Thanks, Arantor. 

I'll mark this case as closed because I don't think I want to pursue this anymore.

Did you not see my comment ? ;D

Oh sorry, I didn't mean to pass your reply like that :(
It's just that a member was the one who asked about this. I don't really need it so it would be pretty useless to enable it for admins. I hope I didn't offend.

sangwe11

#9
Quote from: Kruss on November 18, 2009, 02:54:50 PM
Quote from: sangwe11 on November 18, 2009, 02:37:27 PM
Quote from: Kruss on November 18, 2009, 02:29:22 PM
Quote from: Arantor on November 18, 2009, 02:16:45 PM
I wouldn't recommend it. It's a fairly expensive query computationally, meaning that it will slow your forum down a fair amount to have it on every page.

Oh, that's right. I didn't consider that. Thanks, Arantor. 

I'll mark this case as closed because I don't think I want to pursue this anymore.

Did you not see my comment ? ;D

Oh sorry, I didn't mean to pass your reply like that :(
It's just that a member was the one who asked about this. I don't really need it so it would be pretty useless to enable it for admins. I hope I didn't offend.

Oh no offense taken, just wasn't sure if you spotted it ;D

Well let me know if you need it at all in the future.

Edit: Put up a simple demo incase you wanted it.

Also just to let you know, you could just add it in as a normal popup for all members. They don't have to use it do they ;D

Little demo based on my test site, incase you wanted it ;D

http://sangwe11.co.cc/smf_2_rc2/test_page.html

Advertisement: