From 93bb9b2610b0e7985ff4c1e88c36f813e9627f40 Mon Sep 17 00:00:00 2001 From: Riccardo Di Dato Date: Sun, 25 Sep 2022 21:21:42 +0200 Subject: [PATCH] #10 - Completo --- app/private/lib/SimpleConfigHelper.php | 71 ++++++++++ app/private/lib/dao/lib.inclusion.php | 2 + app/private/lib/dao/models/NotiziaModel.php | 4 + app/private/lib/dao/models/SimpleConfig.php | 26 ++++ app/private/lib/gui/MenuGenerator.php | 4 +- app/private/lib/lib.inclusions.php | 3 + app/public/admin/simpleConfig.php | 69 +++++++++ app/public/articolo.php | 9 +- app/public/index.php | 63 +++++---- app/public/mobile/articolo.php | 9 +- app/public/mobile/index.php | 148 +++++++++----------- app/public/mobile/style/public.css | 4 +- app/public/style/public.css | 5 +- 13 files changed, 304 insertions(+), 113 deletions(-) create mode 100644 app/private/lib/SimpleConfigHelper.php create mode 100644 app/private/lib/dao/models/SimpleConfig.php create mode 100644 app/public/admin/simpleConfig.php diff --git a/app/private/lib/SimpleConfigHelper.php b/app/private/lib/SimpleConfigHelper.php new file mode 100644 index 0000000..175417d --- /dev/null +++ b/app/private/lib/SimpleConfigHelper.php @@ -0,0 +1,71 @@ +memcached = new Memcached(); + $this->memcached->addServer('memcached', 11211); + $this->dao = GlobalVariables::get("dao"); + + $this->reload(); + } + + public function hasValue(string $name) : bool { + return property_exists($this->config, $name); + } + + public function getValue(string $name) { + return $this->config->$name; + } + + public function setValue(string $name, $val) { + $model = $this->dao->getFirst(SimpleConfig::class); + $model->details->$name = $val; + $this->dao->save($model); + $this->reload($model); + } + + + + private function reload($model = null) { + if (!is_null($model)) { + $this->memcached->set($this->getCacheKey(), json_encode($model->details, JSON_FORCE_OBJECT)); + } + else if ( !$this->isCached() ) { + $model = $this->dao->getFirst(SimpleConfig::class); + if (is_null($model)) { + $model = new SimpleConfig(); + $this->dao->save($model); + } + $this->memcached->set($this->getCacheKey(), json_encode($model->details, JSON_FORCE_OBJECT)); + } + + $rval = $this->memcached->get( + $this->getCacheKey() + ); + $this->config = json_decode($rval, false); + } + + private function getCacheKey() { + return 'glob.fdn2.simpleConfig'; + } + + private function isCached(): bool { + return $this->memcached->get( $this->getCacheKey() ) ? true : false; + } + + private function flush() { + $this->memcached->set( $this->getCacheKey(), false ); + } + + +} + + +?> \ No newline at end of file diff --git a/app/private/lib/dao/lib.inclusion.php b/app/private/lib/dao/lib.inclusion.php index a37a644..6bea8af 100644 --- a/app/private/lib/dao/lib.inclusion.php +++ b/app/private/lib/dao/lib.inclusion.php @@ -45,6 +45,8 @@ require_once(dirname(__FILE__)."/models/stats/ArticleStatsModel.php"); require_once(dirname(__FILE__)."/models/stats/BannerStatsModel.php"); require_once(dirname(__FILE__)."/models/stats/PageViewStatsModel.php"); +require_once(dirname(__FILE__)."/models/SimpleConfig.php"); + $dao = new GenericDao($database->dbName,$database->connectionString); GlobalVariables::set("dao", $dao); ?> diff --git a/app/private/lib/dao/models/NotiziaModel.php b/app/private/lib/dao/models/NotiziaModel.php index 0532d0b..fd7a846 100644 --- a/app/private/lib/dao/models/NotiziaModel.php +++ b/app/private/lib/dao/models/NotiziaModel.php @@ -47,6 +47,8 @@ class NotiziaModel extends HasMediaModel implements DaoSearchable{ const CATEGORY_CONSIGLI_ESPERTI = 18; const CATEGORY_MONDO_SPOSI = 19; + + const CATEGORY_VARIE = 99; public static $NOTIZIE_CATEGORY = array( self::CATEGORY_POLITICA=>array("label"=>"Politica","mainMenu"=>true,"hidden"=>false,"pages"=>array("list"=>"politica.php"),"color"=>"#3e3e3e","isSubmenu"=>null), @@ -69,6 +71,8 @@ class NotiziaModel extends HasMediaModel implements DaoSearchable{ self::CATEGORY_CONSIGLI_ESPERTI=>array("label"=>"I consigli degli esperti","mainMenu"=>false, "hidden"=>false,"pages"=>array("list"=>"consigliEsperti.php"),"color"=>"#3e3e3e","isSubmenu"=>null), self::CATEGORY_MONDO_SPOSI=>array("label"=>"Mondo Sposi","mainMenu"=>false, "hidden"=>false,"pages"=>array("list"=>"mondoSposi.php"),"color"=>"#dd603a","isSubmenu"=>null), + + self::CATEGORY_VARIE=>array("label"=>"Varie","mainMenu"=>false, "hidden"=>true,"pages"=>array("list"=>"varie.php"),"color"=>"#dd603a","isSubmenu"=>null), ); public function __construct($saveableObject = null){ diff --git a/app/private/lib/dao/models/SimpleConfig.php b/app/private/lib/dao/models/SimpleConfig.php new file mode 100644 index 0000000..ed4da7f --- /dev/null +++ b/app/private/lib/dao/models/SimpleConfig.php @@ -0,0 +1,26 @@ +hasProperty("data") || !is_object($this->details)) { + $this->details = new stdClass(); + } + } + + public static function getCollectionName(){ + return "simpleConfig"; + } + +} + + +?> \ No newline at end of file diff --git a/app/private/lib/gui/MenuGenerator.php b/app/private/lib/gui/MenuGenerator.php index 228241b..b48d7b3 100644 --- a/app/private/lib/gui/MenuGenerator.php +++ b/app/private/lib/gui/MenuGenerator.php @@ -47,7 +47,9 @@ class MenuGenerator { array("label"=>"Config","page"=>"editConfig.php","requires"=>AdminModel::ADMIN_TYPE_SUPERADMIN), array("label"=>"Logs","page"=>"logs.php","requires"=>AdminModel::ADMIN_TYPE_SUPERADMIN) )), - + + array("label"=>"Config","page"=>"simpleConfig.php"), + array("label"=>"Guida","page"=>"index.php"), array("label"=>"Logout","page"=>"logout.php") diff --git a/app/private/lib/lib.inclusions.php b/app/private/lib/lib.inclusions.php index e8b96e8..32be6d0 100644 --- a/app/private/lib/lib.inclusions.php +++ b/app/private/lib/lib.inclusions.php @@ -48,5 +48,8 @@ require_once(dirname(__FILE__)."/BannerHelper.php"); require_once(dirname(__FILE__)."/RSSHelper.php"); +require_once(dirname(__FILE__)."/SimpleConfigHelper.php"); + +GlobalVariables::set("cfg", new SimpleConfigHelper()); ?> \ No newline at end of file diff --git a/app/public/admin/simpleConfig.php b/app/public/admin/simpleConfig.php new file mode 100644 index 0000000..30555e4 --- /dev/null +++ b/app/public/admin/simpleConfig.php @@ -0,0 +1,69 @@ +hasRole(AdminModel::ADMIN_TYPE_NORMALADMIN)){ + GUIHandler::redirect("admin/index.php"); +} + +MenuGenerator::generateMenu(); + +HTMLHelper::generateAdminHead(); + +$saved = false; +$action = PostHandler::get("action"); +if (!is_null($action) && strcmp("", $action)!=0){ + if (strcmp("save", $action)==0){ + + if (PostHandler::get(SimpleConfig::VARIE_LABEL)) { + GlobalVariables::get("cfg")->setValue(SimpleConfig::VARIE_LABEL, PostHandler::get(SimpleConfig::VARIE_LABEL)); + } + + $saved = true; + } +} + +?> +
+ Dati salvati con successo
'; + } + ?> +
+ +
 Tasks
+ Varie (home)
', + SimpleConfig::VARIE_LABEL, + GlobalVariables::get("cfg")->hasValue(SimpleConfig::VARIE_LABEL) ? GlobalVariables::get("cfg")->getValue(SimpleConfig::VARIE_LABEL) : "" + ) + ?> +
+
+ Salva +
+ + \ No newline at end of file diff --git a/app/public/articolo.php b/app/public/articolo.php index 8f3dc23..4034d16 100644 --- a/app/public/articolo.php +++ b/app/public/articolo.php @@ -133,6 +133,13 @@ GUIHandler::generateHtmlHeaders(array("additionalMetadata"=>$additionalHeaders,"
-->
category]["label"]; + if ($articolo->category == NotiziaModel::CATEGORY_VARIE) { + if ( GlobalVariables::get("cfg")->hasValue(SimpleConfig::VARIE_LABEL) ) { + $categoryName = GlobalVariables::get("cfg")->getValue(SimpleConfig::VARIE_LABEL); + } + } GUIHandler::generateHeadPublic(); GUIHandler::generateMenu(); @@ -140,7 +147,7 @@ GUIHandler::generateHtmlHeaders(array("additionalMetadata"=>$additionalHeaders,"
-
">category]["label"]);?>
+
">
diff --git a/app/public/index.php b/app/public/index.php index c9c4e36..7b8d2b2 100644 --- a/app/public/index.php +++ b/app/public/index.php @@ -154,15 +154,27 @@ try { // } - $animalNews = GlobalVariables::get("dao")->getFirst("NotiziaModel", - array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_MONDO_SPOSI,'_id'=>array('$nin'=>$ansaIds), - "about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))), - array("sort"=>array("about.lastEdit"=>-1)) - ); - if (!is_null($animalNews)){ - $animalNews->testo = strip_tags($animalNews->testo); - $animalNews->sottotitolo = strip_tags($animalNews->sottotitolo); - } + $varie = GlobalVariables::get("dao")->query( + NotiziaModel::class, + [ + "status"=>NotiziaModel::STATUS_ACCEPTED, + "category"=>NotiziaModel::CATEGORY_VARIE, + '_id'=> [ '$nin'=>$ansaIds ], + "about.lastEdit" => [ '$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ) ] + ] + ); + $varie = array_map( + function ($model) { + $model->testo = strip_tags($model->testo); + $model->sottotitolo = strip_tags($model->sottotitolo); + return $model; + }, + $varie + ); + $varieName = "Varie"; + if ( GlobalVariables::get("cfg")->hasValue(SimpleConfig::VARIE_LABEL) ) { + $varieName = GlobalVariables::get("cfg")->getValue(SimpleConfig::VARIE_LABEL); + } $saluteNews = GlobalVariables::get("dao")->query("NotiziaModel", array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_SALUTE,'_id'=>array('$nin'=>$ansaIds), @@ -467,7 +479,7 @@ catch (Exception $ex){ 0){ ?> -
+
SPECIALE ELEZIONI
@@ -489,7 +501,7 @@ catch (Exception $ex){ } else{ ?> -
+
VIAGGI
@@ -513,23 +525,22 @@ catch (Exception $ex){ -
-
-
MONDO SPOSI
+
+
+
- titolo) > 53) ? htmlentities( substr( html_entity_decode( $animalNews->titolo ) ,0,50) ) .'...' : $animalNews->titolo; - $stringTitle = $animalNews->cutTextHtmlSafe("titolo",50); - ?> - - -
renderMedia(['size' => MediaImage::SIZE_MEDIUM]);?>
- -
-
- +
%s
%s
', + $model->getAbsoluteUrl(), + is_null($media) ? "" : $media->asText(['size' => MediaImage::SIZE_MEDIUM]), + $model->cutTextHtmlSafe("titolo",50) + ); + } + ?>
diff --git a/app/public/mobile/articolo.php b/app/public/mobile/articolo.php index bf5c0f6..f1c1fea 100644 --- a/app/public/mobile/articolo.php +++ b/app/public/mobile/articolo.php @@ -128,6 +128,13 @@ GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHea
category]["label"]; + if ($articolo->category == NotiziaModel::CATEGORY_VARIE) { + if ( GlobalVariables::get("cfg")->hasValue(SimpleConfig::VARIE_LABEL) ) { + $categoryName = GlobalVariables::get("cfg")->getValue(SimpleConfig::VARIE_LABEL); + } + } + GUIHandlerMobile::generateHeadPublic(); GUIHandlerMobile::generateMenu(); ?> @@ -141,7 +148,7 @@ GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHea
;"> - category]["label"]);?> +
diff --git a/app/public/mobile/index.php b/app/public/mobile/index.php index eaa2bee..72d047a 100644 --- a/app/public/mobile/index.php +++ b/app/public/mobile/index.php @@ -6,9 +6,13 @@ Creation Date: 22/dic/2015 require_once(dirname(__FILE__)."/../load.php"); +function stripModelText($model) { + $model->testo = strip_tags($model->testo); + $model->sottotitolo = strip_tags($model->sottotitolo); + return $model; +} + try { -// AnalyticsHelper::logPageImpression(); - $config = GlobalVariables::get("config"); $directLink = $config->pages->remoteLocationPath."index.php"; @@ -17,122 +21,107 @@ try { GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHeaders)); -// echo "OK"; - -// var_dump(date("n")); + $mesi = array(1=>'Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre','Dicembre'); -// $day = date("d"); $pageSelected="home"; -// $ansaNews = GlobalVariables::get("dao")->query("NotiziaModel", -// array("isAnsa"=>true,"status"=>NotiziaModel::STATUS_ACCEPTED,"about.data"=>array('$lte'=>new MongoDate())), -// array("sort"=>array("about.data"=>-1),"limit"=>4)); $ansaNews = GlobalVariables::get("dao")->query("NotiziaModel", array("isAnsa"=>true,"status"=>NotiziaModel::STATUS_ACCEPTED,"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))), array("sort"=>array("about.lastEdit"=>-1),"limit"=>8)); - $ansaIds = array(); - if (sizeof($ansaNews)>0){ - $ansaIds = array_map(function($ele){return new MongoDB\BSON\ObjectID($ele->id);}, $ansaNews); - - $ansaNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $ansaNews); - } + + $ansaIds = array_map( + function($ele){ + return new MongoDB\BSON\ObjectID($ele->id); + }, + $ansaNews + ); + $ansaNews = array_map( + 'stripModelText', + $ansaNews + ); - -// $politicaNews = GlobalVariables::get("dao")->query("NotiziaModel", -// array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_POLITICA,'_id'=>array('$nin'=>$ansaIds), -// "about.data"=>array('$lte'=>new MongoDate())), -// array("sort"=>array("about.data"=>-1),"limit"=>4) -// ); $politicaNews = GlobalVariables::get("dao")->query("NotiziaModel", array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_POLITICA,'_id'=>array('$nin'=>$ansaIds), "about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))), array("sort"=>array("about.lastEdit"=>-1),"limit"=>4) ); - if (sizeof($politicaNews)>0){ - $politicaNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $politicaNews); - } + $politicaNews = array_map( + 'stripModelText', + $politicaNews + ); + -// $cronacaNews = GlobalVariables::get("dao")->query("NotiziaModel", -// array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_CRONACA,'_id'=>array('$nin'=>$ansaIds), -// "about.data"=>array('$lte'=>new MongoDate())), -// array("sort"=>array("about.data"=>-1),"limit"=>4) -// ); $cronacaNews = GlobalVariables::get("dao")->query("NotiziaModel", array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_CRONACA,'_id'=>array('$nin'=>$ansaIds), "about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))), array("sort"=>array("about.lastEdit"=>-1),"limit"=>6) ); - if (sizeof($cronacaNews)>0){ - $cronacaNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $cronacaNews); - } + $cronacaNews = array_map( + 'stripModelText', + $cronacaNews + ); -// $sportNews = GlobalVariables::get("dao")->query("NotiziaModel", -// array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_SPORT,'_id'=>array('$nin'=>$ansaIds), -// "about.data"=>array('$lte'=>new MongoDate())), -// array("sort"=>array("about.data"=>-1),"limit"=>4) -// ); $sportNews = GlobalVariables::get("dao")->query("NotiziaModel", array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_SPORT,'_id'=>array('$nin'=>$ansaIds), "about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))), array("sort"=>array("about.lastEdit"=>-1),"limit"=>4) ); - if (sizeof($sportNews)>0){ - $sportNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $sportNews); - } - -// $culturaNews = GlobalVariables::get("dao")->query("NotiziaModel", -// array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_CULTURA,'_id'=>array('$nin'=>$ansaIds), -// "about.data"=>array('$lte'=>new MongoDate())), -// array("sort"=>array("about.data"=>-1),"limit"=>4) -// ); + $sportNews = array_map( + 'stripModelText', + $sportNews + ); + $culturaNews = GlobalVariables::get("dao")->query("NotiziaModel", array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_CULTURA,'_id'=>array('$nin'=>$ansaIds), "about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))), array("sort"=>array("about.lastEdit"=>-1),"limit"=>4) ); - if (sizeof($culturaNews)>0){ - $culturaNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $culturaNews); - } + $culturaNews = array_map( + 'stripModelText', + $culturaNews + ); + -// $foodNews = GlobalVariables::get("dao")->query("NotiziaModel", -// array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_RISTORANTI,'_id'=>array('$nin'=>$ansaIds), -// "about.data"=>array('$lte'=>new MongoDate())), -// array("sort"=>array("about.data"=>-1),"limit"=>4) -// ); $foodNews = GlobalVariables::get("dao")->query("NotiziaModel", array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_RISTORANTI,'_id'=>array('$nin'=>$ansaIds), "about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))), array("sort"=>array("about.lastEdit"=>-1),"limit"=>4) ); - if (sizeof($foodNews)>0){ - $foodNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $foodNews); - } + $foodNews = array_map( + 'stripModelText', + $foodNews + ); -// $professioniNews = GlobalVariables::get("dao")->query("NotiziaModel", -// array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_MESTIERI,'_id'=>array('$nin'=>$ansaIds), -// "about.data"=>array('$lte'=>new MongoDate())), -// array("sort"=>array("about.data"=>-1),"limit"=>4) -// ); $professioniNews = GlobalVariables::get("dao")->query("NotiziaModel", array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_MESTIERI,'_id'=>array('$nin'=>$ansaIds), "about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))), array("sort"=>array("about.lastEdit"=>-1),"limit"=>4) ); - if (sizeof($professioniNews)>0){ - $professioniNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $professioniNews); - } + $professioniNews = array_map( + 'stripModelText', + $professioniNews + ); - $mondoSposiNews = GlobalVariables::get("dao")->query("NotiziaModel", - array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_MONDO_SPOSI,'_id'=>array('$nin'=>$ansaIds), - "about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))), - array("sort"=>array("about.lastEdit"=>-1),"limit"=>4) - ); - if (sizeof($mondoSposiNews)>0){ - $mondoSposiNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $mondoSposiNews); - } + $varie = GlobalVariables::get("dao")->query( + NotiziaModel::class, + [ + "status"=>NotiziaModel::STATUS_ACCEPTED, + "category"=>NotiziaModel::CATEGORY_VARIE, + '_id'=> [ '$nin'=>$ansaIds ], + "about.lastEdit" => [ '$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ) ] + ] + ); + $varie = array_map( + 'stripModelText', + $varie + ); + $varieName = "Varie"; + if ( GlobalVariables::get("cfg")->hasValue(SimpleConfig::VARIE_LABEL) ) { + $varieName = GlobalVariables::get("cfg")->getValue(SimpleConfig::VARIE_LABEL); + } } catch (Exception $ex){ echo $ex->getMessage(); @@ -152,8 +141,7 @@ catch (Exception $ex){ titolo) > 103) ? htmlentities ( substr( html_entity_decode( $ansa->titolo ),0,100) ) .'...' : $ansa->titolo; -// $stringSottotitolo = (strlen($ansa->sottotitolo) > 73) ? substr($ansa->sottotitolo,0,70).'...' : $ansa->sottotitolo; -// $stringTesto = (strlen($ansa->testo) > 33) ? substr($ansa->testo,0,30).'...' : $ansa->testo;?> + ?>
-
"> - +
"> +
- 0){ + 0){ $i=0; - foreach ($mondoSposiNews as $articolo){ + foreach ($varie as $articolo){ $stringTitolo = (strlen($articolo->titolo) > 53) ? htmlentities ( substr( html_entity_decode( $articolo->titolo ) ,0,50) ) .'...' : $articolo->titolo; // $string = (strlen($politica->sottotitolo) > 33) ? substr($politica->sottotitolo,0,30).'...' : $politica->sottotitolo;?> @@ -430,8 +418,6 @@ catch (Exception $ex){