dans le squelette:
[(#DESCRIPTIF|sinon{[(#CHAPO*|sinon{#TEXTE*}|resumer{200})]})]
Lire la suite
dans mes_fonctions: function resumer($texte,$limite,$suite=" (...)") { if (strlen($texte) <= $limite) return $texte; $pos = strpos(substr($texte, $limite), " "); if (is_integer($pos)){ $limite += $pos; $pos = strpos(substr($texte, $limite), "\n"); } // s'il y a un espace après $limite caractères ou juste après $limite caractères // on retourne la partie de $texte jusqu'avant cet espace if (is_integer($pos) && $pos) return traiter_raccourcis(substr($texte, 0, $limite+ $pos)).$suite; // sinon (pas d'espace après $limite caractères ou juste après $limite caractères) on retourne le texte else return traiter_raccourcis($texte); }