/trunk/papyrus/applettes/syndication/configuration/synd_configuration.inc.php |
---|
1,92 → 1,92 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 5.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of papyrus_bp. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: synd_configuration.inc.php,v 1.2 2008-10-29 15:54:40 alexandre_tb Exp $ |
/** |
* papyrus_bp - synd_configuration.inc.php |
* |
* Description : |
* |
*@package papyrus_bp |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 1999-2006 |
*@version $Revision: 1.2 $ $Date: 2008-10-29 15:54:40 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTÊTE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$GLOBALS['_SYNDICATION_'] = array(); |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Constante stockant la valeur de la langue par défaut pour l'applette SYND.*/ |
define('SYND_I18N_DEFAUT', GEN_I18N_ID_DEFAUT); |
// Paramétrage de la bibliothèque de manipulation des flux RSS |
/** Constante stockant le chemin vers la bibliothèque MAGPIERSS.*/ |
define('MAGPIE_DIR', GEN_CHEMIN_API.'syndication_rss/magpierss/'); |
/** Constante stockant le nombre de page syndiqués à afficher par site.*/ |
define('SYND_NOMBRE', 10); |
/** Constante stockant le chemin vers le dossier de cache pour MAGPIERSS.*/ |
define('CACHE_DIR', PAP_CHEMIN_RACINE.'/tmp'); |
/** Constante stockant la durée de vie d'un fichier de cache **/ |
define('CACHE_LIFETIME', 24*60*60); |
/** Constante stockant si oui ou non on ouvre une nouvelle fenêtre pour consulter la page d'un site syndiqué.*/ |
define('SYND_OUVRIR_LIEN_RSS_NOUVELLE_FENETRE', 1); |
/** Constante stockant le format des dates.*/ |
define('SYND_FORMAT_DATE', 'jma'); |
// Chemin vers les dossiers de l'applette |
/** Chemin vers l'applette Syndication de Papyrus.*/ |
define('SYND_CHEMIN_APPLETTE', GEN_CHEMIN_APPLETTE.'syndication'.GEN_SEP); |
/** Chemin vers les fichiers de traduction de l'applette Syndication de Papyrus.*/ |
define('SYND_CHEMIN_LANGUE', SYND_CHEMIN_APPLETTE.'langues'.GEN_SEP); |
/** Chemin vers les fichiers squelettes de l'applette Syndication de Papyrus.*/ |
define('SYND_CHEMIN_SQUELETTE', SYND_CHEMIN_APPLETTE.'squelettes'.GEN_SEP); |
// Configuration du rendu |
/** Nom du fichier de squelette, par défaut, à utiliser pour la liste des pages.*/ |
define('SYND_SQUELETTE_LISTE', 'synd_liste.tpl.html'); |
$GLOBALS['jours'] = array (1 => 'lundi', 2 => 'mardi', 3 => 'mercredi', 4 => 'jeudi', 5 => 'vendredi', |
6 => 'samedi', 0 => 'dimanche') ; |
$GLOBALS['mois'] = array (1 => 'janvier', 2 => 'février', 3 => 'mars', 4 => 'avril', 5 => 'mai', 6 => 'juin', |
7 => 'juillet', 8 => 'août', 9 => 'septembre', 10 => 'octobre', 11 =>'novembre', |
12 => 'décembre') ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.1 2006-12-13 17:06:36 jp_milcent |
* Ajout de l'applette Syndication. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 5.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of papyrus_bp. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: synd_configuration.inc.php,v 1.2 2008-10-29 15:54:40 alexandre_tb Exp $ |
/** |
* papyrus_bp - synd_configuration.inc.php |
* |
* Description : |
* |
*@package papyrus_bp |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 1999-2006 |
*@version $Revision: 1.2 $ $Date: 2008-10-29 15:54:40 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTÊTE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$GLOBALS['_SYNDICATION_'] = array(); |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Constante stockant la valeur de la langue par défaut pour l'applette SYND.*/ |
define('SYND_I18N_DEFAUT', GEN_I18N_ID_DEFAUT); |
// Paramétrage de la bibliothèque de manipulation des flux RSS |
/** Constante stockant le chemin vers la bibliothèque MAGPIERSS.*/ |
define('MAGPIE_DIR', GEN_CHEMIN_API.'syndication_rss/magpierss/'); |
/** Constante stockant le nombre de page syndiqués à afficher par site.*/ |
define('SYND_NOMBRE', 10); |
/** Constante stockant le chemin vers le dossier de cache pour MAGPIERSS.*/ |
define('CACHE_DIR', PAP_CHEMIN_RACINE.'tmp/syndication_cache'); |
/** Constante stockant la durée de vie d'un fichier de cache **/ |
define('CACHE_LIFETIME', 24*60*60); |
/** Constante stockant si oui ou non on ouvre une nouvelle fenêtre pour consulter la page d'un site syndiqué.*/ |
define('SYND_OUVRIR_LIEN_RSS_NOUVELLE_FENETRE', 1); |
/** Constante stockant le format des dates.*/ |
define('SYND_FORMAT_DATE', 'jma'); |
// Chemin vers les dossiers de l'applette |
/** Chemin vers l'applette Syndication de Papyrus.*/ |
define('SYND_CHEMIN_APPLETTE', GEN_CHEMIN_APPLETTE.'syndication'.GEN_SEP); |
/** Chemin vers les fichiers de traduction de l'applette Syndication de Papyrus.*/ |
define('SYND_CHEMIN_LANGUE', SYND_CHEMIN_APPLETTE.'langues'.GEN_SEP); |
/** Chemin vers les fichiers squelettes de l'applette Syndication de Papyrus.*/ |
define('SYND_CHEMIN_SQUELETTE', SYND_CHEMIN_APPLETTE.'squelettes'.GEN_SEP); |
// Configuration du rendu |
/** Nom du fichier de squelette, par défaut, à utiliser pour la liste des pages.*/ |
define('SYND_SQUELETTE_LISTE', 'synd_liste.tpl.html'); |
$GLOBALS['jours'] = array (1 => 'lundi', 2 => 'mardi', 3 => 'mercredi', 4 => 'jeudi', 5 => 'vendredi', |
6 => 'samedi', 0 => 'dimanche') ; |
$GLOBALS['mois'] = array (1 => 'janvier', 2 => 'février', 3 => 'mars', 4 => 'avril', 5 => 'mai', 6 => 'juin', |
7 => 'juillet', 8 => 'août', 9 => 'septembre', 10 => 'octobre', 11 =>'novembre', |
12 => 'décembre') ; |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.1 2006-12-13 17:06:36 jp_milcent |
* Ajout de l'applette Syndication. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/papyrus/applettes/syndication/syndication.php |
---|
1,443 → 1,457 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 5.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of papyrus_bp. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: syndication.php,v 1.11 2008-10-29 15:55:56 alexandre_tb Exp $ |
/** |
* papyrus_bp - syndication.php |
* |
* Description : |
* |
*@package papyrus_bp |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 1999-2006 |
*@version $Revision: 1.11 $ $Date: 2008-10-29 15:55:56 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTÊTE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherSyndication'; |
$GLOBALS['_GEN_commun']['info_applette_balise'] = '\{\{[Ss]yndication'. |
'(?:\s*'. |
'(?:'. |
'(url="[^"]*")|'. |
'(titre="[^"]*")|'. |
'(nb="?\d+"?)|'. |
'(tailledesc="?\d+"?)|'. |
'(voirsuite="[^"]*")|'. |
'(dureecache="?\d+"?)|'. |
'(id="[^"]*")|'. |
'(nbmax="?\d+"?)|'. |
'(nouvellefenetre="?(?:0|1)"?)|'. |
'(formatdate="[^"]*")|'. |
'(formatdatepro="[^"]*")|'. |
'(template=".*")|'. |
')'. |
')+'. |
'\s*\}\}'; |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier de configuration de cette application.*/ |
require_once GEN_CHEMIN_APPLETTE.'syndication'.GEN_SEP.'configuration'.GEN_SEP.'synd_configuration.inc.php'; |
/** Inclusion du fichier de fonctions de cette application.*/ |
require_once GEN_CHEMIN_APPLETTE.'syndication'.GEN_SEP.'bibliotheque'.GEN_SEP.'syndication.fonct.php'; |
// Inclusion des fichiers de traduction de l'applette SYND de Papyrus |
if (file_exists(SYND_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) { |
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/ |
require_once SYND_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php'; |
} else { |
/** Inclusion du fichier de traduction par défaut.*/ |
require_once SYND_CHEMIN_LANGUE.'synd_langue_'.SYND_I18N_DEFAUT.'.inc.php'; |
} |
/** Inclusion du fichier de la bibliotheque permettant de manipuler les flux RSS.*/ |
//require_once(MAGPIE_DIR.'rss_fetch.inc'); |
require_once PAP_CHEMIN_API_PEAR.'XML/Feed/Parser.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Fonction afficherSyndication() - Retourne la liste des pages des sites syndiqués. |
* |
* Cette fonction retourne la liste des pages des sites syndiqués. |
* |
* @param array contient les arguments de la fonction. |
* @param array tableau global de Papyrus. |
* @return string XHTML la liste des pages. |
*/ |
function afficherSyndication($tab_applette_arguments, $_GEN_commun) |
{ |
// Initialisation des variables |
$sortie = ''; |
$GLOBALS['_SYNDICATION_']['erreurs'] = array(); |
$GLOBALS['_SYNDICATION_']['informations'] = array(); |
$GLOBALS['_SYNDICATION_']['sites'] = array(); |
$string_arguments = ""; |
//+----------------------------------------------------------------------------------------------------------------+ |
// Gestion des arguments |
$balise = $tab_applette_arguments[0]; |
$tab_arguments = $tab_applette_arguments; |
unset($tab_arguments[0]); |
foreach($tab_arguments as $argument) { |
if ($argument != '') { |
$string_arguments .= $argument; |
$tab_parametres = explode('=', $argument, 2); |
$options[$tab_parametres[0]] = trim($tab_parametres[1], '"'); |
} |
} |
$id_cache = md5($string_arguments); |
//Greg : possibilité d'ajouter une durée au cache |
if (!isset($options['dureecache'])) { |
$options['dureecache'] = CACHE_LIFETIME; |
} |
if($contenu_cache = verifierCache($id_cache, $options['dureecache'])) { |
return $contenu_cache; |
} |
// |
//+----------------------------------------------------------------------------------------------------------------+ |
// Gestion des erreurs de paramétrage |
if (!isset($options['url'])) { |
$GLOBALS['_SYNDICATION_']['erreurs'][] = sprintf(SYND_LG_ERREUR_URL, $balise); |
} |
if (!isset($options['titre'])) { |
$options['titre'] = ''; |
} |
if (!isset($options['nb'])) { |
$options['nb'] = SYND_NOMBRE; |
} |
if (!isset($options['nbmax'])) { |
$options['nbmax'] = SYND_NOMBRE_MAX; |
} |
if (!isset($options['nouvellefenetre'])) { |
$options['nouvellefenetre'] = SYND_OUVRIR_LIEN_RSS_NOUVELLE_FENETRE; |
} |
if (!isset($options['formatdate'])) { |
$options['formatdate'] = SYND_FORMAT_DATE; |
} |
if (!isset($options['formatdatepro'])) { |
$options['formatdatepro'] = false; |
} |
if (!isset($options['template'])) { |
$options['template'] = SYND_CHEMIN_SQUELETTE.SYND_SQUELETTE_LISTE; |
} else { |
if (file_exists(SYND_CHEMIN_SQUELETTE.$options['template'])) { |
$options['template'] = SYND_CHEMIN_SQUELETTE.$options['template']; |
} |
} |
//+----------------------------------------------------------------------------------------------------------------+ |
// Recuperation des donnees |
if (count($GLOBALS['_SYNDICATION_']['erreurs']) == 0) { |
$tab_url = array_map('trim', explode(',', $options['url'])); |
foreach ($tab_url as $cle => $url) { |
if ($url != '') { |
$aso_site = array(); |
// Liste des encodages acceptés pour les flux |
$encodages = 'UTF-8, ISO-8859-1, ISO-8859-15'; |
try { |
$xml = file_get_contents($url); |
$feed = new XML_Feed_Parser($xml); |
} catch (XML_Feed_Parser_Exception $e) { |
creer_cache('erreur', $xml, 604800); |
return('Le flux RSS est invalide : ' . $e->getMessage()); |
} |
if ($options['template'] != '' && !file_exists($options['template'])) { |
$i = 0 ; |
$res= ''; |
foreach ($feed as $item) { |
// Le test suivant pour savoir s il faut reduire l excendent de description |
// Si {all} est present dans le template on ne reduit pas |
if (preg_match ('/{all}/', $options['template'])) { |
$template = str_replace('{all}', '', $options['template']); |
$all = true ; |
} else { |
$all = false; |
} |
if (isset($item->summary)) { |
$item->description = mb_convert_encoding($item->summary, 'HTML-ENTITIES', $encodages); |
} else { |
if (strlen($item->description) > 200 && !$all) { |
$item->description = substr(mb_convert_encoding($item->description, 'HTML-ENTITIES', $encodages), 0, 300). |
'... <a href="'.htmlentities($item->link).'">Lire la suite</a>'; |
} |
} |
if (!isset($item->pubdate)) { |
$item->pubdate = date('dmY'); |
} |
// Le code ci-apres est pour rattraper les dates du type 01012005 parsees par magpie |
// lorsque les flux donne des dates au format iso |
if (preg_match('/^([0-3][0-9])([0-1][0-9])([0-9][0-9][0-9][0-9])$/', $item->pubdate, $match)) { |
$item->pubdate = $match[3].'-'.$match[2].'-'.$match[1]; |
//echo $item['pubdate']; |
} |
$res .= str_replace ('{num}', ++$i, |
str_replace ('{item}', '<a href="'.htmlentities($item->link).'" target="_top">'.mb_convert_encoding($item->title, 'HTML-ENTITIES', $encodages).'</a>', |
str_replace ('{date}', strftime('%d.%m.%Y',strtotime($item->pubdate)), |
str_replace ('{description}', mb_convert_encoding($item->description, 'HTML-ENTITIES', $encodages), $options['template'])))) ; |
$res .= "\n"; |
if ($i > $options['nb']) { |
break; |
} |
} |
return $res; |
} |
// Gestion du titre |
if ( $options['titre'] == '' ) { |
$aso_site['titre'] = mb_convert_encoding($feed->title, 'HTML-ENTITIES', $encodages); |
} else if ( $options['titre'] != '0' ) { |
$aso_site['titre'] = $options['titre']; |
} |
//Gestion de l'ID |
if ( $options['id'] != '' ) { |
$aso_site['id'] = $options['id']; |
} |
//Gestion du lien vers la suite |
if ( $options['voirsuite'] != '' ) { |
$aso_site['voirsuite'] = $options['voirsuite']; |
} |
// Gestion de l'url du site |
$aso_site['url'] = htmlentities($feed->link); |
// Ouverture du lien dans une nouvelle fenetre |
$aso_site['ext'] = false; |
if ($options['nouvellefenetre'] == 1) { |
$aso_site['ext'] = true; |
} |
// Gestion des pages syndiquees |
$i = 0; |
$nb_item = $feed->numberEntries; |
foreach ($feed as $item) { |
if ($options['nb'] != 0 && $nb_item >= $options['nb'] && $i >= $options['nb']) { |
break; |
} |
$i++; |
$aso_page = array(); |
$aso_page['site'] = $aso_site; |
$aso_page['url'] = htmlentities($item->link); |
$aso_page['titre'] = mb_convert_encoding($item->title, 'HTML-ENTITIES', $encodages); |
$aso_page['description'] = mb_convert_encoding($item->description, 'HTML-ENTITIES', $encodages); |
/* Extraction de l'image si incluse dans description */ |
$image = ""; |
$description = $aso_page['description']; |
$taille = $options['tailledesc']; |
if (!(strpos($description, '<img') === false)) { |
$pos_debut = strpos($description, '<img'); |
$pos_fin_image = strpos($description, '>', $posimage) + 1; |
$image = substr($description, $pos_debut, ($pos_fin_image - $pos_debut)); |
$description = substr_replace($description,' ', $pos_debut, ($pos_fin_image - $pos_debut)); |
} |
$aso_page['image'] = $image; |
$aso_page['description_sans_image'] = $description; |
if ($taille != null) { |
//Attention : si on coupe simplement, on peut couper une balise en plein milieu. |
//On va donc vérifier |
//1. recherche de tags simples <i> ou <b> |
$description = html_entity_decode($description); |
$description = strip_tags($description, "<i><b>"); |
//Va-ton couper un mot ? |
if ($description[$taille] != ' ' && $description[$taille+1] != ' ' && $description[$taille-1] != ' ') { |
$strpos = strpos($description, ' ', $taille); |
if ($strpos === true) { |
$taille = $strpos; |
} |
} |
$description = substr($description, 0, $taille); |
$description.='(...)'; |
$pattern = '#<([ib])[ ]*[a-z]*>(.*?)</\1>#i'; |
//1. remplacer toutes le s balises fermées |
$chaine = preg_replace($pattern, '$2', $description); |
$nb_occurences_i = substr_count($chaine, '<i'); |
for ($occurences = 0; $occurences < $nb_occurences_i; $occurences++) { |
$description .= "</i>"; |
} |
$nb_occurences_b = substr_count($chaine, '<b'); |
for ($occurences = 0; $occurences < $nb_occurences_b; $occurences++) { |
$description .= "</b>"; |
} |
} |
$aso_page['description_light'] = $description; |
//Greg : ajout GUID |
$aso_page['guid'] = mb_convert_encoding($item->model->getElementsByTagName('guid')->item(0)->nodeValue, 'HTML-ENTITIES', $encodages); |
$aso_page['category'] = mb_convert_encoding($item->model->getElementsByTagName('category')->item(0)->nodeValue, 'HTML-ENTITIES', $encodages); |
$aso_page['author'] = mb_convert_encoding($item->author, 'HTML-ENTITIES', $encodages); |
$aso_page['date'] = $item->pubDate; |
if ($options['formatdatepro']) { |
switch ($options['formatdatepro']) { |
case 'jm' : |
$aso_page['date'] = strftime('%d.%m', $aso_page['date']); |
break; |
case 'jma' : |
$aso_page['date'] = strftime('%d.%m.%Y', $aso_page['date']); |
break; |
case 'jmh' : |
$aso_page['date'] = strftime('%d.%m %H:%M', $aso_page['date']); |
break; |
case 'jmah' : |
$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']); |
break; |
default : |
$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']); |
} |
} else { |
switch ($options['formatdate']) { |
case 'jm' : |
$aso_page['date'] = strftime('%d.%m', $aso_page['date']); |
break; |
case 'jma' : |
$aso_page['date'] = strftime('%d.%m.%Y', $aso_page['date']); |
break; |
case 'jmh' : |
$aso_page['date'] = strftime('%d.%m %H:%M', $aso_page['date']); |
break; |
case 'jmah' : |
$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']); |
break; |
default : |
$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']); |
} |
} |
$aso_site['pages'][] = $aso_page; |
$GLOBALS['_SYNDICATION_']['pages'][strtotime($aso_page['date'])] = $aso_page; |
} |
$GLOBALS['_SYNDICATION_']['sites'][] = $aso_site; |
} |
} |
} |
// Trie des pages par date |
krsort($GLOBALS['_SYNDICATION_']['pages']); |
$GLOBALS['_SYNDICATION_']['sites'] = array_slice($GLOBALS['_SYNDICATION_']['sites'],0,$options['nbmax'],true) ; |
$GLOBALS['_SYNDICATION_']['pages'] = array_slice($GLOBALS['_SYNDICATION_']['pages'],0,$options['nbmax'],true) ; |
//+----------------------------------------------------------------------------------------------------------------+ |
// Extrait les variables et les ajoutes a l'espace de noms local |
// Gestion des squelettes |
extract($GLOBALS['_SYNDICATION_']); |
// Demarre le buffer |
ob_start(); |
// Inclusion du fichier |
include($options['template']); |
// Recuperer le contenu du buffer |
$sortie = ob_get_contents(); |
creer_cache($id_cache,$sortie, $options['dureecache']); |
// Arrete et detruit le buffer |
ob_end_clean(); |
//+----------------------------------------------------------------------------------------------------------------+ |
// Sortie |
return $sortie; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.10 2007-12-13 14:10:51 alexandre_tb |
* Fusion avec la livraison AHA : 13 decembre 2007 |
* |
* Revision 1.9 2007-12-03 14:54:14 jp_milcent |
* Fusion avec la livraison AHA : 3 décembre 2007 |
* |
* Revision 1.7.2.2 2007-12-03 14:52:21 jp_milcent |
* Correction bogue : & dans les urls. |
* |
* Revision 1.8 2007-11-30 14:17:30 jp_milcent |
* Fusion avec la livraison AHA : 30 novembre 2007 |
* |
* Revision 1.7.2.1 2007-11-30 14:15:02 jp_milcent |
* Amélioration du décodage utf8. |
* |
* Revision 1.7 2007-07-25 15:09:44 jp_milcent |
* Fusion avec la livraison Narmer. |
* |
* Revision 1.5.2.4 2007-07-25 15:07:52 jp_milcent |
* Correction problème url. |
* |
* Revision 1.5.2.3 2007-07-25 14:50:21 jp_milcent |
* Corrections, meilleure utilisation de XML_Feed_Parser. |
* |
* Revision 1.5.2.2 2007-07-25 09:45:07 jp_milcent |
* Utilisation de XML_Feed_Parser de Pear pour l'applette Syndication. |
* |
* Revision 1.6 2007-06-25 12:15:07 alexandre_tb |
* merge from narmer |
* |
* Revision 1.5.2.1 2007-06-06 15:24:37 jp_milcent |
* Amélioration de la compatibilité avec les anciennes version des balises de l'applette syndication. |
* |
* Revision 1.5 2007-04-20 12:50:18 florian |
* correction bugs suite au merge |
* |
* Revision 1.4 2007/03/28 15:53:27 florian |
* correction pb date, encodage utf-8 |
* |
* Revision 1.3 2007/01/23 14:17:19 alexandre_tb |
* backport : hack pour rattraper les dates du type 01012005 parsees par magpie |
* lorsque les flux donne des dates au format iso |
* |
* Revision 1.2 2006/12/13 17:20:51 jp_milcent |
* Correction bogue : paramètre nb non pris en compte |
* |
* Revision 1.1 2006/12/13 17:06:36 jp_milcent |
* Ajout de l'applette Syndication. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 5.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 1999-2006 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of papyrus_bp. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: syndication.php,v 1.11 2008-10-29 15:55:56 alexandre_tb Exp $ |
/** |
* papyrus_bp - syndication.php |
* |
* Description : |
* |
*@package papyrus_bp |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 1999-2006 |
*@version $Revision: 1.11 $ $Date: 2008-10-29 15:55:56 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTÊTE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$GLOBALS['_GEN_commun']['info_applette_nom_fonction'] = 'afficherSyndication'; |
$GLOBALS['_GEN_commun']['info_applette_balise'] = '\{\{[Ss]yndication'. |
'(?:\s*'. |
'(?:'. |
'(url="[^"]*")|'. |
'(titre="[^"]*")|'. |
'(nb="?\d+"?)|'. |
'(tailledesc="?\d+"?)|'. |
'(voirsuite="[^"]*")|'. |
'(dureecache="?\d+"?)|'. |
'(id="[^"]*")|'. |
'(nbmax="?\d+"?)|'. |
'(nouvellefenetre="?(?:0|1)"?)|'. |
'(formatdate="[^"]*")|'. |
'(formatdatepro="[^"]*")|'. |
'(template=".*")|'. |
')'. |
')+'. |
'\s*\}\}'; |
// +------------------------------------------------------------------------------------------------------+ |
/** Inclusion du fichier de configuration de cette application.*/ |
require_once GEN_CHEMIN_APPLETTE.'syndication'.GEN_SEP.'configuration'.GEN_SEP.'synd_configuration.inc.php'; |
/** Inclusion du fichier de fonctions de cette application.*/ |
require_once GEN_CHEMIN_APPLETTE.'syndication'.GEN_SEP.'bibliotheque'.GEN_SEP.'syndication.fonct.php'; |
// Inclusion des fichiers de traduction de l'applette SYND de Papyrus |
if (file_exists(SYND_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) { |
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/ |
require_once SYND_CHEMIN_LANGUE.'synd_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php'; |
} else { |
/** Inclusion du fichier de traduction par défaut.*/ |
require_once SYND_CHEMIN_LANGUE.'synd_langue_'.SYND_I18N_DEFAUT.'.inc.php'; |
} |
/** Inclusion du fichier de la bibliotheque permettant de manipuler les flux RSS.*/ |
//require_once(MAGPIE_DIR.'rss_fetch.inc'); |
require_once PAP_CHEMIN_API_PEAR.'XML/Feed/Parser.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
/** Fonction afficherSyndication() - Retourne la liste des pages des sites syndiqués. |
* |
* Cette fonction retourne la liste des pages des sites syndiqués. |
* |
* @param array contient les arguments de la fonction. |
* @param array tableau global de Papyrus. |
* @return string XHTML la liste des pages. |
*/ |
function afficherSyndication($tab_applette_arguments, $_GEN_commun) |
{ |
// Initialisation des variables |
$sortie = ''; |
$GLOBALS['_SYNDICATION_']['erreurs'] = array(); |
$GLOBALS['_SYNDICATION_']['informations'] = array(); |
$GLOBALS['_SYNDICATION_']['sites'] = array(); |
$string_arguments = ""; |
//+----------------------------------------------------------------------------------------------------------------+ |
// Gestion des arguments |
$balise = $tab_applette_arguments[0]; |
$tab_arguments = $tab_applette_arguments; |
unset($tab_arguments[0]); |
foreach($tab_arguments as $argument) { |
if ($argument != '') { |
$string_arguments .= $argument; |
$tab_parametres = explode('=', $argument, 2); |
$options[$tab_parametres[0]] = trim($tab_parametres[1], '"'); |
} |
} |
$id_cache = md5($string_arguments); |
//Greg : possibilité d'ajouter une durée au cache |
if (!isset($options['dureecache'])) { |
$options['dureecache'] = CACHE_LIFETIME; |
} |
if($contenu_cache = verifierCache($id_cache, $options['dureecache'])) { |
return $contenu_cache; |
} |
// |
//+----------------------------------------------------------------------------------------------------------------+ |
// Gestion des erreurs de paramétrage |
if (!isset($options['url'])) { |
$GLOBALS['_SYNDICATION_']['erreurs'][] = sprintf(SYND_LG_ERREUR_URL, $balise); |
} |
if (!isset($options['titre'])) { |
$options['titre'] = ''; |
} |
if (!isset($options['nb'])) { |
$options['nb'] = SYND_NOMBRE; |
} |
if (!isset($options['nbmax'])) { |
$options['nbmax'] = SYND_NOMBRE_MAX; |
} |
if (!isset($options['nouvellefenetre'])) { |
$options['nouvellefenetre'] = SYND_OUVRIR_LIEN_RSS_NOUVELLE_FENETRE; |
} |
if (!isset($options['formatdate'])) { |
$options['formatdate'] = SYND_FORMAT_DATE; |
} |
if (!isset($options['formatdatepro'])) { |
$options['formatdatepro'] = false; |
} |
if (!isset($options['template'])) { |
$options['template'] = SYND_CHEMIN_SQUELETTE.SYND_SQUELETTE_LISTE; |
} else { |
if (file_exists(SYND_CHEMIN_SQUELETTE.$options['template'])) { |
$options['template'] = SYND_CHEMIN_SQUELETTE.$options['template']; |
} |
} |
//+----------------------------------------------------------------------------------------------------------------+ |
// Recuperation des donnees |
if (count($GLOBALS['_SYNDICATION_']['erreurs']) == 0) { |
$tab_url = array_map('trim', explode(',', $options['url'])); |
foreach ($tab_url as $cle => $url) { |
if ($url != '') { |
$aso_site = array(); |
// Liste des encodages acceptés pour les flux |
$encodages = 'UTF-8, ISO-8859-1, ISO-8859-15'; |
try { |
$xml = file_get_contents($url); |
$feed = new XML_Feed_Parser($xml); |
} catch (XML_Feed_Parser_Exception $e) { |
creer_cache('erreur', $xml, 86400); |
return('Le flux RSS est invalide : ' . $e->getMessage()); |
} |
if ($options['template'] != '' && !file_exists($options['template'])) { |
$i = 0 ; |
$res= ''; |
foreach ($feed as $item) { |
// Le test suivant pour savoir s il faut reduire l excendent de description |
// Si {all} est present dans le template on ne reduit pas |
if (preg_match ('/{all}/', $options['template'])) { |
$template = str_replace('{all}', '', $options['template']); |
$all = true ; |
} else { |
$all = false; |
} |
if (isset($item->summary)) { |
$item->description = mb_convert_encoding($item->summary, 'HTML-ENTITIES', $encodages); |
} else { |
if (strlen($item->description) > 200 && !$all) { |
$item->description = substr(mb_convert_encoding($item->description, 'HTML-ENTITIES', $encodages), 0, 300). |
'... <a href="'.htmlentities($item->link).'">Lire la suite</a>'; |
} |
} |
if (!isset($item->pubdate)) { |
$item->pubdate = date('dmY'); |
} |
// Le code ci-apres est pour rattraper les dates du type 01012005 parsees par magpie |
// lorsque les flux donne des dates au format iso |
if (preg_match('/^([0-3][0-9])([0-1][0-9])([0-9][0-9][0-9][0-9])$/', $item->pubdate, $match)) { |
$item->pubdate = $match[3].'-'.$match[2].'-'.$match[1]; |
//echo $item['pubdate']; |
} |
$res .= str_replace ('{num}', ++$i, |
str_replace ('{item}', '<a href="'.htmlentities($item->link).'" target="_top">'.mb_convert_encoding($item->title, 'HTML-ENTITIES', $encodages).'</a>', |
str_replace ('{date}', strftime('%d.%m.%Y',strtotime($item->pubdate)), |
str_replace ('{description}', mb_convert_encoding($item->description, 'HTML-ENTITIES', $encodages), $options['template'])))) ; |
$res .= "\n"; |
if ($i > $options['nb']) { |
break; |
} |
} |
return $res; |
} |
// Gestion du titre |
if ( $options['titre'] == '' ) { |
$aso_site['titre'] = mb_convert_encoding($feed->title, 'HTML-ENTITIES', $encodages); |
} else if ( $options['titre'] != '0' ) { |
$aso_site['titre'] = $options['titre']; |
} |
//Gestion de l'ID |
if ( $options['id'] != '' ) { |
$aso_site['id'] = $options['id']; |
} |
//Gestion du lien vers la suite |
if ( $options['voirsuite'] != '' ) { |
$aso_site['voirsuite'] = $options['voirsuite']; |
} |
// Gestion de l'url du site |
$aso_site['url'] = htmlentities($feed->link); |
// Ouverture du lien dans une nouvelle fenetre |
$aso_site['ext'] = false; |
if ($options['nouvellefenetre'] == 1) { |
$aso_site['ext'] = true; |
} |
// Gestion des pages syndiquees |
$i = 0; |
$nb_item = $feed->numberEntries; |
foreach ($feed as $item) { |
if ($options['nb'] != 0 && $nb_item >= $options['nb'] && $i >= $options['nb']) { |
break; |
} |
$i++; |
$aso_page = array(); |
$aso_page['site'] = $aso_site; |
$aso_page['url'] = htmlentities($item->link); |
$aso_page['titre'] = mb_convert_encoding($item->title, 'HTML-ENTITIES', $encodages); |
$aso_page['description'] = mb_convert_encoding($item->description, 'HTML-ENTITIES', $encodages); |
/* Extraction de l'image si incluse dans description */ |
$image = ""; |
$description = $aso_page['description']; |
$taille = $options['tailledesc']; |
if (!(strpos($description, '<img') === false)) { |
$pos_debut = strpos($description, '<img'); |
$pos_fin_image = strpos($description, '>', $posimage) + 1; |
$image = substr($description, $pos_debut, ($pos_fin_image - $pos_debut)); |
$description = substr_replace($description,' ', $pos_debut, ($pos_fin_image - $pos_debut)); |
} |
$aso_page['image'] = $image; |
$aso_page['description_sans_image'] = $description; |
if ($taille != null) { |
//Attention : si on coupe simplement, on peut couper une balise en plein milieu. |
//On va donc vérifier |
//1. recherche de tags simples <i> ou <b> |
$description = html_entity_decode($description); |
$description = strip_tags($description, "<i><b>"); |
//Va-ton couper un mot ? |
if ($description[$taille] != ' ' && $description[$taille+1] != ' ' && $description[$taille-1] != ' ') { |
$strpos = strpos($description, ' ', $taille); |
if ($strpos === true) { |
$taille = $strpos; |
} |
} |
$description = substr($description, 0, $taille); |
$description.='(...)'; |
$pattern = '#<([ib])[ ]*[a-z]*>(.*?)</\1>#i'; |
//1. remplacer toutes le s balises fermées |
$chaine = preg_replace($pattern, '$2', $description); |
$nb_occurences_i = substr_count($chaine, '<i'); |
for ($occurences = 0; $occurences < $nb_occurences_i; $occurences++) { |
$description .= "</i>"; |
} |
$nb_occurences_b = substr_count($chaine, '<b'); |
for ($occurences = 0; $occurences < $nb_occurences_b; $occurences++) { |
$description .= "</b>"; |
} |
} |
$aso_page['description_light'] = $description; |
//Greg : ajout GUID |
$aso_page['guid'] = mb_convert_encoding($item->model->getElementsByTagName('guid')->item(0)->nodeValue, 'HTML-ENTITIES', $encodages); |
$aso_page['category'] = mb_convert_encoding($item->model->getElementsByTagName('category')->item(0)->nodeValue, 'HTML-ENTITIES', $encodages); |
$aso_page['author'] = mb_convert_encoding($item->author, 'HTML-ENTITIES', $encodages); |
$aso_page['date'] = $item->pubDate; |
if ($options['formatdatepro']) { |
switch ($options['formatdatepro']) { |
case 'jm' : |
$aso_page['date'] = strftime('%d.%m', $aso_page['date']); |
break; |
case 'jma' : |
$aso_page['date'] = strftime('%d.%m.%Y', $aso_page['date']); |
break; |
case 'jmh' : |
$aso_page['date'] = strftime('%d.%m %H:%M', $aso_page['date']); |
break; |
case 'jmah' : |
$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']); |
break; |
default : |
$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']); |
} |
} else { |
switch ($options['formatdate']) { |
case 'jm' : |
$aso_page['date'] = strftime('%d.%m', $aso_page['date']); |
break; |
case 'jma' : |
$aso_page['date'] = strftime('%d.%m.%Y', $aso_page['date']); |
break; |
case 'jmh' : |
$aso_page['date'] = strftime('%d.%m %H:%M', $aso_page['date']); |
break; |
case 'jmah' : |
$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']); |
break; |
default : |
$aso_page['date'] = strftime('%d.%m.%Y %H:%M', $aso_page['date']); |
} |
} |
$aso_site['pages'][] = $aso_page; |
$GLOBALS['_SYNDICATION_']['pages'][strtotime($aso_page['date'])] = $aso_page; |
} |
$GLOBALS['_SYNDICATION_']['sites'][] = $aso_site; |
} |
} |
} |
// Trie des pages par date |
krsort($GLOBALS['_SYNDICATION_']['pages']); |
$GLOBALS['_SYNDICATION_']['sites'] = array_slice($GLOBALS['_SYNDICATION_']['sites'],0,$options['nbmax'],true) ; |
$GLOBALS['_SYNDICATION_']['pages'] = array_slice($GLOBALS['_SYNDICATION_']['pages'],0,$options['nbmax'],true) ; |
//+----------------------------------------------------------------------------------------------------------------+ |
// Extrait les variables et les ajoutes a l'espace de noms local |
// Gestion des squelettes |
extract($GLOBALS['_SYNDICATION_']); |
// Demarre le buffer |
ob_start(); |
// Inclusion du fichier |
include($options['template']); |
// Recuperer le contenu du buffer |
$sortie = ob_get_contents(); |
creer_cache($id_cache,$sortie, $options['dureecache']); |
// Arrete et detruit le buffer |
ob_end_clean(); |
//+----------------------------------------------------------------------------------------------------------------+ |
// Sortie |
return $sortie; |
} |
function transcribe_cp1252_to_latin1($cp1252) { |
return strtr( |
$cp1252, |
array( |
"\x80" => "e", "\x81" => " ", "\x82" => "'", "\x83" => 'f', |
"\x84" => '"', "\x85" => "...", "\x86" => "+", "\x87" => "#", |
"\x88" => "^", "\x89" => "0/00", "\x8A" => "S", "\x8B" => "<", |
"\x8C" => "OE", "\x8D" => " ", "\x8E" => "Z", "\x8F" => " ", |
"\x90" => " ", "\x91" => "`", "\x92" => "'", "\x93" => '"', |
"\x94" => '"', "\x95" => "*", "\x96" => "-", "\x97" => "--", |
"\x98" => "~", "\x99" => "(TM)", "\x9A" => "s", "\x9B" => ">", |
"\x9C" => "oe", "\x9D" => " ", "\x9E" => "z", "\x9F" => "Y")); |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.10 2007-12-13 14:10:51 alexandre_tb |
* Fusion avec la livraison AHA : 13 decembre 2007 |
* |
* Revision 1.9 2007-12-03 14:54:14 jp_milcent |
* Fusion avec la livraison AHA : 3 décembre 2007 |
* |
* Revision 1.7.2.2 2007-12-03 14:52:21 jp_milcent |
* Correction bogue : & dans les urls. |
* |
* Revision 1.8 2007-11-30 14:17:30 jp_milcent |
* Fusion avec la livraison AHA : 30 novembre 2007 |
* |
* Revision 1.7.2.1 2007-11-30 14:15:02 jp_milcent |
* Amélioration du décodage utf8. |
* |
* Revision 1.7 2007-07-25 15:09:44 jp_milcent |
* Fusion avec la livraison Narmer. |
* |
* Revision 1.5.2.4 2007-07-25 15:07:52 jp_milcent |
* Correction problème url. |
* |
* Revision 1.5.2.3 2007-07-25 14:50:21 jp_milcent |
* Corrections, meilleure utilisation de XML_Feed_Parser. |
* |
* Revision 1.5.2.2 2007-07-25 09:45:07 jp_milcent |
* Utilisation de XML_Feed_Parser de Pear pour l'applette Syndication. |
* |
* Revision 1.6 2007-06-25 12:15:07 alexandre_tb |
* merge from narmer |
* |
* Revision 1.5.2.1 2007-06-06 15:24:37 jp_milcent |
* Amélioration de la compatibilité avec les anciennes version des balises de l'applette syndication. |
* |
* Revision 1.5 2007-04-20 12:50:18 florian |
* correction bugs suite au merge |
* |
* Revision 1.4 2007/03/28 15:53:27 florian |
* correction pb date, encodage utf-8 |
* |
* Revision 1.3 2007/01/23 14:17:19 alexandre_tb |
* backport : hack pour rattraper les dates du type 01012005 parsees par magpie |
* lorsque les flux donne des dates au format iso |
* |
* Revision 1.2 2006/12/13 17:20:51 jp_milcent |
* Correction bogue : paramètre nb non pris en compte |
* |
* Revision 1.1 2006/12/13 17:06:36 jp_milcent |
* Ajout de l'applette Syndication. |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/papyrus/applettes/syndication/squelettes/actu_v5.tpl.html |
---|
1,66 → 1,66 |
<!-- 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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><a href="<?=$site['url']?>"><?=$site['titre']?></a></h1> |
<div class="contenu_RSS" <?=($site['id']!="") ? 'id="'.$site["id"].'"' : ""; ?>> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
//Traitement spécifique tela |
// La ligne ci-dessous sert à enlever les "align=left" dans les images générées par spip |
// TODO : enlever du flux RSS |
$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12); |
?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div class="actualites1"> |
<div class="imageActualites1"><?=$image?></div> |
<div class="texteActualites1"> |
<?php |
// Préparation de la variable de date en chaîne de caractères |
$date_string = ""; |
$date_string .= $GLOBALS['jours'][date ('w', $date)]; |
$date_string .= ' '.date ('d', $date); |
$date_string .= ' '.$GLOBALS['mois'][date('n', $date)]; |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<h4>Mis en ligne <?=$date_string?> par <?=$page['author']?></h4> |
<p><?=$page['description_light']?></p> |
<a title="Lire la suite article" href="<?=$page['url']?>"> <span class="vertpetit petitcarre voirSuite">Lire la suite</span></a></p> |
</div> |
</div> |
<?php endforeach; ?> |
<?php endforeach; ?> |
<?php if (isset($site['voirsuite'])) : ?> |
<span class="lireTout gris puceFleche"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<?php endif; ?> |
</div> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
<!-- 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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><a href="<?=$site['url']?>"><?=$site['titre']?></a></h1> |
<div class="contenu_RSS" <?=($site['id']!="") ? 'id="'.$site["id"].'"' : ""; ?>> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
//Traitement spécifique tela |
// La ligne ci-dessous sert à enlever les "align=left" dans les images générées par spip |
// TODO : enlever du flux RSS |
$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12); |
?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div class="actualites1"> |
<div class="imageActualites1"><?=$image?></div> |
<div class="texteActualites1"> |
<?php |
// Préparation de la variable de date en chaîne de caractères |
$date_string = ""; |
$date_string .= $GLOBALS['jours'][date ('w', $date)]; |
$date_string .= ' '.date ('d', $date); |
$date_string .= ' '.$GLOBALS['mois'][date('n', $date)]; |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<h4>Mis en ligne <?=$date_string?> par <?=$page['author']?></h4> |
<p><?=$page['description_light']?></p> |
<a title="Lire la suite article" href="<?=$page['url']?>"> <span class="lire-suite">Lire la suite</span></a></p> |
</div> |
</div> |
<?php endforeach; ?> |
<?php endforeach; ?> |
<?php if (isset($site['voirsuite'])) : ?> |
<span class="voir-tout"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<?php endif; ?> |
</div> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
/trunk/papyrus/applettes/syndication/squelettes/cel_obs.tpl.html |
---|
New file |
0,0 → 1,59 |
<?php |
// Réglages de PHP |
setlocale(LC_ALL, 'fr_FR'); |
date_default_timezone_set('Europe/Paris'); |
?> |
<!-- SYNDICATION - DEBUT --> |
<div class="flux_simple"> |
<?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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><?=$site['titre']?></h1> |
<div class="contenu_RSS" id="<?=$site['id']?>"> |
<a href="http://www.tela-botanica.org/eflore/cel2/jrest/CelSyndicationObservation/par-defaut/atom" class="suivre-observations" title="Suivre les observations" onclick="window.open(this.href);return false;">Suivre les observations</a> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
// Formatage date |
$timestamp = strtotime($page['date']); |
$page['date'] = strftime('%A %d %B %Y', $timestamp); |
// Formatage titre |
$page['titre'] = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div id="actualites1"> |
<div id="texteActualites1"> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$page['titre']?></a></h3> |
<p class="sous-titre"><?=$page['date']?></p> |
</div> |
</div> |
<br /> |
<?php endforeach; ?> |
<?php endforeach; ?> |
</div> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
/trunk/papyrus/applettes/syndication/squelettes/projets.tpl.html |
---|
1,64 → 1,64 |
<!-- 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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><a href="<?=$site['url']?>"><?=$site['titre']?></a></h1> |
<div class="contenu_RSS" <?=($site['id']!="") ? 'id="'.$site["id"].'"' : ""; ?>> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
//Traitement spécifique tela |
// La ligne ci-dessous sert à enlever les "align=left" dans les images générées par spip |
// TODO : enlever du flux RSS |
$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12); |
?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div class="actualites1"> |
<div class="texteActualites1"> |
<?php |
// Préparation de la variable de date en chaîne de caractères |
$date_string = ""; |
$date_string .= $GLOBALS['jours'][date ('w', $date)]; |
$date_string .= ' '.date ('d', $date); |
$date_string .= ' '.$GLOBALS['mois'][date('n', $date)]; |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<p><?=$page['description']?></p> |
<a title="Voir le projet" href="<?=$page['url']?>"> <span class="vertpetit petitcarre voirSuite">Voir le projet</span></a></p> |
</div> |
</div> |
<?php endforeach; ?> |
<?php endforeach; ?> |
<?php if (isset($site['voirsuite'])) : ?> |
<span class="lireTout gris puceFleche"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<?php endif; ?> |
</div> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
<!-- 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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><a href="<?=$site['url']?>"><?=$site['titre']?></a></h1> |
<div class="contenu_RSS" <?=($site['id']!="") ? 'id="'.$site["id"].'"' : ""; ?>> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
//Traitement spécifique tela |
// La ligne ci-dessous sert à enlever les "align=left" dans les images générées par spip |
// TODO : enlever du flux RSS |
$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12); |
?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div class="actualites1"> |
<div class="texteActualites1"> |
<?php |
// Préparation de la variable de date en chaîne de caractères |
$date_string = ""; |
$date_string .= $GLOBALS['jours'][date ('w', $date)]; |
$date_string .= ' '.date ('d', $date); |
$date_string .= ' '.$GLOBALS['mois'][date('n', $date)]; |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<p><?=$page['description']?></p> |
<a title="Voir le projet" href="<?=$page['url']?>"> <span class="lire-suite">Voir le projet</span></a></p> |
</div> |
</div> |
<?php endforeach; ?> |
<?php endforeach; ?> |
<?php if (isset($site['voirsuite'])) : ?> |
<span class="voir-tout"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<?php endif; ?> |
</div> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
/trunk/papyrus/applettes/syndication/squelettes/images_cel.tpl.html |
---|
1,52 → 1,129 |
<!-- 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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><a href="<?=$site['url']?>"><?=$site['titre']?></a></h1> |
<div class="contenu_RSS" <?=($site['id']!="") ? 'id="'.$site["id"].'"' : ""; ?>> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
//Traitement spécifique tela |
// La ligne ci-dessous sert à enlever les "align=left" dans les images générées par spip |
// TODO : enlever du flux RSS |
$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12); |
?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div class="actualites1"> |
<a title="<?=$page['titre']?>" href="http://www.tela-botanica.org/appli:cel-img:0000<?=$page['guid']?>M"><img src="http://www.tela-botanica.org/appli:cel-img:0000<?=$page['guid']?>S" alt="<?=$page['titre']?>" /></a> |
</div> |
<?php endforeach; ?> |
<img id="imgExtra" src="http://www.tela-botanica.org/appli:cel-img:0000<?=$sites[0]['pages'][7]['guid']?>M" /> |
</div> |
<?php endforeach; ?> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
<?php |
// Réglages de PHP |
setlocale(LC_ALL, 'fr_FR'); |
date_default_timezone_set('Europe/Paris'); |
?> |
<!-- SYNDICATION - DEBUT --> |
<!-- Penser aux inclusions ci dessous si nécessaire : --> |
<!-- <script type="text/javascript" src="/commun/jquery/1.4.2/jquery-1.4.2.min.js"></script> --> |
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.pack.js"></script> |
<link rel="stylesheet" type="text/css" href="http://www.tela-botanica.org/commun/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.css" media="screen" /> |
<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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><?=$site['titre']?></h1> |
<div class="contenu_RSS" <?=($site['id']!="") ? 'id="'.$site["id"].'"' : ""; ?>> |
<a href="http://www.tela-botanica.org/eflore/cel2/jrest/CelSyndicationImage/complet/atom" class="suivre-observations" title="Suivre les images" onclick="window.open(this.href);return false;">Suivre les images</a> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
//Traitement spécifique tela |
// La ligne ci-dessous sert à enlever les "align=left" dans les images génériques par spip |
// TODO : enlever du flux RSS |
$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12); |
// Formatage date |
$timestamp = strtotime($page['date']); |
$page['date'] = strftime('%A %d %B %Y', $timestamp); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
$tpl_url = preg_replace('/(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.jpg$/', '%s.jpg', $page['guid']); |
$guid = $page['guid']; |
if (preg_match('/appli:cel-img:([0-9]+)[SML]\.jpg$/', $page['guid'], $match)) { |
$guid = (int) $match[1]; |
} |
?> |
<div class="actualites1"> |
<a href="<?=sprintf($tpl_url, 'XL')?>" class="image-lien" |
title="<?=$titre_page?> - Publiée le <?=$page['date']?> - GUID : <?=$guid?>" |
rel="galerie-princ"> |
<img src="<?=sprintf($tpl_url, 'CRX2S')?>" alt="<?=$titre_page?>"/> |
</a> |
<div style="display: none;"> |
<div id="cel-obs-<?=$guid?>" class="infos-annexe"> |
<strong> |
<a class="image-titre" href="<?=$page['description']?>" |
onclick="window.open(this.href);return false;" |
title="Cliquez pour accéder à la fiche eFlore"> |
<?=$titre_page?> |
</a> |
</strong><br /> |
<span class="image-date">Publiée le <?=$page['date']?></span> |
</div> |
</div> |
</div> |
<?php endforeach; ?> |
<!-- Image Extra en dessous des vignettes --> |
<? |
$page = $sites[0]['pages'][7]; |
// Formatage date |
$timestamp = strtotime($page['date']); |
$page['date'] = strftime('%A %d %B %Y', $timestamp); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
$tpl_url = preg_replace('/(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.jpg$/', '%s.jpg', $page['guid']); |
$guid = $page['guid']; |
if (preg_match('/appli:cel-img:([0-9]+)(XS|[SML]|X(?:[23]|)L|CR(?:|X2)S|C(?:|X)S)\.jpg$/', $page['guid'], $match)) { |
$guid = (int) $match[1]; |
} |
?> |
<div class="actualites1"> |
<a href="<?=sprintf($tpl_url, 'XL')?>" class="image-lien" |
title="<?=$titre_page?> - Publiée le <?=$page['date']?> - GUID : <?=$guid?>" |
rel="galerie-princ"> |
<img id="imgExtra" src="<?=sprintf($tpl_url, 'CRS')?>" alt="<?=$titre_page?>"/> |
</a> |
</div> |
<script type="text/Javascript"> |
function formaterTitre(titre, currentArray, currentIndex, currentOpts) { |
var motif = /GUID : ([0-9A-Z]+)$/; |
motif.exec(titre); |
var guid = RegExp.$1; |
var info = $('#cel-obs-'+guid).clone().html(); |
var tpl = |
'<div id="cel-legende">'+ |
(titre && titre.length ? '<p>'+info+'<\/p>' : '' )+ |
'<\/div>'; |
return tpl; |
} |
$(document).ready(function() { |
$('a.image-lien').attr('rel', 'galerie-princ').fancybox({ |
transitionIn:'elastic', |
transitionOut:'elastic', |
speedIn :600, |
speedOut:200, |
overlayShow:true, |
titleShow:true, |
titlePosition:'inside', |
titleFormat:formaterTitre |
}); |
}); |
</script> |
</div> |
<?php endforeach; ?> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
/trunk/papyrus/applettes/syndication/squelettes/simple.tpl.html |
---|
1,57 → 1,57 |
<!-- SYNDICATION - DEBUT --> |
<div class="flux_simple"> |
<?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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><?=$site['titre']?></h1> |
<div class="contenu_RSS" id="<?=$site['id']?>"> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div id="actualites1"> |
<div id="texteActualites1"> |
<?php |
// Préparation de la variable de date en chaîne de caractères |
$date_string = ""; |
$date_string .= $GLOBALS['jours'][date ('w', $date)]; |
$date_string .= ' '.date ('d', $date); |
$date_string .= ' '.$GLOBALS['mois'][date('n', $date)]; |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<h4><?=$date_string?></h4> |
</div> |
</div> |
<?php endforeach; ?> |
<?php endforeach; ?> |
</div> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
<!-- SYNDICATION - DEBUT --> |
<div class="flux_simple"> |
<?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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><?=$site['titre']?></h1> |
<div class="contenu_RSS" id="<?=$site['id']?>"> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div id="actualites1"> |
<div id="texteActualites1"> |
<?php |
// Préparation de la variable de date en chaîne de caractères |
$date_string = ""; |
$date_string .= $GLOBALS['jours'][date ('w', $date)]; |
$date_string .= ' '.date ('d', $date); |
$date_string .= ' '.$GLOBALS['mois'][date('n', $date)]; |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<p class="sous-titre"><?=$date_string?></p> |
</div> |
</div> |
<br /> |
<?php endforeach; ?> |
<?php endforeach; ?> |
</div> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
/trunk/papyrus/applettes/syndication/squelettes/actu_v5_sansimage.tpl.html |
---|
1,65 → 1,65 |
<!-- 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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><a href="<?=$site['url']?>"><?=$site['titre']?></a></h1> |
<div class="contenu_RSS" <?=($site['id']!="") ? 'id="'.$site["id"].'"' : ""; ?>> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
//Traitement spécifique tela |
// La ligne ci-dessous sert à enlever les "align=left" dans les images générées par spip |
// TODO : enlever du flux RSS |
$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12); |
?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div class="actualites1"> |
<div class="texteActualites1"> |
<?php |
// Préparation de la variable de date en chaîne de caractères |
$date_string = ""; |
$date_string .= $GLOBALS['jours'][date ('w', $date)]; |
$date_string .= ' '.date ('d', $date); |
$date_string .= ' '.$GLOBALS['mois'][date('n', $date)]; |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<h4>Mis en ligne <?=$date_string?> par <?=$page['author']?></h4> |
<p><?=$page['description_light']?></p> |
<a title="Lire la suite article" href="<?=$page['url']?>"> <span class="vertpetit petitcarre voirSuite">Lire la suite</span></a></p> |
</div> |
</div> |
<?php endforeach; ?> |
<?php endforeach; ?> |
<?php if (isset($site['voirsuite'])) : ?> |
<span class="lireTout gris puceFleche"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<?php endif; ?> |
</div> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
<!-- 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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><a href="<?=$site['url']?>"><?=$site['titre']?></a></h1> |
<div class="contenu_RSS" <?=($site['id']!="") ? 'id="'.$site["id"].'"' : ""; ?>> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
//Traitement spécifique tela |
// La ligne ci-dessous sert à enlever les "align=left" dans les images générées par spip |
// TODO : enlever du flux RSS |
$image = substr_replace($page['image'], ' ', strpos($page['image'], 'align='), 12); |
?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div class="actualites1"> |
<div class="texteActualites1"> |
<?php |
// Préparation de la variable de date en chaîne de caractères |
$date_string = ""; |
$date_string .= $GLOBALS['jours'][date ('w', $date)]; |
$date_string .= ' '.date ('d', $date); |
$date_string .= ' '.$GLOBALS['mois'][date('n', $date)]; |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<h4>Mis en ligne <?=$date_string?> par <?=$page['author']?></h4> |
<p><?=$page['description_light']?></p> |
<a title="Lire la suite article" href="<?=$page['url']?>"> <span class="lire-suite">Lire la suite</span></a></p> |
</div> |
</div> |
<?php endforeach; ?> |
<?php endforeach; ?> |
<?php if (isset($site['voirsuite'])) : ?> |
<span class="voir-tout"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<?php endif; ?> |
</div> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
/trunk/papyrus/applettes/syndication/squelettes/synd_contributions.tpl.html |
---|
1,58 → 1,58 |
<!-- SYNDICATION - DEBUT --> |
<div class="flux_simple"> |
<?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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><?=$site['titre']?></h1> |
<div class="contenu_RSS" id="<?=$site['id']?>"> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div class="contributions"> |
<div id="texte_contribution"> |
<h4 class="categorie"><?=$page['category']?></h4> |
<?php |
// Préparation de la variable de date en chaîne de caractères |
$date_string = ""; |
$date_string .= $GLOBALS['jours'][date ('w', $date)]; |
$date_string .= ' '.date ('d', $date); |
$date_string .= ' '.$GLOBALS['mois'][date('n', $date)]; |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<h4><?=$date_string?></h4> |
</div> |
</div> |
<?php endforeach; ?> |
<?php endforeach; ?> |
</div> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |
<!-- SYNDICATION - DEBUT --> |
<div class="flux_simple"> |
<?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 : ?> |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><?=$site['titre']?></h1> |
<div class="contenu_RSS" id="<?=$site['id']?>"> |
<?php foreach ($site['pages'] as $page) : ?> |
<?php |
$date = strtotime($page['date']); |
$titre_page = preg_replace('/^\d+-\d+ :/', '', $page['titre']); |
?> |
<div class="contributions"> |
<div id="texte_contribution"> |
<h4 class="categorie"><?=$page['category']?></h4> |
<?php |
// Préparation de la variable de date en chaîne de caractères |
$date_string = ""; |
$date_string .= $GLOBALS['jours'][date ('w', $date)]; |
$date_string .= ' '.date ('d', $date); |
$date_string .= ' '.$GLOBALS['mois'][date('n', $date)]; |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<span class="sous-titre"><?=$date_string?></span> |
</div> |
</div> |
<?php endforeach; ?> |
<?php endforeach; ?> |
</div> |
<?php endif; ?> |
</div> |
<!-- SYNDICATION - FIN --> |