From a8171ceb0656d06d7c690ba263dbb9b1f2930d2f Mon Sep 17 00:00:00 2001 From: Riccardo Di Dato Date: Fri, 4 Aug 2017 12:53:08 +0200 Subject: [PATCH] Aggiunti blocchi professioni e mestieri in index base e mobile Signed-off-by: Riccardo Di Dato --- public/index.php | 36 +++++++++++++++++++++++++++++++- public/mobile/index.php | 46 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/public/index.php b/public/index.php index e82d185..b4118f0 100644 --- a/public/index.php +++ b/public/index.php @@ -107,11 +107,20 @@ try { $gossipNews = GlobalVariables::get("dao")->query("NotiziaModel", array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_GOSSIP,'_id'=>array('$nin'=>$ansaIds), "about.data"=>array('$lte'=>new MongoDate())), - array("sort"=>array("about.data"=>-1),"limit"=>2) + array("sort"=>array("about.data"=>-1),"limit"=>1) ); if (sizeof($gossipNews)>0){ $gossipNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $gossipNews); } + + $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"=>1) + ); + if (sizeof($professioniNews)>0){ + $professioniNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $professioniNews); + } /** * Elezioni Rimosso dalla homepage 21/06/2016 in qunato finite elezioni */ @@ -410,6 +419,31 @@ catch (Exception $ex){ }?> +
+
+
+
+
+ 0){ + $i = 0; + foreach($professioniNews as $professioni){ + $i++; +// $stringTitle = (strlen($gossip->titolo) > 53) ? htmlentities( substr( html_entity_decode( $gossip->titolo ) ,0,50) ) .'...' : $gossip->titolo; +// $stringSubTitle = (strlen($last->sottotitolo) > 23) ? htmlentities( substr( html_entity_decode( $last->sottotitolo ) ,0,20) ) .'...' : $last->sottotitolo; + $stringTitle = $professioni->cutTextHtmlSafe("titolo",50); + $stringSubTitle = $professioni->cutTextHtmlSafe("sottotitolo",20); + ?> + + +
renderMedia();?>
+ +
+
+ + +
0){ ?> diff --git a/public/mobile/index.php b/public/mobile/index.php index 31fd902..6ab5a4e 100644 --- a/public/mobile/index.php +++ b/public/mobile/index.php @@ -83,6 +83,15 @@ try { if (sizeof($foodNews)>0){ $foodNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $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) + ); + if (sizeof($professioniNews)>0){ + $professioniNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $professioniNews); + } } catch (Exception $ex){ echo $ex->getMessage(); @@ -265,6 +274,43 @@ catch (Exception $ex){ }?> +
+
"> + +
+ 0){ + $i=0; + foreach (professioniNews 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;?> + + + $