by xx3004 February 6th 2011, 10:20 am
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,