* @copyright 2011 PHP-Backoffice * @link www.php-backoffice.de * @link http://www.contenido.org * * $Id$ */ $cfgMod = array( 'debug' => false, 'eak_imgset' => 'default/', 'show_countdown' => true ); // init db-object if (!is_object($oDb)) { $oDb = new DB_Contenido(); } // init template if (!is_object($oTpl)) { $oTpl = new Template(); } $oTpl->reset(); // init debugger if ($cfgMod['debug']) { cInclude('classes', 'Debug/DebuggerFactory.class.php'); /* @var $oDebug Debug_VisibleAdv */ $oDebug = DebuggerFactory::getDebugger('visible_adv'); } $oToday = new DateTime(); if ($cfgMod['debug']) { if(isset($_GET['dateoffset'])) { $oToday->modify($_GET['dateoffset']." days"); } } $oXmasDate = new DateTime(date("Y")."-12-24 23:59:59"); $oXmasMondayDate = clone $oXmasDate; $oXmasMondayDate->modify("+2 days"); $oFirstAdventDate = new DateTime(date("Y")."-11-26"); $oFirstAdventDate->modify("next sunday"); $oSecondAdvent = clone $oFirstAdventDate; $oSecondAdvent->modify("+7 days"); $oThirdAdvent = clone $oSecondAdvent; $oThirdAdvent->modify("+7 days"); $oFourthAdvent = clone $oThirdAdvent; $oFourthAdvent->modify("+7 days"); if($oToday <= $oXmasMondayDate && $oToday >= $oFirstAdventDate) { $sImgPath = $cfgClient[$client]['path']['htmlpath'].getEffectiveSetting('adventskranz', 'imghtmlpath', "images/adventskranz/".$cfgMod['eak_imgset']); $bShowCountDown = getEffectiveSetting('adventskranz', 'show_countdown', $cfgMod['show_countdown']); if($oToday >= $oFirstAdventDate && $oToday < $oSecondAdvent) { $sImgPath .= "advent1.gif"; } else if($oToday >= $oSecondAdvent && $oToday < $oThirdAdvent) { $sImgPath .= "advent2.gif"; } else if ($oToday >= $oThirdAdvent && $oToday < $oFourthAdvent) { $sImgPath .= "advent3.gif"; } else { $sImgPath .= "advent4.gif"; } echo '
'."\n";
// countdown till xmas
$iDaysTillmas = (int) daysdiff( $oXmasDate->format("Y-m-d"), $oToday->format("Y-m-d"));
if($iDaysTillmas > 1) {
printf(mi18n("Noch %s Tage bis Weihnachten"), $iDaysTillmas);
} else if($iDaysTillmas == 1) {
printf(mi18n("Noch %s Tag bis Weihnachten"), $iDaysTillmas);
} else if($iDaysTillmas === 0) {
echo mi18n("Frohe Weihnacht!
(Heiliger Abend)");
} else {
echo mi18n("Frohe Weihnacht!");
}
echo "