Subversion Repositories Applications.papyrus

Rev

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

Rev Author Line No. Line
2146 aperonnet 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
			    		<div>
37
				    		<b>
38
				    			<? $titre_page = preg_replace('/^\d+-\d+&nbsp;:/', '', $page['titre']); ?>
39
				    			<?=$titre_page?><br />
40
				    		</b>
41
 
42
							<?php $page['description'] = preg_replace("/<img[^>]+\>/i", "", $page['description']);
43
			    			<?= truncate($page['description'], 250); ?>
44
				    		<br />
45
				    		<a href="<?=$page['url']?>">En savoir plus.</a><br>
46
			    		</div>
47
			    		<div>
48
			    			<?php $page['image'] = str_replace('align="left"', '<img align="right"', $page['image']); ?>
49
			    			<?= $page['image']; ?>
50
			    		</div>
51
			    		<hr class="nettoyage" />
52
			   		</li>
53
			   		<?php endforeach; ?>
54
			   	<?php endforeach; ?>
55
			</ul>
56
		<?php endif; ?>
57
	</div>
58
<!-- SYNDICATION - FIN -->