Warning: The author of this contribution does not provide support for it anymore.

Count Down

Suggestes changes for better translatability - Count Down

Suggestes changes for better translatability

by samuraiii » Mon Jul 11, 2011 9:25 pm

Hi i have here some changes which I would recommend for easier translating of your mod
(It's annotation of changes)

##################/includes/functions.php


'S_ENABLE_COUNT_DOWN' => ($config['enable_count_down']) ? true : false ,
'BEFORE_COUNT_DOWN' => $config['before_count_down'],
'CURRENT_COUNT_DOWN' => $config['current_count_down'],
'DATE_COUNT_DOWN' => $config['date_count_down'],
'MOD_COUNTOWN_COUNT' => $user->lang['MOD_COUNTOWN_COUNT'],
'MOD_COUNTOWN_UNTIL' => $user->lang['MOD_COUNTOWN_UNTIL'],
'MOD_COUNTOWN_HAS' => $user->lang['MOD_COUNTOWN_HAS'],
'MOD_COUNTOWN_DAY' => $user->lang['MOD_COUNTOWN_DAY'],
'MOD_COUNTOWN_HOUR' => $user->lang['MOD_COUNTOWN_HOUR'],
'MOD_COUNTOWN_MINUTE' => $user->lang['MOD_COUNTOWN_MINUTE'],
'MOD_COUNTOWN_SECOND' => $user->lang['MOD_COUNTOWN_SECOND'],

########################/language/en/common.php
//countown
$lang = array_merge($lang, array(
'MOD_COUNTOWN_COUNT' => 'Countdown',
'MOD_COUNTOWN_UNTIL' => 'Until',
'MOD_COUNTOWN_HAS' => 'has',
'MOD_COUNTOWN_DAY' => 'day',
'MOD_COUNTOWN_HOUR' => 'hour',
'MOD_COUNTOWN_MINUTE' => 'minute',
'MOD_COUNTOWN_SECOND' => 'second',

));

#####################/styles/prosilver/template/count_down.html

<!-- IF S_ENABLE_COUNT_DOWN -->
<hr />
<div class="navbar">
<div class="inner"><span class="corners-top"><span></span></span>

<div style="text-align:center; font-size: 1.3em;">
<form name="count">
<input type="text" size="80" name="count2" style="color: #ff0000; font-weight: bold; text-align: center;">
</form>


<script>

/*
Count down until any date script-
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!
*/


//change the text below to reflect your own,
var before="{BEFORE_COUNT_DOWN}"
var current="{CURRENT_COUNT_DOWN}"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

function countdown(yr,m,d,h,i,s){
theyear=yr;themonth=m;theday=d;thehour=h;themin=i;thesec=s
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr+" "+h+":"+i+":"+s
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=0){
document.forms.count.count2.value=current
return
}
else
document.forms.count.count2.value="{MOD_COUNTOWN_COUNT}: {MOD_COUNTOWN_UNTIL} "+before+", {MOD_COUNTOWN_HAS} "+dday+" {MOD_COUNTOWN_DAY} "+dhour+" {MOD_COUNTOWN_HOUR} "+dmin+" {MOD_COUNTOWN_MINUTE} "+dsec+" {MOD_COUNTOWN_SECOND}."
setTimeout("countdown(theyear,themonth,theday,thehour,themin,thesec)",1000)
}
//enter the count down date using the format year/month/day
countdown({DATE_COUNT_DOWN})
</script>
</div>

<span class="corners-bottom"><span></span></span></div>
</div>
<hr />
<!-- ENDIF -->

#####################END
samuraiii
Registered User
Posts: 2
Joined: Sun Jul 10, 2011 10:53 am

Re: Suggestes changes for better translatability

by wang5555 » Tue Jul 12, 2011 12:40 am

Thanks for your suggestion. :D
It is more blessed to give than to reveive, welcome to letter, thanks & good-bye!
Good luck ^_^
Welcome to my forum!!
http://wang5555.hopto.org/phpBB3/
p.s. Shut down computer before 11 clock night!!!
User avatar
wang5555
Translator
Posts: 602
Joined: Wed Oct 27, 2004 2:57 pm
Location: Taiwan