0 ) : ?>
'.$gauche.'
'.$droite.'
';
return $output;
}
}
if (!function_exists('date_compare')) {
//tri par ordre chronologique
function date_compare($a, $b)
{
$t1 = strtotime($a['bf_date_debut_evenement']);
$t2 = strtotime($b['bf_date_debut_evenement']);
return $t1 - $t2;
}
}
usort($fiches, 'date_compare');
$gauche = true;
$output = '';
foreach ($fiches as $key => $fiche) {
$date = explode('-', $fiche['bf_date_debut_evenement']);
// premier passage
if ( !isset($anneeencours) || $anneeencours < $date[0] ) {
$anneeencours = $date[0];
$years[] = $anneeencours;
$output .= affiche_ligne_timeline('Année
', ''.$anneeencours.'
');
}
switch ($fiche['listeListeTailleImage']) {
case 'ss-small':
$pixelsimage = 100;
break;
case 'ss-medium':
$pixelsimage = 200;
break;
case 'ss-large':
$pixelsimage = 300;
break;
default:
$pixelsimage = 300;
$fiche['listeListeTailleImage'] = 'ss-large';
break;
}
if (!empty($fiche['imagebf_image']) and file_exists('files/'.$fiche['imagebf_image'])) {
$url = redimensionner_image('files/'.$fiche['imagebf_image'], 'cache/image_'.$pixelsimage.'_'.$pixelsimage.'_'.$fiche['imagebf_image'], $pixelsimage, $pixelsimage);
} else {
$url = redimensionner_image('tools/bazar/presentation/images/placeholder-800-800.jpg', 'cache/placeholder_'.$pixelsimage.'_'.$pixelsimage.'.jpg', $pixelsimage, $pixelsimage);
}
if ($gauche) {
$gauche=false;
$output .= affiche_ligne_timeline(
''.$fiche['bf_titre'].'',
''.$fiche['texte'],
$fiche['listeListeTailleImage']
);
}
else {
$gauche=true;
$output .= affiche_ligne_timeline(
''.$fiche['texte'],
''.$fiche['bf_titre'].'',
$fiche['listeListeTailleImage'], ''
);
}
}
?>
addJavascriptFile('tools/bazar/presentation/javascripts/timeline.js');
?>