Avatar billede xantor Nybegynder
01. marts 2002 - 18:39 Der er 7 kommentarer og
1 løsning

Kalender sjov igen...

JEg skal bruge en kalender der kan liste alle dagene i denne måned... plus at skifte til de andre måneder/år...
Avatar billede lillebror Nybegynder
01. marts 2002 - 18:46 #1
Er det en du har lyst til selv at vidreudvikle ?
Avatar billede lillebror Nybegynder
01. marts 2002 - 18:47 #2
For så smelter jeg lige en sammen til dig
Avatar billede lillebror Nybegynder
01. marts 2002 - 19:22 #3
Så kan du arbejde videre med den

<?
$month[1] = "Januar";
$month[2] = "Februar";
$month[3] = "Marts";
$month[4] = "April";
$month[5] = "Maj";
$month[6] = "Juni";
$month[7] = "Juli";
$month[8] = "August";
$month[9] = "September";
$month[10] = "Oktober";
$month[11] = "November";
$month[12] = "December";

$days[1] = "31";
$days[2] = "28";
$days[3] = "31";
$days[4] = "30";
$days[5] = "31";
$days[6] = "30";
$days[7] = "31";
$days[8] = "31";
$days[9] = "30";
$days[10] = "31";
$days[11] = "30";
$days[12] = "31";

$weekday[1] = "Søndag";
$weekday[2] = "Mandag";
$weekday[3] = "Tirsdag";
$weekday[4] = "Onsdag";
$weekday[5] = "Torsdag";
$weekday[6] = "Fredag";
$weekday[7] = "Lørdag";

$datemonth = date(n);
$dateday = date(j);
?>
<a href="?mon=<? echo"$month[1]"?>&num=1"><? echo"$month[1]"; ?></a>
<a href="?mon=<? echo"$month[2]"?>&num=2"><? echo"$month[2]"; ?></a>
<a href="?mon=<? echo"$month[3]"?>&num=3"><? echo"$month[3]"; ?></a>
<a href="?mon=<? echo"$month[4]"?>&num=4"><? echo"$month[4]"; ?></a>
<a href="?mon=<? echo"$month[5]"?>&num=5"><? echo"$month[5]"; ?></a>
<a href="?mon=<? echo"$month[6]"?>&num=6"><? echo"$month[6]"; ?></a>
<a href="?mon=<? echo"$month[7]"?>&num=7"><? echo"$month[7]"; ?></a>
<a href="?mon=<? echo"$month[8]"?>&num=8"><? echo"$month[8]"; ?></a>
<a href="?mon=<? echo"$month[9]"?>&num=9"><? echo"$month[9]"; ?></a>
<a href="?mon=<? echo"$month[10]"?>&num=10"><? echo"$month[10]"; ?></a>
<a href="?mon=<? echo"$month[11]"?>&num=11"><? echo"$month[11]"; ?></a>
<a href="?mon=<? echo"$month[12]"?>&num=12"><? echo"$month[12]"; ?></a>

<table>
<?
for($i = 1; $i <= $days[$num]; $i++){
if($i == "$dateday" && $num == $datemonth){
echo "
<tr>
<td bgcolor=\"\#000000\">
$i
</td>
<tr>";
} else {
echo "
<tr>
<td>
$i
</td>
<tr>";
}
}
?>
</table>
Avatar billede mortenfn Nybegynder
01. marts 2002 - 19:27 #4
Avatar billede lillebror Nybegynder
01. marts 2002 - 19:28 #5
mortenfn, du postede den samme sidste gang han lavede sådan en post her ?
Avatar billede mortenfn Nybegynder
01. marts 2002 - 19:28 #6
ÅÅ lidt mere end linket ovenover er nok det du vil have

http://www.thorsnet.dk/?side=kalender
Avatar billede lillebror Nybegynder
01. marts 2002 - 19:37 #7
Her er, hvis du stadig selv vil videreudvikle. Har lige tilføjet dit krav om at den skulle kunne bladre mellem år

<?
if($year == ""){
$year = date(y);
}
if($num == ""){
$num = date(n);
}
$month[1] = "Januar";
$month[2] = "Februar";
$month[2] = "Februar";
$month[3] = "Marts";
$month[4] = "April";
$month[5] = "Maj";
$month[6] = "Juni";
$month[7] = "Juli";
$month[8] = "August";
$month[9] = "September";
$month[10] = "Oktober";
$month[11] = "November";
$month[12] = "December";

$days[1] = "31";
if($year % 4){
$days[2] = "28";
} else {
$days[2] = "29";
}
$days[3] = "31";
$days[4] = "30";
$days[5] = "31";
$days[6] = "30";
$days[7] = "31";
$days[8] = "31";
$days[9] = "30";
$days[10] = "31";
$days[11] = "30";
$days[12] = "31";

$weekday[1] = "Søndag";
$weekday[2] = "Mandag";
$weekday[3] = "Tirsdag";
$weekday[4] = "Onsdag";
$weekday[5] = "Torsdag";
$weekday[6] = "Fredag";
$weekday[7] = "Lørdag";

$datemonth = date(n);
$dateday = date(j);
?>
<a href="?mon=<? echo"$month[1]"?>&num=1"><? echo"$month[1]"; ?></a>
<a href="?mon=<? echo"$month[2]"?>&num=2"><? echo"$month[2]"; ?></a>
<a href="?mon=<? echo"$month[3]"?>&num=3"><? echo"$month[3]"; ?></a>
<a href="?mon=<? echo"$month[4]"?>&num=4"><? echo"$month[4]"; ?></a>
<a href="?mon=<? echo"$month[5]"?>&num=5"><? echo"$month[5]"; ?></a>
<a href="?mon=<? echo"$month[6]"?>&num=6"><? echo"$month[6]"; ?></a>
<a href="?mon=<? echo"$month[7]"?>&num=7"><? echo"$month[7]"; ?></a>
<a href="?mon=<? echo"$month[8]"?>&num=8"><? echo"$month[8]"; ?></a>
<a href="?mon=<? echo"$month[9]"?>&num=9"><? echo"$month[9]"; ?></a>
<a href="?mon=<? echo"$month[10]"?>&num=10"><? echo"$month[10]"; ?></a>
<a href="?mon=<? echo"$month[11]"?>&num=11"><? echo"$month[11]"; ?></a>
<a href="?mon=<? echo"$month[12]"?>&num=12"><? echo"$month[12]"; ?></a>
<br>
<?
$y = 2005;
for($i = 2000; $i <= $y; $i++){
echo "<a href=?mon=$mon&num=$num&year=$i>$i </a>";
}
?>
<table>
<?
for($i = 1; $i <= $days[$num]; $i++){
if($i == "$dateday" && $num == $datemonth){
echo "
<tr>
<td bgcolor=\"\#000000\">
$i
</td>
<tr>";
} else {
echo "
<tr>
<td>
$i
</td>
<tr>";
}
}
?>
</table>
Avatar billede trayzor Nybegynder
06. maj 2002 - 20:16 #8
lillebror: er det bare for sjov du har month[] og weekday[] med?

/Trayzor
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester