Changeset 74872 in spip-zone
- Timestamp:
- Aug 21, 2013, 7:38:48 PM (8 years ago)
- Location:
- _plugins_/spiperipsum
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/spiperipsum/content/evangile.html
r48550 r74872 7 7 8 8 [(#REM) Fil d'Ariane ] 9 #SET{jour_evangile, #ENV{jour, #DATE}}10 9 <p id="hierarchie"><a href="#URL_SITE_SPIP/"><:accueil_site:></a> > <strong class="on"><:spiperipsum:evangile_quotidien|ucfirst:></strong></p> 11 10 … … 14 13 <h1 class="h1"><:spiperipsum:evangile_quotidien|ucfirst:></h1> 15 14 <p class="info-publi"> 16 <small>[(# GET{jour_evangile}|nom_jour)][ (#GET{jour_evangile}|affdate)]</small>15 <small>[(#MODELE{spiperipsum, langue=#ENV{langue, #LANG}, jour=#ENV{jour}, lecture=date, mode=page})]</small> 17 16 </p> 18 17 </div> -
_plugins_/spiperipsum/content/saint.html
r48550 r74872 14 14 <h1 class="h1"><:spiperipsum:saint_quotidien|ucfirst:></h1> 15 15 <p class="info-publi"> 16 <small>[(# GET{jour_evangile}|nom_jour)][ (#GET{jour_evangile}|affdate)]</small>16 <small>[(#MODELE{spiperipsum, langue=#ENV{langue, #LANG}, jour=#ENV{jour}, lecture=date_iso, mode=page})]</small> 17 17 </p> 18 18 </div> -
_plugins_/spiperipsum/contenu/page-evangile.html
r45191 r74872 14 14 <h1 class="h1"><:spiperipsum:evangile_quotidien|ucfirst:></h1> 15 15 <p class="info-publi"> 16 <small>[(# GET{jour_evangile}|nom_jour)][ (#GET{jour_evangile}|affdate)]</small>16 <small>[(#MODELE{spiperipsum, langue=#ENV{langue, #LANG}, jour=#ENV{jour}, lecture=date, mode=page})]</small> 17 17 </p> 18 18 </div> -
_plugins_/spiperipsum/contenu/page-saint.html
r33994 r74872 14 14 <h1 class="h1"><:spiperipsum:saint_quotidien|ucfirst:></h1> 15 15 <p class="info-publi"> 16 <small>[(# GET{jour_evangile}|nom_jour)][ (#GET{jour_evangile}|affdate)]</small>16 <small>[(#MODELE{spiperipsum, langue=#ENV{langue, #LANG}, jour=#ENV{jour}, lecture=date_iso, mode=page})]</small> 17 17 </p> 18 18 </div> -
_plugins_/spiperipsum/inc/spiperipsum_filtres.php
r74865 r74872 14 14 15 15 $contexte = array(); 16 if ($tableau[$lecture]) 17 $contexte = $tableau[$lecture]; 18 $contexte = array_merge($contexte, array('lecture' => $lecture, 'mode' => $mode)); 19 20 if ($lecture == _SPIPERIPSUM_LECTURE_SAINT) 21 $texte = recuperer_fond("modeles/saint", $contexte); 22 else if ($lecture == _SPIPERIPSUM_LECTURE_COMMENTAIRE) 23 $texte = recuperer_fond("modeles/commentaire", $contexte); 24 else 25 $texte = recuperer_fond("modeles/lecture", $contexte); 26 16 17 if (($lecture == _SPIPERIPSUM_LECTURE_DATE) 18 OR ($lecture == _SPIPERIPSUM_LECTURE_DATE_ISO) 19 OR ($lecture == _SPIPERIPSUM_LECTURE_DATE_LITURGIQUE)) { 20 $contexte = $tableau['date']; 21 $contexte = array_merge($contexte, array('lecture' => $lecture, 'mode' => $mode)); 22 $texte = recuperer_fond("modeles/date", $contexte); 23 } 24 else { 25 if ($tableau[$lecture]) 26 $contexte = $tableau[$lecture]; 27 $contexte = array_merge($contexte, array('lecture' => $lecture, 'mode' => $mode)); 28 29 if ($lecture == _SPIPERIPSUM_LECTURE_SAINT) 30 $texte = recuperer_fond("modeles/saint", $contexte); 31 else if ($lecture == _SPIPERIPSUM_LECTURE_COMMENTAIRE) 32 $texte = recuperer_fond("modeles/commentaire", $contexte); 33 else 34 $texte = recuperer_fond("modeles/lecture", $contexte); 35 } 36 27 37 return $texte; 28 38 } -
_plugins_/spiperipsum/inc/spiperipsum_utils.php
r74865 r74872 2 2 if (!defined('_ECRIRE_INC_VERSION')) return; 3 3 4 if (!defined('_SPIPERIPSUM_FORCER_CHARGEMENT')) 5 define('_SPIPERIPSUM_FORCER_CHARGEMENT', false); 4 6 5 7 // Convertir le code de langue SPIP en code langue du serveur … … 166 168 167 169 if ($no_tag) { 168 $regexp = array_merge($regexp, array('#<p\b.*>.*</p>#UimsS', '# (<br />)+$#UimS', '#</?font\b.*>#UimsS'));169 $replace = array_merge($replace, array('', '', '' ));170 $regexp = array_merge($regexp, array('#<p\b.*>.*</p>#UimsS', '#<a\b.*>.*</a>$#UimsS', '#(<br />)+$#UimS', '#</?font\b.*>#UimsS')); 171 $replace = array_merge($replace, array('', '', '', '')); 170 172 } 171 173 … … 340 342 } 341 343 344 345 function flux2date($url_base, $charset, $date) { 346 $tableau = array('date_iso' => '', 'date_liturgique' => ''); 347 348 // Date iso 349 $tableau['date_iso'] = $date; 350 351 // Date liturgique 352 $no_tag = false; 353 $url = $url_base . '&type=liturgic_t'; 354 $tableau['date_liturgique'] = flux2element($url, $charset, $no_tag); 355 356 return $tableau; 357 } 358 359 342 360 // Charger le fichier des lectures et du saint du jour j 343 361 // - si le fichier existe on retourne directement son nom complet … … 354 372 $dir = sous_repertoire(_DIR_CACHE,"spiperipsum"); 355 373 $dir = sous_repertoire($dir,substr(md5($code_langue),0,1)); 356 $ f= $dir . $code_langue . "_" . $date . ".txt";357 358 if (!file_exists($ f)) {374 $cache = $dir . $code_langue . "_" . $date . ".txt"; 375 376 if (!file_exists($cache) OR _SPIPERIPSUM_FORCER_CHARGEMENT) { 359 377 // Determination de la sous-chaine url correspondant a la date (vide si jour courant) 360 378 $url_date = ($jour == _SPIPERIPSUM_JOUR_DEFAUT) ? '' : date2url_date($date); 361 // Date du jour362 $tableau['date'] = $date;363 379 // Url de base de tous les flux 364 380 $url_base = 'http://feed.evangelizo.org/reader.php?lang=' . $code_langue . '&date=' . date('Ymd', strtotime($date)); 381 382 // traitement des différentes versions de la date 383 $tableau['date'] = flux2date($url_base, $charset, $date); 365 384 366 385 // Traitement de l'evangile … … 389 408 390 409 // var_dump($tableau); 391 ecrire_fichier($ f, serialize($tableau));392 } 393 return $ f;410 ecrire_fichier($cache, serialize($tableau)); 411 } 412 return $cache; 394 413 } 395 414 -
_plugins_/spiperipsum/spiperipsum_options.php
r74865 r74872 3 3 4 4 // Langue par defaut si non supportee par le site serveur 5 define ('_SPIPERIPSUM_LANGUE_DEFAUT','en'); 5 if (!defined('_SPIPERIPSUM_LANGUE_DEFAUT')) 6 define('_SPIPERIPSUM_LANGUE_DEFAUT','en'); 6 7 7 8 // Jour par defaut 8 define ('_SPIPERIPSUM_JOUR_DEFAUT','aujourdhui'); 9 if (!defined('_SPIPERIPSUM_JOUR_DEFAUT')) 10 define('_SPIPERIPSUM_JOUR_DEFAUT','aujourdhui'); 9 11 10 12 // Valeurs de l'argument lecture dans le modele evangile 11 define ('_SPIPERIPSUM_LECTURE_EVANGILE','evangile'); 12 define ('_SPIPERIPSUM_LECTURE_PREMIERE','premiere'); 13 define ('_SPIPERIPSUM_LECTURE_SECONDE','seconde'); 14 define ('_SPIPERIPSUM_LECTURE_PSAUME','psaume'); 15 define ('_SPIPERIPSUM_LECTURE_COMMENTAIRE','commentaire'); 16 define ('_SPIPERIPSUM_LECTURE_SAINT','saint'); 17 define ('_SPIPERIPSUM_LECTURE_FETE','fete'); 13 if (!defined('_SPIPERIPSUM_LECTURE_EVANGILE')) 14 define('_SPIPERIPSUM_LECTURE_EVANGILE','evangile'); 15 if (!defined('_SPIPERIPSUM_LECTURE_PREMIERE')) 16 define('_SPIPERIPSUM_LECTURE_PREMIERE','premiere'); 17 if (!defined('_SPIPERIPSUM_LECTURE_SECONDE')) 18 define('_SPIPERIPSUM_LECTURE_SECONDE','seconde'); 19 if (!defined('_SPIPERIPSUM_LECTURE_PSAUME')) 20 define('_SPIPERIPSUM_LECTURE_PSAUME','psaume'); 21 if (!defined('_SPIPERIPSUM_LECTURE_COMMENTAIRE')) 22 define('_SPIPERIPSUM_LECTURE_COMMENTAIRE','commentaire'); 23 if (!defined('_SPIPERIPSUM_LECTURE_SAINT')) 24 define('_SPIPERIPSUM_LECTURE_SAINT','saint'); 25 if (!defined('_SPIPERIPSUM_LECTURE_FETE')) 26 define('_SPIPERIPSUM_LECTURE_FETE','fete'); 27 if (!defined('_SPIPERIPSUM_LECTURE_DATE')) 28 define('_SPIPERIPSUM_LECTURE_DATE','date'); 29 if (!defined('_SPIPERIPSUM_LECTURE_DATE_ISO')) 30 define('_SPIPERIPSUM_LECTURE_DATE_ISO','date_iso'); 31 if (!defined('_SPIPERIPSUM_LECTURE_DATE_LITURGIQUE')) 32 define('_SPIPERIPSUM_LECTURE_DATE_LITURGIQUE','date_liturgique'); 18 33 // -- Lecture par defaut 19 define ('_SPIPERIPSUM_LECTURE_DEFAUT','evangile'); 34 if (!defined('_SPIPERIPSUM_LECTURE_DEFAUT')) 35 define('_SPIPERIPSUM_LECTURE_DEFAUT','evangile'); 20 36 21 37 // Valeurs de l'argument mode d'appel du modele (depuis article ou page zpip) 22 define ('_SPIPERIPSUM_MODE_ARTICLE','article'); 23 define ('_SPIPERIPSUM_MODE_PAGE','page'); 38 if (!defined('_SPIPERIPSUM_MODE_ARTICLE')) 39 define('_SPIPERIPSUM_MODE_ARTICLE','article'); 40 if (!defined('_SPIPERIPSUM_MODE_PAGE')) 41 define('_SPIPERIPSUM_MODE_PAGE','page'); 24 42 // -- Mode par defaut 25 define ('_SPIPERIPSUM_MODE_DEFAUT','article'); 43 if (!defined('_SPIPERIPSUM_MODE_DEFAUT')) 44 define('_SPIPERIPSUM_MODE_DEFAUT','article'); 26 45 27 46 // Info par defaut 28 define ('_SPIPERIPSUM_INFO_DEFAUT','titre'); 47 if (!defined('_SPIPERIPSUM_INFO_DEFAUT')) 48 define('_SPIPERIPSUM_INFO_DEFAUT','titre'); 49 50 // Séparateur entre la date iso et la date liturgique quand on demande une lecture=date 51 if (!defined('_SPIPERIPSUM_SEPARATEUR_DATE')) 52 define('_SPIPERIPSUM_SEPARATEUR_DATE', ', '); 53 29 54 ?>
Note: See TracChangeset
for help on using the changeset viewer.