Hoe lang bestaat je forum probleem

Hulp nodig bij een modificaties of op zoek naar een MOD? Bekijk ons archief. Support wordt helaas niet meer verleend.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
Gesloten
Digitus
Berichten: 148
Lid geworden op: 17 okt 2003, 22:14
Contacteer:

Hoe lang bestaat je forum probleem

Bericht door Digitus » 30 mar 2007, 12:06

Ik heb het onderstaande in mijn overall_header.tpl staan, het werkt goed, op 1 ding na. Forum bestaat al : 2 jaar, 7 maanden, en 15.958333333333328 dagen. bij de dagen geeft hij achter de komma een reeks cijfers aan, kan iemand mij hiermee helpen? zodat deze weg gaan?

Alvast bedankt voor de moeite.

<SCRIPT LANGUAGE="JavaScript">
function DateEstablished(startmonth, startdate, startyear) {
sdate=startdate;
smonth=startmonth-1;
syear=startyear;
var DaysInMonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
today = new Date()
var thisyear = today.getFullYear();
var thismonth = today.getMonth();
var thisdate = today.getDate();
mstart = new Date(syear,(smonth==12?1:smonth+1),1);
days1 = (mstart - new Date(syear,smonth,sdate))/(24*60*60*1000)-1;
mend = new Date(thisyear,thismonth,1);
days2 = (new Date(thisyear,thismonth,thisdate) - mend)/(24*60*60*1000)+1;
dayst = days1 + days2;
if (dayst >= DaysInMonth[smonth]) {
AddOneMonth = 1;
dayst -= DaysInMonth[smonth];
}
else AddOneMonth = 0;
ydiff1 = thisyear-mstart.getFullYear();
mdiff1 = thismonth-mstart.getMonth()+AddOneMonth;
if (mdiff1 >11) { mdiff1=0; ydiff1++; }
if (mdiff1 < 0) { mdiff1 = mdiff1 + 12; ydiff1--; }
temp = (ydiff1==0?"":(ydiff1==1?ydiff1+" jaar and ":ydiff1 + " jaar, "));
temp += (mdiff1==0?"0 months, and ":(mdiff1==1?mdiff1+" maand, and ":mdiff1+" maanden, en "));
temp += (dayst==0?"o dagen":(dayst==1 ? " 1 dag." : dayst + " dagen." ));
return temp;
}
</script>
<center><SCRIPT LANGUAGE="JavaScript">
document.write("<font face=Microsoft Sans Serif>");
document.write("<font size=1>");
document.write("<font color=#006699>");
document.write("Interactieve bestaat al : ");
document.write("<font color=#006699>");
document.write(DateEstablished(08,14,2004));
document.write("</font>");
document.write("</font>");
document.write("</font>");
document.write("</font>");
document.write("</font>");
</script>

Digitus
Berichten: 148
Lid geworden op: 17 okt 2003, 22:14
Contacteer:

Bericht door Digitus » 31 mar 2007, 20:05

Iemand ? Niemand?

svenn
Berichten: 5001
Lid geworden op: 14 jul 2004, 13:00
Locatie: Kortrijk
Contacteer:

Bericht door svenn » 31 mar 2007, 21:15

In php kan ik je helpen, in javascript kan ik bijna niks ... :(
Je kunt het met round(); in php.

Gesloten