552 lines
25 KiB
PHP
552 lines
25 KiB
PHP
<?php
|
|
/*
|
|
Author: Riccardo Di Dato
|
|
Creation Date: 22/dic/2015
|
|
*/
|
|
|
|
require_once(dirname(__FILE__)."/load.php");
|
|
|
|
try {
|
|
AnalyticsHelper::logPageImpression();
|
|
|
|
$config = GlobalVariables::get("config");
|
|
$mobileLink = GUIHandlerMobile::getBaseUrl()."index.php";
|
|
|
|
$additionalHeaders = array();
|
|
$additionalHeaders[] = '<link rel="alternate" media="only screen and (max-width: 640px)" href="'.$mobileLink.'"/>';
|
|
|
|
GUIHandler::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("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);
|
|
}
|
|
|
|
|
|
|
|
$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"=>3)
|
|
);
|
|
if (sizeof($politicaNews)>0){
|
|
$politicaNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $politicaNews);
|
|
}
|
|
|
|
$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);
|
|
}
|
|
|
|
$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"=>2)
|
|
);
|
|
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.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);
|
|
}
|
|
|
|
$ristorantiNews = 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($ristorantiNews)>0){
|
|
$ristorantiNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $ristorantiNews);
|
|
}
|
|
|
|
$stats = GlobalVariables::get("dao")->aggregate(
|
|
ArticleStatsModel::class,
|
|
PipelineHelper::getMostViewedOfLastDays(strtotime("-7 days"),4)
|
|
);
|
|
$idArray = array_map(function ($ele){ return new MongoDB\BSON\ObjectID( $ele["notizia"] ); }, $stats);
|
|
|
|
$lastsNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"_id"=>array('$in'=>$idArray),"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ),'$gte'=>new MongoDB\BSON\UTCDateTime(strtotime('-2 months') * 1000 ))),
|
|
array("sort"=>array("about.lastEdit"=>-1))
|
|
);
|
|
if (sizeof($lastsNews)<4){
|
|
$missing = 5-sizeof($lastsNews);
|
|
$add = GlobalVariables::get("dao")->query("NotiziaModel",
|
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"_id"=>array('$nin'=>$idArray),"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
|
array("sort"=>array("about.lastEdit"=>-1),"limit"=>$missing)
|
|
);
|
|
$lastsNews = array_merge($lastsNews,$add);
|
|
}
|
|
if (sizeof($lastsNews)>0){
|
|
$lastsNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $lastsNews);
|
|
}
|
|
|
|
|
|
$gossipNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_GOSSIP,'_id'=>array('$nin'=>$ansaIds),
|
|
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
|
array("sort"=>array("about.lastEdit"=>-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.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
|
array("sort"=>array("about.lastEdit"=>-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
|
|
*/
|
|
// $elezioni = GlobalVariables::get("dao")->getFirst("NotiziaModel",
|
|
// array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_SPECIALE_ELEZIONI,'_id'=>array('$nin'=>$ansaIds),
|
|
// "about.data"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
|
// array("sort"=>array("about.data"=>-1))
|
|
// );
|
|
// if (!is_null($elezioni)){
|
|
// $elezioni->testo = strip_tags($elezioni->testo);
|
|
// $elezioni->sottotitolo = strip_tags($elezioni->sottotitolo);
|
|
// }
|
|
$elezioni = array();
|
|
|
|
$lastViaggi = GlobalVariables::get("dao")->query("NotiziaModel",
|
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_VIAGGI,'_id'=>array('$nin'=>$ansaIds),
|
|
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
|
array("sort"=>array("about.lastEdit"=>-1),"limit"=>2)
|
|
);
|
|
if (sizeof($lastViaggi)>0){
|
|
$lastViaggi = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $lastViaggi);
|
|
}
|
|
|
|
// if (!is_null($lastViaggi)){
|
|
// $lastViaggi->testo = strip_tags($lastViaggi->testo);
|
|
// $lastViaggi->sottotitolo = strip_tags($lastViaggi->sottotitolo);
|
|
// }
|
|
|
|
|
|
$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);
|
|
}
|
|
|
|
$saluteNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_SALUTE,'_id'=>array('$nin'=>$ansaIds),
|
|
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
|
array("sort"=>array("about.lastEdit"=>-1),"limit"=>2)
|
|
);
|
|
if (sizeof($saluteNews)>0){
|
|
$saluteNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $saluteNews);
|
|
}
|
|
|
|
// if (!is_null($saluteNews)){
|
|
// $saluteNews->testo = strip_tags($saluteNews->testo);
|
|
// $saluteNews->sottotitolo = strip_tags($saluteNews->sottotitolo);
|
|
// }
|
|
// var_dump($politicaNews);
|
|
// if(sizeof($politicaNews)<=0){
|
|
// echo "non trovateee!!!!";
|
|
// }
|
|
}
|
|
catch (Exception $ex){
|
|
echo $ex->getMessage();
|
|
}
|
|
?>
|
|
<div style="width:1000px;margin-left:auto;margin-right:auto;">
|
|
<?php
|
|
GUIHandler::generateHeadPublic();
|
|
GUIHandler::generateMenu();?>
|
|
<div class="leftBarNews">
|
|
<div class="ansaContainer" >
|
|
<?php
|
|
$i=0;
|
|
foreach($ansaNews as $ansa){
|
|
$i++;
|
|
// $stringTitolo = (strlen($ansa->titolo) > 103) ? htmlentities( substr( html_entity_decode( $ansa->titolo ) ,0,100) ).'...' : $ansa->titolo;
|
|
// $stringSottotitolo = (strlen($ansa->sottotitolo) > 73) ? htmlentities( substr( html_entity_decode( $ansa->sottotitolo ) ,0,70) ).'...' : $ansa->sottotitolo;
|
|
// $stringTesto = (strlen($ansa->testo) > 33) ? htmlentities( substr( html_entity_decode( $ansa->testo ),0,30) ).'...' : $ansa->testo;
|
|
$stringTitolo = $ansa->cutTextHtmlSafe("titolo",100);
|
|
$stringSottotitolo = $ansa->cutTextHtmlSafe("sottotitolo",70);
|
|
$stringTesto = $ansa->cutTextHtmlSafe("testo",30);
|
|
?>
|
|
<div class="ansa">
|
|
<?php
|
|
$media = DaoMediaHandler::getMainMediaFromModel($ansa);
|
|
if(!is_null($media)){
|
|
?>
|
|
<div class="ansaImage mediaContent">
|
|
<?php $media->renderMedia();?>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
<a href="<?php echo $ansa->getAbsoluteUrl();?>" id="ansa_<?php echo $i;?>" class="ansaNews">
|
|
<div class="ansaTitolo"><?php echo $stringTitolo;?></div>
|
|
<div class="ansaSottotitolo"> <?php echo $stringSottotitolo;?></div>
|
|
<div class="ansaTesto"><?php echo $stringTesto;?></div>
|
|
</a>
|
|
</div>
|
|
<div class="socialBarAnsa">
|
|
<a class="socialLink" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $ansa->getAbsoluteUrl();?>"><div style="background-image:url(images/fb_round.png);"></div></a>
|
|
<a class="socialLink" target="_blank" href="https://twitter.com/intent/tweet?via=fattidinapoli&url=<?php echo $ansa->getAbsoluteUrl();?>"><div style="background-image:url(images/twitter_round.png);"></div></a>
|
|
<a class="socialLink" target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo $ansa->getAbsoluteUrl();?>"><div style="background-image:url(images/linkedin_round.png);"></div></a>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
<div class="categoryNews">
|
|
<div class="categoryBar">
|
|
<div class="categoryTag"><span>POLITICA</span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
<div class="newsContainer">
|
|
<?php if(sizeof($politicaNews)>0){
|
|
$i=0;
|
|
foreach ($politicaNews as $politica){
|
|
$i++;
|
|
// $stringTitolo = (strlen($politica->titolo) > 53) ? htmlentities( substr( html_entity_decode( $politica->titolo ) ,0,50) ).'...' : $politica->titolo;
|
|
// $string = (strlen($politica->sottotitolo) > 33) ? htmlentities( substr( html_entity_decode( $politica->sottotitolo ) ,0,30) ).'...' : $politica->sottotitolo;
|
|
$stringTitolo = $politica->cutTextHtmlSafe("titolo",50);
|
|
$string = $politica->cutTextHtmlSafe("sottotitolo",30);
|
|
?>
|
|
<a href="<?php echo $politica->getAbsoluteUrl();?>" class="news">
|
|
<div id="politica_<?php echo $i;?>" class="newsSummary"><?php
|
|
$media = DaoMediaHandler::getMainMediaFromModel($politica);
|
|
if(!is_null($media)){?>
|
|
<div class="newsMainMedia mediaContent"><?php $media->renderMedia();?></div>
|
|
<?php }?>
|
|
<div class="newsTitle"><?php echo $stringTitolo;?></div>
|
|
<div class="newsSubTitle"><?php echo $string;?></div>
|
|
</div>
|
|
</a>
|
|
<?php }
|
|
}?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="categoryNews">
|
|
<div class="categoryBar">
|
|
<div class="categoryTag"><span>CRONACA</span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
<div class="newsContainer">
|
|
<?php if(sizeof($cronacaNews)>0){
|
|
$i=0;
|
|
foreach ($cronacaNews as $cronaca){
|
|
$i++;
|
|
// $stringTitolo = (strlen($cronaca->titolo) > 53) ? htmlentities( substr( html_entity_decode( $cronaca->titolo ) ,0, 50) ).'...' : $cronaca->titolo;
|
|
// $string = (strlen($cronaca->sottotitolo) > 33) ? htmlentities( substr( html_entity_decode($cronaca->sottotitolo ) ,0,30) ).'...' : $cronaca->sottotitolo;
|
|
$stringTitolo = $cronaca->cutTextHtmlSafe("titolo",50);
|
|
$string = $cronaca->cutTextHtmlSafe("sottotitolo",30);
|
|
?>
|
|
<a href="<?php echo $cronaca->getAbsoluteUrl();?>" class="news">
|
|
<div id="cronaca_<?php echo $i;?>" class="newsSummary"><?php
|
|
$media = DaoMediaHandler::getMainMediaFromModel($cronaca);
|
|
if(!is_null($media)){?>
|
|
<div class="newsMainMedia mediaContent"><?php $media->renderMedia();?></div>
|
|
<?php }?>
|
|
<div class="newsTitle"><?php echo $stringTitolo;?></div>
|
|
<div class="newsSubTitle"><?php echo $string;?></div>
|
|
</div>
|
|
</a>
|
|
<?php }
|
|
}?>
|
|
</div>
|
|
</div>
|
|
<div class="categoryNews">
|
|
<div class="categoryBar">
|
|
<div class="categoryTag"><span>SPORT</span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
<div class="newsContainer">
|
|
<?php if(sizeof($sportNews)>0){
|
|
$i=0;
|
|
foreach ($sportNews as $sport){
|
|
$i++;
|
|
// $stringTitolo = (strlen($sport->titolo) > 53) ? htmlentities( substr( html_entity_decode( $sport->titolo ) ,0,50) ).'...' : $sport->titolo;
|
|
// $string = (strlen($sport->sottotitolo) > 33) ? htmlentities( substr( html_entity_decode( $sport->sottotitolo ) ,0,30) ).'...' : $sport->sottotitolo;
|
|
$stringTitolo = $sport->cutTextHtmlSafe("titolo",50);
|
|
$string = $sport->cutTextHtmlSafe("sottotitolo",30);
|
|
?>
|
|
<a href="<?php echo $sport->getAbsoluteUrl();?>" class="newsSport">
|
|
<div id="sport_<?php echo $i;?>" class="sportSummary"><?php
|
|
$media = DaoMediaHandler::getMainMediaFromModel($sport);
|
|
if(!is_null($media)){?>
|
|
<div class="newsMainMedia mediaContent"><?php $media->renderMedia();?></div>
|
|
<?php }?>
|
|
<div class="newsTitle"><?php echo $stringTitolo;?></div>
|
|
<div class="newsSubTitle"><?php echo $string;?></div>
|
|
</div>
|
|
</a>
|
|
<?php }
|
|
}?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="middleBarNews">
|
|
<div class="middleBanner mediaContent"><?php BannerHelper::printBanner(BannerModel::POSITION_BODY);?></div>
|
|
<div class="titleContainer" style="margin-top:10px;">
|
|
<div class="categoryBar" style="text-align:left;">
|
|
<div class="categoryTag" style="padding-right:5px;"><span>CULTURA&SPETTACOLO</span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
</div>
|
|
<?php if(sizeof($culturaNews)>0){
|
|
$i=0;
|
|
foreach ($culturaNews as $cultura){
|
|
$i++;
|
|
// $string = (strlen($cultura->titolo) > 53) ? htmlentities( substr( html_entity_decode( $cultura->titolo ) ,0,50) ) .'...' : $cultura->titolo;
|
|
$string = $cultura->cutTextHtmlSafe("titolo",50);
|
|
?>
|
|
<a href="<?php echo $cultura->getAbsoluteUrl();?>" id="cultura_<?php echo $i;?>" class="culturaNews"><?php
|
|
$media = DaoMediaHandler::getMainMediaFromModel($cultura);
|
|
if(!is_null($media)){?>
|
|
<div class="culturaMainMedia mediaContent"><?php $media->renderMedia();?></div>
|
|
<?php }?>
|
|
<div class="culturaTitle"><?php echo $string;?></div>
|
|
</a>
|
|
<?php }
|
|
}?>
|
|
|
|
<div class="middleBanner mediaContent"><?php BannerHelper::printBanner(BannerModel::POSITION_BODY);?></div>
|
|
<div class="ristorantiCol">
|
|
<div class="categoryBar" style="text-align:left;">
|
|
<div class="categoryTag"><span>FOOD&DRINK</span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
<?php
|
|
if(sizeof($ristorantiNews)>0){
|
|
$i=0;
|
|
foreach ($ristorantiNews as $ristoranti){
|
|
$i++;
|
|
// $string = (strlen($ristoranti->titolo) > 53) ? htmlentities( substr( html_entity_decode( $ristoranti->titolo ) ,0,50) ) .'...' : $ristoranti->titolo;
|
|
$string = $ristoranti->cutTextHtmlSafe("titolo",50);
|
|
?>
|
|
<a href="<?php echo $ristoranti->getAbsoluteUrl();?>" id="ristoranti_<?php echo $i;?>" class="ristorantiBlock"><?php
|
|
$media = DaoMediaHandler::getMainMediaFromModel($ristoranti);
|
|
if(!is_null($media)){?>
|
|
<div class="culturaMainMedia mediaContent"><?php $media->renderMedia();?></div>
|
|
<?php }?>
|
|
<div class="ristorantiTitle"><?php echo $string;?></div>
|
|
</a>
|
|
<?php }
|
|
}?>
|
|
</div>
|
|
<div class="middleLongBanner mediaContent"><?php BannerHelper::printBanner(BannerModel::POSITION_LONG);?></div>
|
|
<div class="salute">
|
|
<div class="categoryBar" style="text-align:left;">
|
|
<div class="categoryTag"><span>SALUTE</span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
<?php if(sizeof($saluteNews)>0){
|
|
$i=0;
|
|
// $stringTitle = (strlen($saluteNews->titolo) > 53) ? htmlentities( substr( html_entity_decode( $saluteNews->titolo ) ,0,50) ) .'...' : $saluteNews->titolo;
|
|
foreach ($saluteNews as $salute){
|
|
$i++;
|
|
$stringTitle = $salute->cutTextHtmlSafe("titolo",50);
|
|
?>
|
|
<a href="<?php echo $salute->getAbsoluteUrl();?>" id="salute_<?php echo $i;?>" class="saluteContainer">
|
|
<?php $media = DaoMediaHandler::getMainMediaFromModel($salute);
|
|
if(!is_null($media)){?>
|
|
<div class="culturaMainMedia mediaContent"><?php $media->renderMedia();?></div>
|
|
<?php }?>
|
|
<div class="saluteTitle"><?php echo $stringTitle;?></div>
|
|
</a>
|
|
<?php }
|
|
}?>
|
|
</div>
|
|
<div class="middleLongBanner mediaContent"><?php BannerHelper::printBanner(BannerModel::POSITION_LONG);?></div>
|
|
</div>
|
|
<div class="rightBarNews">
|
|
<?php HTMLHelper::getMeteoBlock(); ?>
|
|
<!-- http://api.openweathermap.org/data/2.5/forecast?q=Naples,IT&appid=b1b15e88fa797225412429c1c50c122a&units=metric&lang=it -->
|
|
<div class="middleRightBanner mediaContent"><?php BannerHelper::printBanner(BannerModel::POSITION_BODY);?></div>
|
|
<div class="lastNews">
|
|
<div class="categoryBar" style="text-align:left;">
|
|
<div class="categoryTag"><span>Più Letti</span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
<?php if(sizeof($lastsNews)>0){
|
|
$i=0;
|
|
foreach($lastsNews as $last){
|
|
$i++;
|
|
$data = $mesi[date("n",$last->about->data->toDateTime()->getTimestamp())]." ".date("Y",$last->about->data->toDateTime()->getTimestamp());
|
|
$string = (strlen($last->titolo) > 103) ? substr($last->titolo,0,100).'...' : $last->titolo;?>
|
|
<a href="<?php echo $last->getAbsoluteUrl();?>" id="last_<?php echo $i;?>" class="lastContainer">
|
|
<div class="lastData"><?php echo $data;?></div>
|
|
<div class="lastTitle"><?php echo $string;?></div>
|
|
</a>
|
|
<?php }
|
|
}?>
|
|
</div>
|
|
<div class="middleRightBanner mediaContent"><?php BannerHelper::printBanner(BannerModel::POSITION_BODY);?></div>
|
|
<div class="lastGossip">
|
|
<div class="categoryBar" style="text-align:left;">
|
|
<div class="categoryTag"><span>GOSSIP</span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
<?php if(sizeof($gossipNews)>0){
|
|
$i = 0;
|
|
foreach($gossipNews as $gossip){
|
|
$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 = $gossip->cutTextHtmlSafe("titolo",50);
|
|
$stringSubTitle = $gossip->cutTextHtmlSafe("sottotitolo",20);
|
|
?>
|
|
<a href="<?php echo $gossip->getAbsoluteUrl();?>" id="gossip_<?php echo $i;?>"class="gossipContainer">
|
|
<?php $media = DaoMediaHandler::getMainMediaFromModel($gossip);
|
|
if(!is_null($media)){?>
|
|
<div class="culturaMainMedia mediaContent"><?php $media->renderMedia();?></div>
|
|
<?php }?>
|
|
<div class="gossipTitle"><?php echo $stringTitle;?></div>
|
|
</a>
|
|
<?php }
|
|
}?>
|
|
|
|
</div>
|
|
<div class="lastGossip">
|
|
<div class="categoryBar" style="text-align:left;">
|
|
<div class="categoryTag" style="padding-right:5px;"><span><?php echo NotiziaModel::$NOTIZIE_CATEGORY[NotiziaModel::CATEGORY_MESTIERI]["label"]; ?></span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
<?php if(sizeof($professioniNews)>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);
|
|
?>
|
|
<a href="<?php echo $professioni->getAbsoluteUrl();?>" id="gossip_<?php echo $i;?>"class="gossipContainer">
|
|
<?php $media = DaoMediaHandler::getMainMediaFromModel($professioni);
|
|
if(!is_null($media)){?>
|
|
<div class="culturaMainMedia mediaContent"><?php $media->renderMedia();?></div>
|
|
<?php }?>
|
|
<div class="gossipTitle"><?php echo $stringTitle;?></div>
|
|
</a>
|
|
<?php }
|
|
}?>
|
|
|
|
</div>
|
|
<div class="middleRightLongBanner mediaContent"><?php BannerHelper::printBanner(BannerModel::POSITION_LONG);?></div>
|
|
<?php
|
|
if(sizeof($elezioni)>0){
|
|
?>
|
|
<div class="lastViaggi">
|
|
<div class="categoryBar" style="text-align:left;">
|
|
<div class="categoryTag"><span>SPECIALE ELEZIONI</span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
<?php if(!is_null($elezioni)){
|
|
$stringTitle = (strlen($elezioni->titolo) > 53) ? htmlentities( substr( html_entity_decode( $elezioni->titolo ) ,0,50) ) .'...' : $elezioni->titolo;
|
|
$stringTitle = $elezioni->cutTextHtmlSafe("titolo",50);
|
|
?>
|
|
<a href="<?php echo $elezioni->getAbsoluteUrl();?>" class="animaliContainer">
|
|
<?php $media = DaoMediaHandler::getMainMediaFromModel($elezioni);
|
|
if(!is_null($media)){?>
|
|
<div class="culturaMainMedia mediaContent"><?php $media->renderMedia();?></div>
|
|
<?php }?>
|
|
<div class="viaggiTitle"><?php echo $stringTitle;?></div>
|
|
</a>
|
|
<?php }?>
|
|
</div>
|
|
<?php
|
|
}
|
|
else{
|
|
?>
|
|
<div class="lastViaggi">
|
|
<div class="categoryBar" style="text-align:left;">
|
|
<div class="categoryTag"><span>VIAGGI</span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
<?php if(sizeof($lastViaggi)>0){
|
|
$i=0;
|
|
// $stringTitle = (strlen($lastViaggi->titolo) > 53) ? htmlentities( substr( html_entity_decode( $lastViaggi->titolo ) ,0,50) ) .'...' : $lastViaggi->titolo;
|
|
foreach ($lastViaggi as $viaggi){
|
|
$stringTitle = $viaggi->cutTextHtmlSafe("titolo",50);
|
|
?>
|
|
<a href="<?php echo $viaggi->getAbsoluteUrl();?>" id="viaggi_<?php echo $i;?>"class="animaliContainer">
|
|
<?php $media = DaoMediaHandler::getMainMediaFromModel($viaggi);
|
|
if(!is_null($media)){?>
|
|
<div class="culturaMainMedia mediaContent"><?php $media->renderMedia();?></div>
|
|
<?php }?>
|
|
<div class="viaggiTitle"><?php echo $stringTitle;?></div>
|
|
</a>
|
|
<?php }
|
|
}?>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
<div class="animali">
|
|
<div class="categoryBar" style="text-align:left;">
|
|
<div class="categoryTag"><span>MONDO SPOSI</span></div>
|
|
<div class="categoryLine"></div>
|
|
</div>
|
|
<?php if(!is_null($animalNews)){
|
|
// $stringTitle = (strlen($animalNews->titolo) > 53) ? htmlentities( substr( html_entity_decode( $animalNews->titolo ) ,0,50) ) .'...' : $animalNews->titolo;
|
|
$stringTitle = $animalNews->cutTextHtmlSafe("titolo",50);
|
|
?>
|
|
<a href="<?php echo $animalNews->getAbsoluteUrl();?>" class="animaliContainer">
|
|
<?php $media = DaoMediaHandler::getMainMediaFromModel($animalNews);
|
|
if(!is_null($media)){?>
|
|
<div class="culturaMainMedia mediaContent"><?php $media->renderMedia();?></div>
|
|
<?php }?>
|
|
<div class="animaliTitle"><?php echo $stringTitle;?></div>
|
|
</a>
|
|
<?php }?>
|
|
</div>
|
|
<div class="middleRightLongBanner mediaContent"><?php BannerHelper::printBanner(BannerModel::POSITION_LONG);?></div>
|
|
</div>
|
|
<?php
|
|
GUIHandler::generateFooter();
|
|
GUIHandler::generateGoogleAnalyticsScripts();
|
|
?>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
$("video").on('loadstart',function (event){
|
|
$(this).addClass("loading");
|
|
});
|
|
|
|
$("video").on('canplay',function (event){
|
|
$(this).removeClass("loading");
|
|
$(this).attr('poster','');
|
|
});
|
|
});
|
|
</script>
|