Subversion Repositories Sites.tela-botanica.org

Rev

Rev 1114 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1114 Rev 1115
Line 2... Line 2...
2
function truncate($text, $chars = 25) {
2
function truncate($text, $chars = 25) {
3
    $text = $text." ";
3
    $text = $text." ";
4
    $text = substr($text,0,$chars);
4
    $text = substr($text,0,$chars);
5
    $text = substr($text,0,strrpos($text,' '));
5
    $text = substr($text,0,strrpos($text,' '));
6
    $text = $text."...";
6
    $text = $text."...";
-
 
7
	// suppression des sauts de ligne et des tags
-
 
8
	// le rendu désiré ne doit contenir que du texte simple
-
 
9
	$text = str_replace(array("\r\n", "\r"), "", strip_tags($text));
7
    return $text;
10
    return $text;
8
}
11
}
9
?>
12
?>
Line -... Line 13...
-
 
13
 
-
 
14
<style>
-
 
15
.image_rss_simple {
-
 
16
	float: right;
-
 
17
}
-
 
18
 
-
 
19
.image_rss_simple > img {
-
 
20
	padding-left: 7px;
-
 
21
    padding-top: 6px;
-
 
22
    max-width: 90px;
-
 
23
}
-
 
24
 
-
 
25
.description_rss_simple h3 {
-
 
26
	font-size: 12px;
-
 
27
	margin: 0;
-
 
28
}
-
 
29
 
-
 
30
.corps_description_rss_simple {
-
 
31
	text-align: justify;
-
 
32
	-webkit-hyphens: auto;
-
 
33
   	-moz-hyphens: auto;
-
 
34
    -ms-hyphens: auto;
-
 
35
    hyphens: auto;
-
 
36
}
-
 
37
</style>
10
 
38
 
11
<!-- SYNDICATION - DEBUT -->
39
<!-- SYNDICATION - DEBUT -->
12
	<div class="flux_RSS">
40
	<div class="flux_RSS">
13
		<?php if ($erreurs || $informations) : ?>
41
		<?php if ($erreurs || $informations) : ?>
14
			<h1>Erreur</h1>
42
			<h1>Erreur</h1>
Line 27... Line 55...
27
						<p class="pap_info"><?=$information;?></p>
55
						<p class="pap_info"><?=$information;?></p>
28
					<?php endforeach; ?>
56
					<?php endforeach; ?>
29
				<?php endif; ?>
57
				<?php endif; ?>
30
			</div>
58
			</div>
31
		<?php else : ?>
59
		<?php else : ?>
32
			<ul>
60
			<ul class="liste_rss_simple">
33
				<?php foreach ($sites as $site) : ?>
61
				<?php foreach ($sites as $site) : ?>
34
					<?php foreach ($site['pages'] as $page) : ?>
62
					<?php foreach ($site['pages'] as $page) : ?>
35
			    	<li>
63
			    	<li>
36
			    		<div>
-
 
37
				    		<b>
-
 
38
				    			<? $titre_page = preg_replace('/^\d+-\d+&nbsp;:/', '', $page['titre']); ?>
-
 
39
				    			<?=$titre_page?><br />
64
			    		<div class="image_rss_simple">
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']); ?>
65
			    			<?php $page['image'] = str_replace('align="left"', '', $page['image']); ?>
49
			    			<?= $page['image']; ?>
66
			    			<?= $page['image']; ?>
50
			    		</div>
67
			    		</div>
-
 
68
			    		<div class="description_rss_simple">
-
 
69
				    		<h3>
-
 
70
				    			<? $titre_page = preg_replace('/^\d+-\d+&nbsp;:/', '', $page['titre']); ?>
-
 
71
				    			<a href="<?=$page['url']?>"><?=$titre_page?></a>
-
 
72
				    		</h3>
-
 
73
							<div class="corps_description_rss_simple" >
-
 
74
								<?php $page['description'] = preg_replace("/<img[^>]+\>/i", "", $page['description']); ?>
-
 
75
			    				<?= truncate($page['description'], 275); ?>
-
 
76
				    			<br />
-
 
77
				    			<a href="<?=$page['url']?>">En savoir plus.</a><br />
-
 
78
				    		</div>
-
 
79
			    		</div>
51
			    		<hr class="nettoyage" />
80
			    		<hr class="nettoyage" />
52
			   		</li>
81
			   		</li>
53
			   		<?php endforeach; ?>
82
			   		<?php endforeach; ?>
54
			   	<?php endforeach; ?>
83
			   	<?php endforeach; ?>
55
			</ul>
84
			</ul>