Subversion Repositories Applications.papyrus

Rev

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>
                                        <div>
                                                <b>
                                                        <? $titre_page = preg_replace('/^\d+-\d+&nbsp;:/', '', $page['titre']); ?>
                                                        <?=$titre_page?><br />
                                                </b>
                                                        
                                                        <?php $page['description'] = preg_replace("/<img[^>]+\>/i", "", $page['description']); 
                                                <?= truncate($page['description'], 250); ?>
                                                <br />
                                                <a href="<?=$page['url']?>">En savoir plus.</a><br>
                                        </div>
                                        <div>
                                                <?php $page['image'] = str_replace('align="left"', '<img align="right"', $page['image']); ?>
                                                <?= $page['image']; ?>
                                        </div>
                                        <hr class="nettoyage" />
                                        </li>
                                        <?php endforeach; ?>
                                <?php endforeach; ?>
                        </ul>
                <?php endif; ?>
        </div>
<!-- SYNDICATION - FIN -->