/trunk/papyrus/applettes/syndication/configuration/synd_configuration.inc.php |
---|
55,7 → 55,7 |
define('SYND_NOMBRE', 10); |
/** Constante stockant le chemin vers le dossier de cache pour MAGPIERSS.*/ |
define('CACHE_DIR', PAP_CHEMIN_RACINE.'/tmp'); |
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é.*/ |
/trunk/papyrus/applettes/syndication/syndication.php |
---|
171,7 → 171,7 |
$xml = file_get_contents($url); |
$feed = new XML_Feed_Parser($xml); |
} catch (XML_Feed_Parser_Exception $e) { |
creer_cache('erreur', $xml, 604800); |
creer_cache('erreur', $xml, 86400); |
return('Le flux RSS est invalide : ' . $e->getMessage()); |
} |
385,6 → 385,20 |
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 $ |
/trunk/papyrus/applettes/syndication/squelettes/actu_v5.tpl.html |
---|
49,13 → 49,13 |
<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> |
<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="lireTout gris puceFleche"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<span class="voir-tout"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<?php endif; ?> |
</div> |
<?php endif; ?> |
/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 |
---|
47,13 → 47,13 |
?> |
<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> |
<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="lireTout gris puceFleche"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<span class="voir-tout"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<?php endif; ?> |
</div> |
<?php endif; ?> |
/trunk/papyrus/applettes/syndication/squelettes/images_cel.tpl.html |
---|
1,4 → 1,13 |
<?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> |
22,31 → 31,99 |
<!-- Affichage du flux RSS --> |
<?php $flux = array(); ?> |
<?php foreach ($sites as $site) : ?> |
<h1><a href="<?=$site['url']?>"><?=$site['titre']?></a></h1> |
<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érées par spip |
// 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); |
?> |
<?php |
$date = strtotime($page['date']); |
// 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 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> |
<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; ?> |
<img id="imgExtra" src="http://www.tela-botanica.org/appli:cel-img:0000<?=$sites[0]['pages'][7]['guid']?>M" /> |
<!-- 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 --> |
<!-- SYNDICATION - FIN --> |
/trunk/papyrus/applettes/syndication/squelettes/simple.tpl.html |
---|
40,12 → 40,12 |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<h4><?=$date_string?></h4> |
<p class="sous-titre"><?=$date_string?></p> |
</div> |
</div> |
<br /> |
<?php endforeach; ?> |
<?php endforeach; ?> |
</div> |
/trunk/papyrus/applettes/syndication/squelettes/actu_v5_sansimage.tpl.html |
---|
48,13 → 48,13 |
<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> |
<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="lireTout gris puceFleche"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<span class="voir-tout"><a class="orange" href="<?=$site['url']?>"><?=$site['voirsuite']?></a></span> |
<?php endif; ?> |
</div> |
<?php endif; ?> |
/trunk/papyrus/applettes/syndication/squelettes/synd_contributions.tpl.html |
---|
41,7 → 41,7 |
$date_string .= ' '.date ('Y', $date); |
?> |
<h3><a href="<?=$page['url']?>" class="lien_ext"><?=$titre_page?></a></h3> |
<h4><?=$date_string?></h4> |
<span class="sous-titre"><?=$date_string?></span> |
</div> |
</div> |