faire une bannière qui change à chaque clic (comme actuellement sur mon forum) reste délicat sur mon site. De ce fait je vais refaire comme il y a un an, une bannière par mois. Ce code que j'ai retiré de mon ancien style est-il potable, correct ou existe-til mieux ?
Mes images étant dans /www/styles/01.04.01/theme/images/banniere_aout_du_01_au_15.jpgheader('Content-type: text/css; charset=UTF-8');
$Fnm = "vpl.log";
$inF = fopen($Fnm,"w");
$SeasonDates = array('/12/21'=>'hiver','/03/21'=>'printemps','/06/21'=>'ete','/07/01'=>'juillet_du_01_au_15','/07/15'=>'juillet_du_15_au_31','/08/01'=>'aout_du_01_au_15','/08/15'=>'aout_du_15_au_31','/09/01'=>'septembre_du_01_au_20','/09/21'=>'septembre_du_21_au_30',
'/10/01'=>'octobre_du_01_au_15','/10/16'=>'octobre_du_16_au_31','/11/16'=>'novembre_du_16_au_30','/12/22'=>'hiver');
foreach ($SeasonDates AS $key => $value){
$SeasonDate = date("Y").$key;
fwrite($inF,$value.' : '.strtotime("now").' >'.strtotime($SeasonDate));
if (strtotime("now") > strtotime($SeasonDate)){
$banniere = "banniere_$value.jpg";
}
Merci.