user defined tag not working [solved]
Posted: Wed Jan 07, 2015 3:18 pm
I have this udf tag
The purpose was to show another background image according to the season. Worked fine, but not anymore. Nothing to my knowlodge has changed.
In the template you find <div id="bg_index">{img_seizoen}</div>
It's for cms ms version 1.11.9.
The website ishttp://www.slee-buitensport.nl/index.php
Can somebody tell me what is wrong? Just for the sake. My knowlodge of PHP is very limited.
Thanks for reading.
Code: Select all
function seizoen() {
date_default_timezone_set('UTC');
$limits=array(
'/12/21'=>'<img src="images/winter.jpg"/>',
'/09/21'=>'<img src="images/herfst.png" alt="moeder met kind in herfstlandschap in de bergen"/>',
'/06/21'=>'<img src="images/zomer.jpg"/>',
'/03/21'=>'<img src="images/lente.jpg" alt="wandelaar met rugzak"/>',
'/12/31'=>'<img src="images/winter.jpg"/>');
foreach($limits AS $key => $value) {
$limit=date("Y").$key;
if(strtotime("now")>strtotime($limit)) {
return $value;
}
}
}
echo seizoen();
In the template you find <div id="bg_index">{img_seizoen}</div>
It's for cms ms version 1.11.9.
The website ishttp://www.slee-buitensport.nl/index.php
Can somebody tell me what is wrong? Just for the sake. My knowlodge of PHP is very limited.
Thanks for reading.