Go Back   Webmaster Forum > Development > Programming > JavaScript
REMOVE the ads below !
Reply
 
LinkBack Thread Tools
  # 1 (permalink)
Old
Junior Geek
Posts: 65
Join Date: Feb 2007
iTrader: (0)
Online list upgrade - 10-19-2007

Written for IPB1.3 / invisionfree

this is a function from my coding tournament entry, its pretty cool apart from it aswell. its a time system wich if your gmt settings are correct is really awsome. it makes the dates bold if it is the current date so if some1 really is online right now!
Quote:
<script>
/*Online list upgrade by Godkillah
for more awsome scripts visit
http://www.phantom-designs.net*/
function timecheck(){
targy=document.getElementsByTagName("td")
var today=new Date()
var h=today.getHours()
var m=today.getMinutes()
if(location.href.match(/act=Online/i)){
if(h>12){
h=h-12
}
if(m<10){
var addzerom=true
}
if(h<10){
var addzeroh=true
}
if(addzerom==true){
if(addzeroh==true){
var time="0"+h+":0"+m
}else{
var time=h+":0"+m
}}else{
var time=h+":"+m
}
for (pd=0;pd<document.getElementsByTagName("td").lengt h;pd++){
if(document.getElementsByTagName("td")[pd].innerHTML.match(time)){
document.getElementsByTagName("td")[pd].innerHTML="<b>"+document.getElementsByTagName("td ")[pd].innerHTML+"</b>"
}}}}
timecheck()
</script>
Reply With Quote
Reply


Thread Tools



PSD to HTML

vBulletin®, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd. | SEO by vBSEO | Skin developed by vBStyles.com