1005 |
jpm |
1 |
<?php
|
|
|
2 |
// Réglages de PHP
|
|
|
3 |
setlocale(LC_ALL, 'fr_FR');
|
|
|
4 |
date_default_timezone_set('Europe/Paris');
|
|
|
5 |
?>
|
828 |
gduche |
6 |
<!-- SYNDICATION - DEBUT -->
|
966 |
jpm |
7 |
<!-- Penser aux inclusions ci dessous :
|
907 |
gduche |
8 |
<script type="text/javascript" src="/commun/jquery/1.4.2/jquery-1.4.2.min.js"></script>
|
|
|
9 |
<script type="text/javascript" src="/commun/jquery/fancybox/jquery.fancybox-1.3.2.js"></script>
|
|
|
10 |
<link rel="stylesheet" type="text/css" href="/commun/jquery/fancybox/jquery.fancybox-1.3.2.css" media="screen" /> /-->
|
966 |
jpm |
11 |
<div class="flux_RSS">
|
|
|
12 |
<?php if ($erreurs || $informations) : ?>
|
|
|
13 |
<h1>Erreur</h1>
|
828 |
gduche |
14 |
<div class="contenu_RSS">
|
|
|
15 |
<b>Impossible d'afficher le flux.</b><br />
|
|
|
16 |
|
|
|
17 |
<!-- Affichage des erreurs et messages d'information : -->
|
|
|
18 |
<?php if ($erreurs) : ?>
|
|
|
19 |
<?php foreach ($erreurs as $erreur) : ?>
|
|
|
20 |
<p class="pap_erreur"><?=$erreur;?></p>
|
|
|
21 |
<?php endforeach; ?>
|
|
|
22 |
<?php endif; ?>
|
|
|
23 |
|
|
|
24 |
<?php if ($informations) : ?>
|
|
|
25 |
<?php foreach ($informations as $information) : ?>
|
|
|
26 |
<p class="pap_info"><?=$information;?></p>
|
|
|
27 |
<?php endforeach; ?>
|
|
|
28 |
<?php endif; ?>
|
|
|
29 |
</div>
|
|
|
30 |
<?php else : ?>
|
|
|
31 |
<!-- Affichage du flux RSS -->
|
|
|
32 |
<?php $flux = array(); ?>
|
|
|
33 |
<?php foreach ($sites as $site) : ?>
|
|
|
34 |
<h1><?=$site['titre']?></h1>
|
|
|
35 |
<div class="contenu_RSS" <?=($site['id']!="") ? 'id="'.$site["id"].'"' : ""; ?>>
|
995 |
jpm |
36 |
<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>
|
828 |
gduche |
37 |
<?php foreach ($site['pages'] as $page) : ?>
|
|
|
38 |
<?php
|
928 |
gduche |
39 |
//Traitement spécifique tela
|
|
|
40 |
// La ligne ci-dessous sert à enlever les "align=left" dans les images génériques par spip
|
828 |
gduche |
41 |
// TODO : enlever du flux RSS
|
|
|
42 |
$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12);
|
1005 |
jpm |
43 |
|
|
|
44 |
// Formatage date
|
|
|
45 |
$timestamp = strtotime($page['date']);
|
|
|
46 |
$page['date'] = strftime('%A %d %B %Y', $timestamp);
|
|
|
47 |
|
995 |
jpm |
48 |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']);
|
|
|
49 |
$tpl_url = preg_replace('/[SML]\.jpg$/', '%s.jpg', $page['guid']);
|
|
|
50 |
$guid = $page['guid'];
|
|
|
51 |
if (preg_match('/appli:cel-img:([0-9]+)[SML]\.jpg$/', $page['guid'], $match)) {
|
|
|
52 |
$guid = (int) $match[1];
|
|
|
53 |
}
|
928 |
gduche |
54 |
?>
|
828 |
gduche |
55 |
<div class="actualites1">
|
995 |
jpm |
56 |
<a href="<?=$page['description']?>" class="image-lien" title="<?=sprintf($tpl_url, L)?>" rel="galerie-princ">
|
|
|
57 |
<img src="<?=sprintf($tpl_url, M)?>" alt="<?=$titre_page?>"/>
|
|
|
58 |
</a>
|
907 |
gduche |
59 |
|
|
|
60 |
<div style="display: none;">
|
995 |
jpm |
61 |
<div id="cel-obs-<?=$guid?>" class="infos-annexe">
|
907 |
gduche |
62 |
<a href="<?=$page['description']?>"><span class="image-titre"><?=$titre_page?></span><br />
|
995 |
jpm |
63 |
<span class="image-date">Publiée le <?=$page['date']?></span><br />
|
|
|
64 |
Cliquez pour voir le détail
|
907 |
gduche |
65 |
</a>
|
|
|
66 |
</div>
|
|
|
67 |
</div>
|
828 |
gduche |
68 |
</div>
|
|
|
69 |
<?php endforeach; ?>
|
929 |
gduche |
70 |
<!-- img id="imgExtra" src="http://www.tela-botanica.org/appli:cel-img:0000<?=$sites[0]['pages'][7]['guid']?>M" / -->
|
966 |
jpm |
71 |
<? $page = $sites[0]['pages'][7]; ?>
|
907 |
gduche |
72 |
<div class="actualites1">
|
995 |
jpm |
73 |
<a href="<?=$page['description']?>" class="image-lien" title="<?=sprintf($tpl_url, L)?>" rel="galerie-princ">
|
|
|
74 |
<img id="imgExtra" src="<?=sprintf($tpl_url, M)?>" alt="<?=$titre_page?>"/>
|
966 |
jpm |
75 |
</a>
|
929 |
gduche |
76 |
<div style="display: none;">
|
|
|
77 |
<div id="cel-obs-img-extra" class="infos-annexe">
|
966 |
jpm |
78 |
<a href="<?=$page['description']?>">
|
|
|
79 |
<span class="image-titre"><?=$titre_page?></span><br />
|
|
|
80 |
<span class="image-date">Publiée le <?=$page['date']?></span><br />
|
|
|
81 |
Cliquez pour voir le détail
|
929 |
gduche |
82 |
</a>
|
907 |
gduche |
83 |
</div>
|
929 |
gduche |
84 |
</div>
|
|
|
85 |
</div>
|
907 |
gduche |
86 |
<script type="text/Javascript">
|
928 |
gduche |
87 |
//Remplacer le lien de chaque actualité par un #cel-obs-guid
|
907 |
gduche |
88 |
$(document).ready(function() {
|
|
|
89 |
$('.actualites1').each(function () {
|
|
|
90 |
var id = $(this).find('.infos-annexe').attr('id');
|
|
|
91 |
var lien = $(this).find('.image-lien');
|
|
|
92 |
lien.attr('href', '#' + id);
|
|
|
93 |
|
|
|
94 |
$('#' + id).prepend('<img height="500px" src="' + lien.attr('title') + ' /> <br />');
|
|
|
95 |
lien.fancybox({
|
966 |
jpm |
96 |
'titlePosition' : 'inside',
|
|
|
97 |
'transitionIn' : 'none',
|
|
|
98 |
'transitionOut' : 'none'
|
907 |
gduche |
99 |
});
|
|
|
100 |
});
|
|
|
101 |
});
|
|
|
102 |
</script>
|
995 |
jpm |
103 |
</div>
|
828 |
gduche |
104 |
<?php endforeach; ?>
|
|
|
105 |
<?php endif; ?>
|
|
|
106 |
</div>
|
966 |
jpm |
107 |
<!-- SYNDICATION - FIN -->
|