Subversion Repositories Sites.tela-botanica.org

Rev

Rev 1033 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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 -->
1029 jpm 7
<!-- Penser aux inclusions ci dessous si nécessaire : -->
8
<!-- <script type="text/javascript" src="/commun/jquery/1.4.2/jquery-1.4.2.min.js"></script> -->
1101 raphael 9
<script type="text/javascript" src="/commun/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.pack.js"></script>
10
<link rel="stylesheet" type="text/css" href="/commun/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.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"].'"' : ""; ?>>
1101 raphael 36
  						<a href="/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+&nbsp;:/', '', $page['titre']);
1033 jpm 49
							$tpl_url = preg_replace('/(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.jpg$/', '%s.jpg', $page['guid']);
995 jpm 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">
1033 jpm 56
    						<a href="<?=sprintf($tpl_url, 'XL')?>" class="image-lien"
1016 jpm 57
    							title="<?=$titre_page?> - Publiée le <?=$page['date']?> - GUID : <?=$guid?>"
58
    							rel="galerie-princ">
1033 jpm 59
    							<img src="<?=sprintf($tpl_url, 'CRX2S')?>" alt="<?=$titre_page?>"/>
995 jpm 60
    						</a>
907 gduche 61
 
62
    						<div style="display: none;">
995 jpm 63
								<div id="cel-obs-<?=$guid?>" class="infos-annexe">
1016 jpm 64
	    							<strong>
65
										<a class="image-titre" href="<?=$page['description']?>"
66
											onclick="window.open(this.href);return false;"
67
											title="Cliquez pour accéder à la fiche eFlore">
68
											<?=$titre_page?>
69
										</a>
70
									</strong><br />
71
									<span class="image-date">Publiée le <?=$page['date']?></span>
907 gduche 72
	    						</div>
73
    						</div>
828 gduche 74
						</div>
75
    				<?php endforeach; ?>
1016 jpm 76
 
77
    				<!-- Image Extra en dessous des vignettes -->
78
    				<?
79
    					$page = $sites[0]['pages'][7];
80
						// Formatage date
81
						$timestamp = strtotime($page['date']);
82
						$page['date'] = strftime('%A %d %B %Y', $timestamp);
83
 
84
    					$titre_page = preg_replace('/^\d+-\d+&nbsp;:/', '', $page['titre']);
1033 jpm 85
						$tpl_url = preg_replace('/(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.jpg$/', '%s.jpg', $page['guid']);
1016 jpm 86
						$guid = $page['guid'];
1033 jpm 87
						if (preg_match('/appli:cel-img:([0-9]+)(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.jpg$/', 	$page['guid'], $match)) {
1016 jpm 88
  							$guid = (int) $match[1];
89
						}
90
    				?>
907 gduche 91
    				<div class="actualites1">
1033 jpm 92
   						<a href="<?=sprintf($tpl_url, 'XL')?>" class="image-lien"
1016 jpm 93
   							title="<?=$titre_page?> - Publiée le <?=$page['date']?> - GUID : <?=$guid?>"
94
   							rel="galerie-princ">
1033 jpm 95
   							<img id="imgExtra" src="<?=sprintf($tpl_url, 'CRS')?>" alt="<?=$titre_page?>"/>
966 jpm 96
   						</a>
929 gduche 97
					</div>
1016 jpm 98
 
907 gduche 99
    				<script type="text/Javascript">
1016 jpm 100
    					function formaterTitre(titre, currentArray, currentIndex, currentOpts) {
101
    						var motif = /GUID : ([0-9A-Z]+)$/;
102
    						motif.exec(titre);
103
    						var guid = RegExp.$1;
104
    						var info = $('#cel-obs-'+guid).clone().html();
105
    						var tpl =
106
    							'<div id="cel-legende">'+
107
    							(titre && titre.length ? '<p>'+info+'<\/p>' : '' )+
108
    							'<\/div>';
109
    						return tpl;
110
    					}
111
 
907 gduche 112
    					$(document).ready(function() {
1016 jpm 113
    						$('a.image-lien').attr('rel', 'galerie-princ').fancybox({
114
    							transitionIn:'elastic',
115
    							transitionOut:'elastic',
116
    							speedIn	:600,
117
    							speedOut:200,
118
    							overlayShow:true,
119
    							titleShow:true,
120
    							titlePosition:'inside',
121
    							titleFormat:formaterTitre
907 gduche 122
    						});
123
    					});
124
    				</script>
995 jpm 125
    			</div>
828 gduche 126
  				<?php endforeach; ?>
127
		<?php endif; ?>
128
	</div>
966 jpm 129
<!-- SYNDICATION - FIN -->