Actualisation du fichier libreavous_fonctions.php
This commit is contained in:
parent
a63d448e70
commit
7a971e3d26
@ -46,7 +46,7 @@ function libreavous_duree($start,$end) {
|
|||||||
$timeend = new DateTime($end);
|
$timeend = new DateTime($end);
|
||||||
$timeduree = $timestart->diff($timeend);
|
$timeduree = $timestart->diff($timeend);
|
||||||
$duree = $timeduree->format('%h h %i min. %s s.');
|
$duree = $timeduree->format('%h h %i min. %s s.');
|
||||||
|
|
||||||
return $duree;
|
return $duree;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ function libreavous_duree_podcast($start,$end) {
|
|||||||
$timeend = new DateTime($end);
|
$timeend = new DateTime($end);
|
||||||
$timeduree = $timestart->diff($timeend);
|
$timeduree = $timestart->diff($timeend);
|
||||||
$duree = $timeduree->format('%H:%I:%S');
|
$duree = $timeduree->format('%H:%I:%S');
|
||||||
|
|
||||||
return $duree;
|
return $duree;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -88,10 +88,18 @@ function libreavous_aveczerod($chaine) {
|
|||||||
return $chaineaveczero;
|
return $chaineaveczero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// renvoie $chaine seulement si $chaine commence par http
|
||||||
//traite une chaine de recherche provenant d'un paramètre extérieur (q ou qid)
|
function libreavous_sihttp($chaine) {
|
||||||
function filtre_scrutari_escape_query($texte) {
|
if (preg_match('/media.april.org/',$chaine)) {
|
||||||
$texte = preg_replace('/[^-*":!()&|[:alnum:]]+/u', ' ', $texte);
|
return $chaine;
|
||||||
$texte = trim(str_replace("\"", "\\\"", $texte));
|
}
|
||||||
return $texte;
|
}
|
||||||
|
// renvoie $chaine seulement si $chaine commence par #EXTINF
|
||||||
|
// et retire le debut indesirable
|
||||||
|
function libreavous_siextinf($chaine) {
|
||||||
|
if (preg_match('/^#EXTINF/',$chaine)) {
|
||||||
|
$pattern = '/^#EXTINF(.*),/';
|
||||||
|
$replace = preg_replace($pattern, '', $chaine);
|
||||||
|
return $replace;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user