From: gburri Date: Fri, 7 Nov 2008 07:04:43 +0000 (+0000) Subject: FIX coupure des mots trop long X-Git-Tag: cl7~9 X-Git-Url: http://git.euphorik.ch/?p=cl7.git;a=commitdiff_plain;h=757f317d1142c66678ac45e6346b961700b10c77 FIX coupure des mots trop long git-svn-id: svn://localhost/cl7/trunk@14 4c3d3983-c6fa-4c6c-9935-18c3bbef1bf0 --- diff --git a/php/traitement_pre_affichage.php b/php/traitement_pre_affichage.php index 85c56d4..ef5e20d 100644 --- a/php/traitement_pre_affichage.php +++ b/php/traitement_pre_affichage.php @@ -38,17 +38,16 @@ date : 19.02.2002 enlève les liens http et ajoute des
---------------------------------------------------*/ -function traitement_pre_affichage($texte, $nb_max_long = 20) +function traitement_pre_affichage($texte, $nb_max_long = 15) { - $texte = htmlentities($texte, ENT_QUOTES, "UTF-8"); - + $texte = htmlentities($texte, ENT_QUOTES, "UTF-8"); + #insère un espace au milieu d'un mot de longueur $nb_max_long - $texte = ereg_replace("([[:graph:]]{".$nb_max_long."})([[:graph:]]{".$nb_max_long."})", "\\1
\\2", $texte); - + $texte = preg_replace("/([^ ]{".$nb_max_long."})([^ ]{".$nb_max_long."})/", '$1 $2 ', $texte); + #ajoute les smiles et les
, enlève les balises $texte = couleur(smile(nl2br($texte))); - #souligné $texte = str_replace("[u]", "", $texte); $texte = str_replace("[/u]", "", $texte); diff --git a/tools/yaws.conf b/tools/yaws.conf index a24b2be..8da122c 100644 --- a/tools/yaws.conf +++ b/tools/yaws.conf @@ -10,7 +10,7 @@ ebin_dir = ../urlrewrite port = 8090 listen = 0.0.0.0 - docroot = /home/gburri/projets/cl7/trunk/ + docroot = /home/gburri/code/projets/cl7/trunk allowed_scripts = php arg_rewrite_mod = cl7_urlrewrite # dir_listings = true