Subversion Repositories Applications.papyrus

Rev

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

Rev Author Line No. Line
2094 drzraf 1
<?php
2
// Réglages de PHP
3
setlocale(LC_ALL, 'fr_FR');
4
date_default_timezone_set('Europe/Paris');
5
?>
6
<!-- SYNDICATION - DEBUT -->
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> -->
9
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.pack.js"></script>
10
<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" />
11
<div class="flux_RSS">
12
	<?php if ($erreurs || $informations) : ?>
13
		<h1>Erreur</h1>
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"].'"' : ""; ?>>
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>
37
    				<?php foreach ($site['pages'] as $page) : ?>
38
    					<?php
39
							//Traitement spécifique tela
40
							// La ligne ci-dessous sert à enlever les "align=left" dans les images génériques par spip
41
							// TODO : enlever du flux RSS
42
							$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12);
43
 
44
							// Formatage date
45
							$timestamp = strtotime($page['date']);
46
							$page['date'] = strftime('%A %d %B %Y', $timestamp);
47
 
48
    						$titre_page = preg_replace('/^\d+-\d+&nbsp;:/', '', $page['titre']);
49
							$tpl_url = preg_replace('/(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.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
							}
54
						?>
55
    					<div class="actualites1">
56
    						<a href="<?=sprintf($tpl_url, 'XL')?>" class="image-lien"
57
    							title="<?=$titre_page?> - Publiée le <?=$page['date']?> - GUID : <?=$guid?>"
58
    							rel="galerie-princ">
59
    							<img src="<?=sprintf($tpl_url, 'CRX2S')?>" alt="<?=$titre_page?>"/>
60
    						</a>
61
 
62
    						<div style="display: none;">
63
								<div id="cel-obs-<?=$guid?>" class="infos-annexe">
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>
72
	    						</div>
73
    						</div>
74
						</div>
75
    				<?php endforeach; ?>
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']);
85
						$tpl_url = preg_replace('/(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.jpg$/', '%s.jpg', $page['guid']);
86
						$guid = $page['guid'];
87
						if (preg_match('/appli:cel-img:([0-9]+)(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.jpg$/', 	$page['guid'], $match)) {
88
  							$guid = (int) $match[1];
89
						}
90
    				?>
91
    				<div class="actualites1">
92
   						<a href="<?=sprintf($tpl_url, 'XL')?>" class="image-lien"
93
   							title="<?=$titre_page?> - Publiée le <?=$page['date']?> - GUID : <?=$guid?>"
94
   							rel="galerie-princ">
95
   							<img id="imgExtra" src="<?=sprintf($tpl_url, 'CRS')?>" alt="<?=$titre_page?>"/>
96
   						</a>
97
					</div>
98
 
99
    				<script type="text/Javascript">
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
 
112
    					$(document).ready(function() {
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
122
    						});
123
    					});
124
    				</script>
125
    			</div>
126
  				<?php endforeach; ?>
127
		<?php endif; ?>
128
	</div>
129
<!-- SYNDICATION - FIN -->