From 2394f7af552abe8158f65e6faead3a2ad8bf8bbd Mon Sep 17 00:00:00 2001 From: Riccardo Di Dato Date: Mon, 31 Jul 2017 15:20:53 +0200 Subject: [PATCH] Inserito helper taglio testi articolo in categorySummary Signed-off-by: Riccardo Di Dato --- public/categorySummary.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/public/categorySummary.php b/public/categorySummary.php index d3561ed..e7c6c8c 100644 --- a/public/categorySummary.php +++ b/public/categorySummary.php @@ -67,9 +67,15 @@ try{ // $stringTitolo = (strlen($notizia->titolo) > 103) ? substr($notizia->titolo,0,100).'...' : $notizia->titolo; // $stringSottotitolo = (strlen($notizia->sottotitolo) > 73) ? substr($notizia->sottotitolo,0,70).'...' : $notizia->sottotitolo; // $stringTesto = (strlen($notizia->testo) > 33) ? substr($notizia->testo,0,30).'...' : $notizia->testo; - $stringTitolo = (strlen($notizia->titolo) > 103) ? htmlentities( substr( html_entity_decode( $notizia->titolo, ENT_QUOTES|ENT_HTML5 ),0,100) ).'...' : $notizia->titolo; - $stringSottotitolo = (strlen($notizia->sottotitolo) > 73) ? htmlentities( substr( html_entity_decode( $notizia->sottotitolo, ENT_QUOTES|ENT_HTML5 ) ,0,70) ).'...' : $notizia->sottotitolo; - $stringTesto = (strlen($notizia->testo) > 33) ? htmlentities( substr( html_entity_decode( $notizia->testo, ENT_QUOTES|ENT_HTML5 ),0,30) ).'...' : $notizia->testo; + +// $stringTitolo = (strlen($notizia->titolo) > 103) ? htmlentities( substr( html_entity_decode( $notizia->titolo, ENT_QUOTES|ENT_HTML5 ),0,100) ).'...' : $notizia->titolo; +// $stringSottotitolo = (strlen($notizia->sottotitolo) > 73) ? htmlentities( substr( html_entity_decode( $notizia->sottotitolo, ENT_QUOTES|ENT_HTML5 ) ,0,70) ).'...' : $notizia->sottotitolo; +// $stringTesto = (strlen($notizia->testo) > 33) ? htmlentities( substr( html_entity_decode( $notizia->testo, ENT_QUOTES|ENT_HTML5 ),0,30) ).'...' : $notizia->testo; + + $stringTitolo = $notizia->cutTextHtmlSafe("titolo",100); + $stringSottotitolo = $notizia->cutTextHtmlSafe("sottotitolo",70); + $stringTesto = $notizia->cutTextHtmlSafe("testo",30); + $media = DaoMediaHandler::getMainMediaFromModel($notizia); ?>