The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

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

2 posters

Go down

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

Post by johns February 6th 2011, 07:01

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.

avatar
johns
New Member

Posts : 1
Reputation : 0
Language : English

Back to top Go down

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

Post by xx3004 February 6th 2011, 11:20

Hi,

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):

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

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!
Enjoy,

Credit by xx3004,
xx3004
xx3004
New Member

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

http://xx3004.forumotion.com

Back to top Go down

Back to top


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