Subversion Repositories Sites.tela-botanica.org

Rev

Rev 1114 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1113 aurelien 1
<?
2
function truncate($text, $chars = 25) {
3
    $text = $text." ";
4
    $text = substr($text,0,$chars);
5
    $text = substr($text,0,strrpos($text,' '));
6
    $text = $text."...";
7
    return $text;
8
}
9
?>
10
 
11
<!-- SYNDICATION - DEBUT -->
12
	<div class="flux_RSS">
13
		<?php if ($erreurs || $informations) : ?>
14
			<h1>Erreur</h1>
15
			<div class="contenu_RSS">
16
				<b>Impossible d'afficher le flux.</b><br />
17
 
18
				<!-- Affichage des erreurs et messages d'information : -->
19
				<?php if ($erreurs) : ?>
20
					<?php foreach ($erreurs as $erreur) : ?>
21
						<p class="pap_erreur"><?=$erreur;?></p>
22
					<?php endforeach; ?>
23
				<?php endif; ?>
24
 
25
				<?php if ($informations) : ?>
26
					<?php foreach ($informations as $information) : ?>
27
						<p class="pap_info"><?=$information;?></p>
28
					<?php endforeach; ?>
29
				<?php endif; ?>
30
			</div>
31
		<?php else : ?>
32
			<ul>
33
				<?php foreach ($sites as $site) : ?>
34
					<?php foreach ($site['pages'] as $page) : ?>
35
			    	<li>
36
			    		<b>
37
			    			<? $titre_page = preg_replace('/^\d+-\d+&nbsp;:/', '', $page['titre']); ?>
38
			    			<?=$titre_page?><br />
39
			    		</b>
40
 
41
						<? $page['description'] = str_replace('align="left"', '<img align="right"', $page['description']); ?>
42
			    		<?= truncate($page['description'], 250)?>
43
			    		<br />
44
			    		<a href="<?=$page['url']?>">En savoir plus sur ce projet.</a><br>
45
			    		<hr class="nettoyage" />
46
			   		</li>
47
			   		<?php endforeach; ?>
48
			   	<?php endforeach; ?>
49
			</ul>
50
		<?php endif; ?>
51
	</div>
52
<!-- SYNDICATION - FIN -->