From 85ca6dd064576301571dcc992720e90a742ba053 Mon Sep 17 00:00:00 2001 From: chankalan Date: Tue, 5 Oct 2021 18:19:43 +0200 Subject: [PATCH] =?UTF-8?q?fix=20date=20<=2010=20avec=20un=200=20+=20radio?= =?UTF-8?q?live=20sur=20la=20page=20d'une=20=C3=A9mission?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libreavous_fonctions.php | 44 +++++----------------- squelettes/content/article-emission.html | 2 +- squelettes/content/rubrique-emissions.html | 2 +- squelettes/content/sommaire.html | 3 +- squelettes/inclure/chapitre.html | 2 +- squelettes/inclure/radiolive.html | 7 ++-- squelettes/inclure/resume/chronique.html | 2 +- squelettes/inclure/resume/emission.html | 4 +- squelettes/scss/styles/_perso.scss | 3 ++ 9 files changed, 24 insertions(+), 45 deletions(-) diff --git a/libreavous_fonctions.php b/libreavous_fonctions.php index a039283..7595ba7 100644 --- a/libreavous_fonctions.php +++ b/libreavous_fonctions.php @@ -3,8 +3,6 @@ if (!defined('_ECRIRE_INC_VERSION')) { return; } - - function filtre_escape_json($texte) { return str_replace("\"", "\\\"", str_replace("\n", "\\n", str_replace("\n\n", "\n

\n", $texte))); } @@ -206,39 +204,9 @@ function titre_chronique_court($titre) { return $titre; } - -// function radiolive() { -// $dateetheure= time(); -// -// $h1=strtotime("15:15:00"); -// $h2=strtotime(date ('H:i:s',$dateetheure)); -// -// $radio = ''; -// -// if((date("w", $dateetheure ) == 2) && ($h2 >= $h1) && (date("G", $dateetheure ) < 17)) { -// // $radio = 'live'; -// -// $radio = ' -//
-//
-//

Écoutez le direct (mardi 15h30 à 17h)

-// -//
-//
'; -// } -// -// return $radio; -// -// } - - - // calculer la durée d'un chapitre // $start et $end sous form hh:mm:ss -function duree($start,$end) { +function libreavous_duree($start,$end) { $timestart = new DateTime($start); $timeend = new DateTime($end); @@ -249,7 +217,15 @@ function duree($start,$end) { } // retirer l'heure si 0 h dans la duree -function sanszeroh($chaine) { +function libreavous_sanszeroh($chaine) { $chaine = str_replace('0 h ','',$chaine); return $chaine; } +// ajoute un 0 si un seul chiffre (date du jour < à 10) +function libreavous_aveczerod($chaine) { + if (strlen($chaine) == '1') { + $chaineaveczero = '0'.$chaine; + } + return $chaineaveczero; +} + diff --git a/squelettes/content/article-emission.html b/squelettes/content/article-emission.html index f805b90..9a41611 100644 --- a/squelettes/content/article-emission.html +++ b/squelettes/content/article-emission.html @@ -1,5 +1,5 @@ -[(#SET{fin_emission,[(#DATE|annee)-][(#DATE|mois)-][(#DATE|jour) ]17:00:00})] +[(#SET{fin_emission,[(#DATE|annee)-][(#DATE|mois)-][(#DATE|jour|libreavous_aveczerod) ]19:00:00})]
diff --git a/squelettes/content/rubrique-emissions.html b/squelettes/content/rubrique-emissions.html index 4e7aa17..56a3b11 100644 --- a/squelettes/content/rubrique-emissions.html +++ b/squelettes/content/rubrique-emissions.html @@ -6,7 +6,7 @@ [
(#TEXTE|adaptive_images{#CONST{_CONTENT_WIDTH}})
]
-
+

<:libreavous:derniere_emission:>

diff --git a/squelettes/content/sommaire.html b/squelettes/content/sommaire.html index bc21601..e5081ea 100644 --- a/squelettes/content/sommaire.html +++ b/squelettes/content/sommaire.html @@ -1,10 +1,9 @@ -[(#SET{fin_emission,[(#DATE|annee)-][(#DATE|mois)-][(#DATE|jour) ]17:00:00})] +[(#SET{fin_emission,[(#DATE|annee)-][(#DATE|mois)-][(#DATE|jour|libreavous_aveczerod) ]17:00:00})] #SET{prochaine,#ID_ARTICLE}
-
[(#TITRE)] - [(#FIN|oui)[ <:libreavous:duree:> : (#DEBUT|duree{#FIN}|sanszeroh)] ogg + [(#FIN|oui)[ <:libreavous:duree:> : (#DEBUT|libreavous_duree{#FIN}|libreavous_sanszeroh)] ogg mp3] diff --git a/squelettes/inclure/radiolive.html b/squelettes/inclure/radiolive.html index 94994ef..051e351 100644 --- a/squelettes/inclure/radiolive.html +++ b/squelettes/inclure/radiolive.html @@ -5,9 +5,10 @@ ][(#ENV{date}|heures|>={17}|oui) #SET{live,off} ] -][(#ENV{date}|>={#GET{debut_emission}}|et{#ENV{date}|<={#GET{fin_emission}}}|oui) -#SET{live,on}] -[(#GET{live}|=={on}|oui)
+][(#ENV{date}|<={#ENV{fin_emission}}|oui) + [(#ENV{date}|>={#ENV{debut_emission}}|oui) + #SET{live,on}] +][(#GET{live}|=={on}|oui)

Écoutez le direct !

Salon web

diff --git a/squelettes/inclure/resume/chronique.html b/squelettes/inclure/resume/chronique.html index 8d721d5..ca9823f 100644 --- a/squelettes/inclure/resume/chronique.html +++ b/squelettes/inclure/resume/chronique.html @@ -7,7 +7,7 @@ diff --git a/squelettes/inclure/resume/emission.html b/squelettes/inclure/resume/emission.html index 153c03c..dc68e57 100644 --- a/squelettes/inclure/resume/emission.html +++ b/squelettes/inclure/resume/emission.html @@ -9,7 +9,7 @@

[(#TITRE)] - [[ <:libreavous:duree:> : (#DEBUT|duree{#FIN}|sanszeroh)] + [[ <:libreavous:duree:> : (#DEBUT|libreavous_duree{#FIN}|libreavous_sanszeroh)] ogg mp3]

@@ -37,7 +37,7 @@
  • #TITRE - [[ <:libreavous:duree:> : (#DEBUT|duree{#FIN}|sanszeroh)]ogg + [[ <:libreavous:duree:> : (#DEBUT|libreavous_duree{#FIN}|libreavous_sanszeroh)]ogg mp3]
  • diff --git a/squelettes/scss/styles/_perso.scss b/squelettes/scss/styles/_perso.scss index 77ce88f..2369d7b 100644 --- a/squelettes/scss/styles/_perso.scss +++ b/squelettes/scss/styles/_perso.scss @@ -948,6 +948,9 @@ a:hover .fab, a:hover .fas { iframe { min-height:300px; } + audio { + width: 100%; + } } .orange {