The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.

Create a free forum like this one.

How do I hide "Who is online" box to guests /people who are not logged in?

View previous topic View next topic Go down

How do I hide "Who is online" box to guests /people who are not logged in?

Post by johns on February 6th 2011, 6:01 am

I have looked around and tried to do it myself to no avail.

I want to hide the box with "Who is online" from guests. If I need to get rid of it altogether that is fine too.

Thank you in advance.

New Member

Posts : 1
Reputation : 0
Language : English

Back to top Go down

Re: How do I hide "Who is online" box to guests /people who are not logged in?

Post by xx3004 on February 6th 2011, 10:20 am


This is my own code, and it works fine for me.

Go to: Administrator Panel > Forum Widgets Management > Create new Widget > Copy the code below into the text area, save it and drag it into the widgets table to make it appear on the page (Use table type > No):

<script language="javascript" type="text/javascript">
   {//Return username if member is logging in
   user_name=jQuery("#logout").html().split("[ ")[1].split(" ]")[0];
   {//Return null for guest
//If user_name=null (guest) => hide the table "Who is online"
if(user_name==null){jQuery("table .forumline").css("display", "none");}

It works for me, tell me if it works for you, too.
Besides, after running the code (without the last entry), if you know about javascript and can also do various stuffs since the user_name will return the member's username for member and return null for guest!

Credit by xx3004,
New Member

Male Posts : 13
Reputation : 0
Language : English, Vietnamese

Back to top Go down

View previous topic View next topic Back to top

Permissions in this forum:
You cannot reply to topics in this forum