Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
[CODE] Online/Offline Legend
Topic Started: May 15 2004, 07:03 PM (92,136 Views)
Markup
Migrating to phpbb ;)
 *   *   *  
Put this after your <% BOARD %> / RPG Hack:

It will add to the side of posts whether the member is currently online.

version 2 (compatible with mozilla).

Possible conflicts: portal index page, remove post count from posts
This code will always show your members viewing the board index. //M

Footer:

Code:
 
<script>//Online/Offline Legend v2 - By Markup
dir="http://webpost.net/ma/markup/"
home=location.href.lastIndexOf("/")>26?location.href.substr(0,location.href.lastIndexOf("/")):location.href
names=[]
if(top.location==location)
document.write("<IFRAME id=index name=index src="+home+" width=0 height=0 border=0 frameBorder=0></IFRAME>")
else
{
div=document.body.getElementsByTagName("DIV")
for(i=0;i<div.length;i++)
 if(div[i].className=="thin")
  break
a=div[i].getElementsByTagName("A")
for(i=0;i<a.length;i++)
 names[i]=a[i].innerHTML.replace(/<[^>]+>/g,"")
parent.updateStatus()
}
function updateStatus()
{
td=document.body.getElementsByTagName("TD")
for(i=0;i<td.length;i++)
 if((td[i].className=="post1"||td[i].className=="post2")&&td[i].innerHTML.match("Posts: ")&&td[i].width!="100%")
 {
  found=false
  sPost=td[i].getElementsByTagName("SPAN")[0]
  names=parent.frames['index'].names
  for(a=0;a<names.length;a++)
   if(td[i-2].innerHTML.replace(/<[^>]+>/g,"")==names[a])
   {
    sPost.innerHTML+="<P align=center><IMG SRC="+dir+"online.gif"+"></P>"
    found=true
   }
  if(!found)
   sPost.innerHTML+="<P align=center><IMG SRC="+dir+"offline.gif"+"></P>"
 }
}
</script>
Offline Profile Quote Post Goto Top
 
Markup
Migrating to phpbb ;)
 *   *   *  
Will not work with forced portal frontpage or remove post count from posts
Offline Profile Quote Post Goto Top
 
Markup
Migrating to phpbb ;)
 *   *   *  
Sorry, heres a preview if your unclear:

Posted Image
Offline Profile Quote Post Goto Top
 
VoTinh
Member
 *  
Hey how come i onli saw member status ONLINE and OFFline..but cant see the ADMIN status?? it said OFFLINE....anyone help??? :no: :/
Offline Profile Quote Post Goto Top
 
Katzen
Member Avatar
Graphics Designer -Taking Requests
 *   *  
Is there a way to use images instead of text?
Offline Profile Quote Post Goto Top
 
Rainbow Phoenix
Member Avatar
HTML n00b
 *   *  
Katzen
May 15, 2004 08:02 PM
Is there a way to use images instead of text?

Yes, just edit the red HTML to support Images.

I'll post a preview in a sec.

EDIT:

Ok, this isn't supposed to look professional. Just an example.

Posted Image

Just substitute the "on" for "Offline" as well

to do this:

Quote:
 
<iframe id='lookup' src='http://sx.invisionfree.com/myBoard/index.php' width='0' height='0' frameBorder='0'></iframe>
<script>//Online/Offline Legend - By Markup
names=[]
if(top.location!=location.href)
{
div=document.body.getElementsByTagName("DIV")
for(i=0;i<div.length;i++)if(div.className=="thin")break
a=div.getElementsByTagName("A")
for(i=0;i<a.length;i++)names=a.innerHTML
parent.updateStatus()
}
function updateStatus()
{
td=document.body.getElementsByTagName("TD")
for(i=0;i<td.length;i++)if(td.firstChild.className=="postdetails"&&td.innerHTML.match("Posts: "))
{
found=false
sPost=td.firstChild
names=parent.frames['lookup'].names
for(a=0;a<names.length;a++)
{
if(td[i-2].innerHTML.match(names[a]))
{
sPost.innerHTML+="<img src='enter_the_image_url_here'>"
found=true
}
}
if(!found)sPost.innerHTML+="<img src='enter_the_image_url_here'>"
}
}
</script>
Offline Profile Quote Post Goto Top
 
Alterdeus
Member Avatar
Mr. Nobody
 *   *   *  
I added it now I can't stay logged in
Offline Profile Quote Post Goto Top
 
Alterdeus
Member Avatar
Mr. Nobody
 *   *   *  
Can anyone help?
Offline Profile Quote Post Goto Top
 
kb31685
Member
 *   *  
It won't show up for me.
Offline Profile Quote Post Goto Top
 
VoTinh
Member
 *  
i use that code...but my nick is OFFLIne...and My other frienz said that cause i use the NICK color thingi...that y...those code wont match..and effect the ONLINE CODE...if i take off the ADMIn color and the ONLINE CODE work...arrrgg..can someone just make the code fit and match? pleaseeeeeeeeeee
Offline Profile Quote Post Goto Top
 
gamefreak11
Member Avatar
Arcade Coder
 *   *   *   *   *   *  
Slight bug:

When you use the personal messenger, it always says the user is offline, even if they are online.
Offline Profile Quote Post Goto Top
 
Markup
Migrating to phpbb ;)
 *   *   *  
It should match span decorations used on usernames. I will check the PM problem...
Offline Profile Quote Post Goto Top
 
Markup
Migrating to phpbb ;)
 *   *   *  
Ah, I see a problem with the regexp...*goes to fix*
Offline Profile Quote Post Goto Top
 
VoTinh
Member
 *  
YEP it working now..thanx...great code...
Offline Profile Quote Post Goto Top
 
Jamie
Member Avatar

 *   *   *   *  
Nice code!
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Code Snippets · Next Topic »
Add Reply