Hoşgeldin Misafir

[MOD] Live Time / Canlı Zaman

MiRaT

13 Kas 2017
2,077 Mesaj

Aktiflik

Seviye

Deneyim

TIM / GÖREV:
Kod:
############################################### 
## MOD Title: A live time
## MOD Author: kber < [email protected] > (kber) http://www.phpbbegypt.com
## MOD Description:A live time script that displays the date plus time, updated every second in index page in current time section       
##
## MOD Version:1.1.0
## 
## Installation Level: Easy
## Installation Time: 1 minute
## Files To Edit: 1
##   templates/subSilver/index_body.tpl
##         
## Included Files:N/A  
##############################################################
## Author Notes: 
## a live demo at phpbbegypt.com/PHPBB
##############################################################
## MOD History:
## 2007-2-12- virsion 1.1.0
## - first releaed
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
#
#-----[ OPEN ]------------------------------------------ 
# 
    templates/subSilver/index_body.tpl
# 
#-----[ FIND ]------------------------------------------ 
# 
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
  <tr> 
#
#-----[ BEFORE, ADD ]------------------------------------------
# 
<body onLoad="goforit()">

#
#-----[ FIND ]------------------------------------------ 
#
{CURRENT_TIME}
#
#-----[ REPLACE WITH ]------------------------------------------
**********
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
//change font size here
var cdate="<small><font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+"</b></font></small>"
if (********.all)
********.all.clock.innerHTML=cdate
else if (********.getElementById)
********.getElementById("clock").innerHTML=cdate
else
********.write(cdate)
}
if (!********.all&&!********.getElementById)
getthedate()
function goforit(){
if (********.all||********.getElementById)
setInterval("getthedate()",1000)
}

</script>
<span id="clock"></span>
# 
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM