1,52 → 1,129 |
<!-- SYNDICATION - DEBUT --> |
<div class="flux_RSS"> |
<?php if ($erreurs || $informations) : ?> |
<h1>Erreur</h1> |
<div class="contenu_RSS"> |
<b>Impossible d'afficher le flux.</b><br /> |
|
<!-- Affichage des erreurs et messages d'information : --> |
<?php if ($erreurs) : ?> |
<?php foreach ($erreurs as $erreur) : ?> |
<p class="pap_erreur"><?=$erreur;?></p> |
<?php endforeach; ?> |
<?php endif; ?> |
|
<?php if ($informations) : ?> |
<?php foreach ($informations as $information) : ?> |
<p class="pap_info"><?=$information;?></p> |
<?php endforeach; ?> |
<?php endif; ?> |
</div> |
<?php else : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><a href="<?=$site['url']?>"><?=$site['titre']?></a></h1> |
<div class="contenu_RSS" <?=($site['id']!="") ? 'id="'.$site["id"].'"' : ""; ?>> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
//Traitement spécifique tela |
// La ligne ci-dessous sert à enlever les "align=left" dans les images générées par spip |
// TODO : enlever du flux RSS |
$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12); |
?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div class="actualites1"> |
<a title="<?=$page['titre']?>" href="http://www.tela-botanica.org/appli:cel-img:0000<?=$page['guid']?>M"><img src="http://www.tela-botanica.org/appli:cel-img:0000<?=$page['guid']?>S" alt="<?=$page['titre']?>" /></a> |
</div> |
<?php endforeach; ?> |
<img id="imgExtra" src="http://www.tela-botanica.org/appli:cel-img:0000<?=$sites[0]['pages'][7]['guid']?>M" /> |
|
|
</div> |
<?php endforeach; ?> |
<?php endif; ?> |
</div> |
|
|
|
<!-- SYNDICATION - FIN --> |
<?php |
// Réglages de PHP |
setlocale(LC_ALL, 'fr_FR'); |
date_default_timezone_set('Europe/Paris'); |
?> |
<!-- SYNDICATION - DEBUT --> |
<!-- Penser aux inclusions ci dessous si nécessaire : --> |
<!-- <script type="text/javascript" src="/commun/jquery/1.4.2/jquery-1.4.2.min.js"></script> --> |
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.pack.js"></script> |
<link rel="stylesheet" type="text/css" href="http://www.tela-botanica.org/commun/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.css" media="screen" /> |
<div class="flux_RSS"> |
<?php if ($erreurs || $informations) : ?> |
<h1>Erreur</h1> |
<div class="contenu_RSS"> |
<b>Impossible d'afficher le flux.</b><br /> |
|
<!-- Affichage des erreurs et messages d'information : --> |
<?php if ($erreurs) : ?> |
<?php foreach ($erreurs as $erreur) : ?> |
<p class="pap_erreur"><?=$erreur;?></p> |
<?php endforeach; ?> |
<?php endif; ?> |
|
<?php if ($informations) : ?> |
<?php foreach ($informations as $information) : ?> |
<p class="pap_info"><?=$information;?></p> |
<?php endforeach; ?> |
<?php endif; ?> |
</div> |
<?php else : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><?=$site['titre']?></h1> |
<div class="contenu_RSS" <?=($site['id']!="") ? 'id="'.$site["id"].'"' : ""; ?>> |
<a href="http://www.tela-botanica.org/eflore/cel2/jrest/CelSyndicationImage/complet/atom" class="suivre-observations" title="Suivre les images" onclick="window.open(this.href);return false;">Suivre les images</a> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
//Traitement spécifique tela |
// La ligne ci-dessous sert à enlever les "align=left" dans les images génériques par spip |
// TODO : enlever du flux RSS |
$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12); |
|
// Formatage date |
$timestamp = strtotime($page['date']); |
$page['date'] = strftime('%A %d %B %Y', $timestamp); |
|
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
$tpl_url = preg_replace('/(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.jpg$/', '%s.jpg', $page['guid']); |
$guid = $page['guid']; |
if (preg_match('/appli:cel-img:([0-9]+)[SML]\.jpg$/', $page['guid'], $match)) { |
$guid = (int) $match[1]; |
} |
?> |
<div class="actualites1"> |
<a href="<?=sprintf($tpl_url, 'XL')?>" class="image-lien" |
title="<?=$titre_page?> - Publiée le <?=$page['date']?> - GUID : <?=$guid?>" |
rel="galerie-princ"> |
<img src="<?=sprintf($tpl_url, 'CRX2S')?>" alt="<?=$titre_page?>"/> |
</a> |
|
<div style="display: none;"> |
<div id="cel-obs-<?=$guid?>" class="infos-annexe"> |
<strong> |
<a class="image-titre" href="<?=$page['description']?>" |
onclick="window.open(this.href);return false;" |
title="Cliquez pour accéder à la fiche eFlore"> |
<?=$titre_page?> |
</a> |
</strong><br /> |
<span class="image-date">Publiée le <?=$page['date']?></span> |
</div> |
</div> |
</div> |
<?php endforeach; ?> |
|
<!-- Image Extra en dessous des vignettes --> |
<? |
$page = $sites[0]['pages'][7]; |
// Formatage date |
$timestamp = strtotime($page['date']); |
$page['date'] = strftime('%A %d %B %Y', $timestamp); |
|
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
$tpl_url = preg_replace('/(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.jpg$/', '%s.jpg', $page['guid']); |
$guid = $page['guid']; |
if (preg_match('/appli:cel-img:([0-9]+)(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.jpg$/', $page['guid'], $match)) { |
$guid = (int) $match[1]; |
} |
?> |
<div class="actualites1"> |
<a href="<?=sprintf($tpl_url, 'XL')?>" class="image-lien" |
title="<?=$titre_page?> - Publiée le <?=$page['date']?> - GUID : <?=$guid?>" |
rel="galerie-princ"> |
<img id="imgExtra" src="<?=sprintf($tpl_url, 'CRS')?>" alt="<?=$titre_page?>"/> |
</a> |
</div> |
|
<script type="text/Javascript"> |
function formaterTitre(titre, currentArray, currentIndex, currentOpts) { |
var motif = /GUID : ([0-9A-Z]+)$/; |
motif.exec(titre); |
var guid = RegExp.$1; |
var info = $('#cel-obs-'+guid).clone().html(); |
var tpl = |
'<div id="cel-legende">'+ |
(titre && titre.length ? '<p>'+info+'<\/p>' : '' )+ |
'<\/div>'; |
return tpl; |
} |
|
$(document).ready(function() { |
$('a.image-lien').attr('rel', 'galerie-princ').fancybox({ |
transitionIn:'elastic', |
transitionOut:'elastic', |
speedIn :600, |
speedOut:200, |
overlayShow:true, |
titleShow:true, |
titlePosition:'inside', |
titleFormat:formaterTitre |
}); |
}); |
</script> |
</div> |
<?php endforeach; ?> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |