Subversion Repositories Sites.tela-botanica.org

Rev

Rev 1114 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?
function truncate($text, $chars = 25) {
    $text = $text." ";
    $text = substr($text,0,$chars);
    $text = substr($text,0,strrpos($text,' '));
    $text = $text."...";
    return $text;
}
?>

<!-- SYNDICATION - DEBUT -->
        <div class="flux_RSS">
                <?php if ($erreurs || $informations) : ?>
                        <h1>Erreur</h1>
                        <div class="contenu_RSS">
                                <b>Impossible d'afficher le flux.</b><br />
                                
                                <!-- Affichage des erreurs et messages d'information : -->
                                <?php if ($erreurs) : ?>
                                        <?php foreach ($erreurs as $erreur) : ?>
                                                <p class="pap_erreur"><?=$erreur;?></p>
                                        <?php endforeach; ?>
                                <?php endif; ?>
                                
                                <?php if ($informations) : ?>
                                        <?php foreach ($informations as $information) : ?>
                                                <p class="pap_info"><?=$information;?></p>
                                        <?php endforeach; ?>
                                <?php endif; ?>
                        </div>
                <?php else : ?>
                        <ul>
                                <?php foreach ($sites as $site) : ?>
                                        <?php foreach ($site['pages'] as $page) : ?>
                                <li>
                                        <b>
                                                <? $titre_page = preg_replace('/^\d+-\d+&nbsp;:/', '', $page['titre']); ?>
                                                <?=$titre_page?><br />
                                        </b>

                                                <? $page['description'] = str_replace('align="left"', '<img align="right"', $page['description']); ?>
                                        <?= truncate($page['description'], 250)?>
                                        <br />
                                        <a href="<?=$page['url']?>">En savoir plus sur ce projet.</a><br>
                                        <hr class="nettoyage" />
                                        </li>
                                        <?php endforeach; ?>
                                <?php endforeach; ?>
                        </ul>
                <?php endif; ?>
        </div>
<!-- SYNDICATION - FIN -->