Welcome Visitor, Please Login or Register Now Sunday, April 28, 2024 02:48 PM 
Forums Index > Mewsoft Products > Auctionawy > Javascript liveclock
New Topic   New Reply
Search for:
Author Message
totalbids totalbids's personal page
Registered Member
Posts: 64 Display member's posts
Joined: 04-28-24 02:48 PM
Location: Southend
Member Offline
View Member's Profile Visit member's website http://www.totalbids.co.uk Send private message YIM Messenger: toptech1911 MSN Messenger: jason_yorke@hotmail.com
 
Back to top
Javascript liveclock Edit Delete Reply with quote Quote
First Post Posted on: 02-28-08 11:30 PM next post first post
Hello all.

I have finally managed to get a live clock running on my site. You can view it at www.totalbids.co.uk

If anyone would like this option then please email me at admin@totalbids.co.uk and i will send you the file and the instructions on how to do this.

This basically replaces the static clock on the welcome area on every page.

Cheers

Jason
Marty Marty's personal page
Registered Member
Posts: Display member's posts
Joined: 04-28-24 02:48 PM
Member Offline
View Member's Profile PM
 
Back to top
Re: Javascript liveclock Edit Delete Reply with quote Quote
Reply #: 1 Posted on: 03-02-08 01:49 AM next post previous post
I was wondering if you could post your java clock script here ?

I have a similar clock on my own site, but the problem is my clock gets the time from my PC not my server thus, when viewing an Item "ViewItem" You get two different times.

My point is that iam trying to apply a live clock to the ViewItem pages but I cant get the 2 (same) scripts running on the same page etc..
Marty Marty's personal page
Registered Member
Posts: Display member's posts
Joined: 04-28-24 02:48 PM
Member Offline
View Member's Profile PM
 
Back to top
Re: Javascript liveclock Edit Delete Reply with quote Quote
Reply #: 2 Posted on: 03-02-08 03:32 AM last post previous post
Theres probably an easier way but heres what I did......

BTW do this at your own risk 8) Mewsoft are not responsible for any loss or damaged data.

Open your admin panel enter into..........

General Classes :

Open......

Welcome_Area

Find this <!--CLASS:big grinate_Time:11--> and delete it. Replace it with the follow code......

<script>
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var cdate="<large><font color='F0F8FF' face='TAHOMA, ARIAL, TIMES'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}

</script>
<span id="clock"></span>



Last bit, Copy/Paste this <body onLoad="goforit()"> anywhere after that.





Page 1 of 1
Go to page:

New Topic   New Reply Mark Unread
Jump to:  
Delete   Move     Lock   +Favorits   +Notify   Print