PHP-Code:
{source}
<?php
function startbild()
{
$auf_s = array(0,8,8,8,8,8,7,7,7,7,6,6,6,7,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8);
$auf_m = array(0,23,21,16,10,1,50,38,24,10,55,40,24,9,53,38,23,9,55,43,32,23,15,10,7,6,8,12,18,26,35,45,55,6,16,27,38,49,1,11,22,33,45,56,8,20,32,44,55,4,13,19,22);
$unt_s = array(0,16,16,16,16,17,17,17,17,17,18,18,18,19,19,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,20,20,20,20,19,19,19,19,18,18,18,18,16,16,16,16,16,16,16,16,16);
$unt_m = array(0,27,36,46,58,10,22,35,47,59,11,23,35,46,58,9,20,32,43,54,4,14,22,30,35,38,38,37,32,26,17,7,55,42,28,13,58,42,27,11,55,40,25,11,58,46,35,27,20,16,15,16,20);
$nr = date("W");
$nr = intval($nr);
$M = strftime("%m");
$T = strftime("%d");
$S = strftime("%H");
$MI = strftime("%M");
if (($M < 3) || ($M > 10)) $picture="winter.gif";
else if (($M == 3) || ($M == 4)) $picture="spring.gif";
else if (($M > 4) && ($M < 9)) $picture="summer.gif";
else if (($M == 9) || ($M == 10)) $picture="autumn.gif";
else $picture="spring.gif";$azs = $auf_s[$nr] - 1;
$uzs = $unt_s[$nr] + 1;
if (($S > $azs) && ($S < $uzs)) $startbild = $picture;
else if (($S == $azs) && ($MI >= $auf_m[$nr])) $startbild = $picture;
else if (($S == $uzs) && ($MI <= $unt_m[$nr])) $startbild = $picture;
else $startbild = "night.gif";
echo '<img src="images/stories/'.$startbild.'">';
}
startbild();
?>
{/source}
Vielen Dank an alle und Frohe Weihnachten!
Lesezeichen