Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ed3a2bf3c | ||
|
|
3b12ce1786 | ||
|
|
6c3acfe5e9 | ||
|
|
93bb9b2610 |
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
class SimpleConfigHelper {
|
||||||
|
|
||||||
|
private Memcached $memcached;
|
||||||
|
private GenericDao $dao;
|
||||||
|
|
||||||
|
private stdClass $config;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->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 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -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/BannerStatsModel.php");
|
||||||
require_once(dirname(__FILE__)."/models/stats/PageViewStatsModel.php");
|
require_once(dirname(__FILE__)."/models/stats/PageViewStatsModel.php");
|
||||||
|
|
||||||
|
require_once(dirname(__FILE__)."/models/SimpleConfig.php");
|
||||||
|
|
||||||
$dao = new GenericDao($database->dbName,$database->connectionString);
|
$dao = new GenericDao($database->dbName,$database->connectionString);
|
||||||
GlobalVariables::set("dao", $dao);
|
GlobalVariables::set("dao", $dao);
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ class NotiziaModel extends HasMediaModel implements DaoSearchable{
|
|||||||
|
|
||||||
const CATEGORY_MONDO_SPOSI = 19;
|
const CATEGORY_MONDO_SPOSI = 19;
|
||||||
|
|
||||||
|
const CATEGORY_VARIE = 99;
|
||||||
|
|
||||||
public static $NOTIZIE_CATEGORY = array(
|
public static $NOTIZIE_CATEGORY = array(
|
||||||
self::CATEGORY_POLITICA=>array("label"=>"Politica","mainMenu"=>true,"hidden"=>false,"pages"=>array("list"=>"politica.php"),"color"=>"#3e3e3e","isSubmenu"=>null),
|
self::CATEGORY_POLITICA=>array("label"=>"Politica","mainMenu"=>true,"hidden"=>false,"pages"=>array("list"=>"politica.php"),"color"=>"#3e3e3e","isSubmenu"=>null),
|
||||||
self::CATEGORY_CRONACA=>array("label"=>"Cronaca","mainMenu"=>true, "hidden"=>false,"pages"=>array("list"=>"cronaca.php"),"color"=>"red","isSubmenu"=>null),
|
self::CATEGORY_CRONACA=>array("label"=>"Cronaca","mainMenu"=>true, "hidden"=>false,"pages"=>array("list"=>"cronaca.php"),"color"=>"red","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_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_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){
|
public function __construct($saveableObject = null){
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
Author: Riccardo Di Dato
|
||||||
|
Creation Date: 13/gen/2016
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
class SimpleConfig extends Model {
|
||||||
|
const VARIE_LABEL = "varie_home_label";
|
||||||
|
|
||||||
|
|
||||||
|
public function __construct($saveableObject = null) {
|
||||||
|
parent::__construct($saveableObject);
|
||||||
|
if (!$this->hasProperty("data") || !is_object($this->details)) {
|
||||||
|
$this->details = new stdClass();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getCollectionName(){
|
||||||
|
return "simpleConfig";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -48,6 +48,8 @@ class MenuGenerator {
|
|||||||
array("label"=>"Logs","page"=>"logs.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"=>"Guida","page"=>"index.php"),
|
||||||
|
|
||||||
array("label"=>"Logout","page"=>"logout.php")
|
array("label"=>"Logout","page"=>"logout.php")
|
||||||
|
|||||||
@@ -48,5 +48,8 @@ require_once(dirname(__FILE__)."/BannerHelper.php");
|
|||||||
|
|
||||||
require_once(dirname(__FILE__)."/RSSHelper.php");
|
require_once(dirname(__FILE__)."/RSSHelper.php");
|
||||||
|
|
||||||
|
require_once(dirname(__FILE__)."/SimpleConfigHelper.php");
|
||||||
|
|
||||||
|
GlobalVariables::set("cfg", new SimpleConfigHelper());
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
Author: Riccardo Di Dato
|
||||||
|
Creation Date: 25/gen/2016
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
require_once(dirname(__FILE__)."/../load.php");
|
||||||
|
|
||||||
|
GUIHandler::generateHtmlHeaders(array(),true);
|
||||||
|
|
||||||
|
if (!AdminLoginManager::isLogged()){
|
||||||
|
GUIHandler::redirect("admin/login.php");
|
||||||
|
}
|
||||||
|
else if (!AdminLoginManager::getLogged()->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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div>
|
||||||
|
<?php
|
||||||
|
if ($saved){
|
||||||
|
echo '<div style="color:green;">Dati salvati con successo</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<form id="taskForm" method="POST" action="">
|
||||||
|
<input type="hidden" name="action" value="" />
|
||||||
|
<div><span class="label"> </span><b>Tasks</b></div>
|
||||||
|
<?php
|
||||||
|
printf(
|
||||||
|
'<div><span class="label">Varie (home)</span><input type="text" name="%s" value="%s" /><br/>',
|
||||||
|
SimpleConfig::VARIE_LABEL,
|
||||||
|
GlobalVariables::get("cfg")->hasValue(SimpleConfig::VARIE_LABEL) ? GlobalVariables::get("cfg")->getValue(SimpleConfig::VARIE_LABEL) : ""
|
||||||
|
)
|
||||||
|
?>
|
||||||
|
</form>
|
||||||
|
<div class="formBtns">
|
||||||
|
<a href="#" id="taskForm_salva" >Salva</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(event){
|
||||||
|
$("#taskForm_salva").click(function(event){
|
||||||
|
$("form#taskForm input[type=hidden][name=action]").val("save");
|
||||||
|
$("form#taskForm").submit();
|
||||||
|
});
|
||||||
|
$("#taskForm_annulla").click(function(event){
|
||||||
|
$("form#taskForm input[type=hidden][name=action]").val("cancel");
|
||||||
|
$("form#taskForm").submit();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -134,13 +134,20 @@ GUIHandler::generateHtmlHeaders(array("additionalMetadata"=>$additionalHeaders,"
|
|||||||
<div style="width:1000px;margin-left:auto;margin-right:auto;" itemscope itemtype="http://schema.org/Article">
|
<div style="width:1000px;margin-left:auto;margin-right:auto;" itemscope itemtype="http://schema.org/Article">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$categoryName = NotiziaModel::$NOTIZIE_CATEGORY[$articolo->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::generateHeadPublic();
|
||||||
GUIHandler::generateMenu();
|
GUIHandler::generateMenu();
|
||||||
?>
|
?>
|
||||||
<div class="articoloCategory">
|
<div class="articoloCategory">
|
||||||
<div class="categoryStyle">
|
<div class="categoryStyle">
|
||||||
<div class="icon"><img alt="" src="images/categoryIcon.png"></div>
|
<div class="icon"><img alt="" src="images/categoryIcon.png"></div>
|
||||||
<div class="articoloCategoryName" style="background-color:<?php echo NotiziaModel::$NOTIZIE_CATEGORY[$articolo->category]["color"] ?>"><span itemprop="articleSection"><?php echo strtoupper(NotiziaModel::$NOTIZIE_CATEGORY[$articolo->category]["label"]);?></span></div>
|
<div class="articoloCategoryName" style="background-color:<?php echo NotiziaModel::$NOTIZIE_CATEGORY[$articolo->category]["color"] ?>"><span itemprop="articleSection"><?php echo strtoupper($categoryName);?></span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="articoloContainer" >
|
<div class="articoloContainer" >
|
||||||
@@ -165,7 +172,7 @@ GUIHandler::generateHtmlHeaders(array("additionalMetadata"=>$additionalHeaders,"
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="articoloTitle">
|
<div class="articoloTitle">
|
||||||
<div class="title" itemprop="name"><?php echo htmlentities($articolo->titolo);?></div>
|
<h1 class="title" itemprop="name"><?php echo htmlentities($articolo->titolo);?></h1>
|
||||||
<div class="subTitle">
|
<div class="subTitle">
|
||||||
<span><?php echo $data;?> —</span>
|
<span><?php echo $data;?> —</span>
|
||||||
<span itemprop="headline"><?php echo $articolo->sottotitolo;?></span>
|
<span itemprop="headline"><?php echo $articolo->sottotitolo;?></span>
|
||||||
|
|||||||
+37
-26
@@ -154,15 +154,27 @@ try {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
$animalNews = GlobalVariables::get("dao")->getFirst("NotiziaModel",
|
$varie = GlobalVariables::get("dao")->query(
|
||||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_MONDO_SPOSI,'_id'=>array('$nin'=>$ansaIds),
|
NotiziaModel::class,
|
||||||
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
[
|
||||||
array("sort"=>array("about.lastEdit"=>-1))
|
"status"=>NotiziaModel::STATUS_ACCEPTED,
|
||||||
);
|
"category"=>NotiziaModel::CATEGORY_VARIE,
|
||||||
if (!is_null($animalNews)){
|
'_id'=> [ '$nin'=>$ansaIds ],
|
||||||
$animalNews->testo = strip_tags($animalNews->testo);
|
"about.lastEdit" => [ '$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ) ]
|
||||||
$animalNews->sottotitolo = strip_tags($animalNews->sottotitolo);
|
]
|
||||||
}
|
);
|
||||||
|
$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",
|
$saluteNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_SALUTE,'_id'=>array('$nin'=>$ansaIds),
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_SALUTE,'_id'=>array('$nin'=>$ansaIds),
|
||||||
@@ -467,7 +479,7 @@ catch (Exception $ex){
|
|||||||
<?php
|
<?php
|
||||||
if(sizeof($elezioni)>0){
|
if(sizeof($elezioni)>0){
|
||||||
?>
|
?>
|
||||||
<div class="lastViaggi">
|
<div class="rightCategory">
|
||||||
<div class="categoryBar" style="text-align:left;">
|
<div class="categoryBar" style="text-align:left;">
|
||||||
<div class="categoryTag"><span>SPECIALE ELEZIONI</span></div>
|
<div class="categoryTag"><span>SPECIALE ELEZIONI</span></div>
|
||||||
<div class="categoryLine"></div>
|
<div class="categoryLine"></div>
|
||||||
@@ -489,7 +501,7 @@ catch (Exception $ex){
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
?>
|
?>
|
||||||
<div class="lastViaggi">
|
<div class="rightCategory">
|
||||||
<div class="categoryBar" style="text-align:left;">
|
<div class="categoryBar" style="text-align:left;">
|
||||||
<div class="categoryTag"><span>VIAGGI</span></div>
|
<div class="categoryTag"><span>VIAGGI</span></div>
|
||||||
<div class="categoryLine"></div>
|
<div class="categoryLine"></div>
|
||||||
@@ -513,23 +525,22 @@ catch (Exception $ex){
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="animali">
|
<div class="rightCategory">
|
||||||
<div class="categoryBar" style="text-align:left;">
|
<div class="categoryBar" style="text-align:left;" >
|
||||||
<div class="categoryTag"><span>MONDO SPOSI</span></div>
|
<div class="categoryTag"><span><?php echo strtoupper($varieName); ?></span></div>
|
||||||
<div class="categoryLine"></div>
|
<div class="categoryLine"></div>
|
||||||
</div>
|
</div>
|
||||||
<?php if(!is_null($animalNews)){
|
<?php
|
||||||
// $stringTitle = (strlen($animalNews->titolo) > 53) ? htmlentities( substr( html_entity_decode( $animalNews->titolo ) ,0,50) ) .'...' : $animalNews->titolo;
|
foreach ($varie as $model) {
|
||||||
$stringTitle = $animalNews->cutTextHtmlSafe("titolo",50);
|
$media = DaoMediaHandler::hasMainMedia($model) ? DaoMediaHandler::getMainMediaFromModel($model) : null;
|
||||||
?>
|
printf(
|
||||||
<a href="<?php echo $animalNews->getAbsoluteUrl();?>" class="animaliContainer">
|
'<a href="%s" class=""><div class="mediaContent">%s</div><div class="rightColumnTitle" >%s</div></a>',
|
||||||
<?php $media = DaoMediaHandler::getMainMediaFromModel($animalNews);
|
$model->getAbsoluteUrl(),
|
||||||
if(!is_null($media)){?>
|
is_null($media) ? "" : $media->asText(['size' => MediaImage::SIZE_MEDIUM]),
|
||||||
<div class="culturaMainMedia mediaContent"><?php $media->renderMedia(['size' => MediaImage::SIZE_MEDIUM]);?></div>
|
$model->cutTextHtmlSafe("titolo",50)
|
||||||
<?php }?>
|
);
|
||||||
<div class="animaliTitle"><?php echo $stringTitle;?></div>
|
}
|
||||||
</a>
|
?>
|
||||||
<?php }?>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="middleRightLongBanner mediaContent"><?php BannerHelper::printBanner(BannerModel::POSITION_LONG);?></div>
|
<div class="middleRightLongBanner mediaContent"><?php BannerHelper::printBanner(BannerModel::POSITION_LONG);?></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -66,5 +66,5 @@ function resortGroup(group) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function compareEle(a, b) {
|
function compareEle(a, b) {
|
||||||
return a.views >= b.views;
|
return a.views - b.views;
|
||||||
}
|
}
|
||||||
@@ -128,6 +128,13 @@ GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHea
|
|||||||
<div style="margin-top:32vw;width:100vw;margin-left:auto;margin-right:auto;" itemscope itemtype="http://schema.org/Article">
|
<div style="margin-top:32vw;width:100vw;margin-left:auto;margin-right:auto;" itemscope itemtype="http://schema.org/Article">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$categoryName = NotiziaModel::$NOTIZIE_CATEGORY[$articolo->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::generateHeadPublic();
|
||||||
GUIHandlerMobile::generateMenu();
|
GUIHandlerMobile::generateMenu();
|
||||||
?>
|
?>
|
||||||
@@ -141,7 +148,7 @@ GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHea
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="articoloCategoryName" style="color:white;background-color:<?php echo NotiziaModel::$NOTIZIE_CATEGORY[$articolo->category]["color"] ?>;">
|
<div class="articoloCategoryName" style="color:white;background-color:<?php echo NotiziaModel::$NOTIZIE_CATEGORY[$articolo->category]["color"] ?>;">
|
||||||
<span itemprop="articleSection"><?php echo strtoupper(NotiziaModel::$NOTIZIE_CATEGORY[$articolo->category]["label"]);?></span>
|
<span itemprop="articleSection"><?php echo strtoupper($categoryName);?></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="headArticolo">
|
<div class="headArticolo">
|
||||||
<div class="newsImage" >
|
<div class="newsImage" >
|
||||||
@@ -191,7 +198,7 @@ GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHea
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="articoloTitle">
|
<div class="articoloTitle">
|
||||||
<p class="title" itemprop="name"><?php echo htmlentities($articolo->titolo);?></p>
|
<h1 class="title" itemprop="name"><?php echo htmlentities($articolo->titolo);?></h1>
|
||||||
<p class="subTitle">
|
<p class="subTitle">
|
||||||
<span><?php echo $data;?> —</span>
|
<span><?php echo $data;?> —</span>
|
||||||
<span itemprop="headline"><?php echo $articolo->sottotitolo;?></span>
|
<span itemprop="headline"><?php echo $articolo->sottotitolo;?></span>
|
||||||
|
|||||||
+64
-78
@@ -6,9 +6,13 @@ Creation Date: 22/dic/2015
|
|||||||
|
|
||||||
require_once(dirname(__FILE__)."/../load.php");
|
require_once(dirname(__FILE__)."/../load.php");
|
||||||
|
|
||||||
try {
|
function stripModelText($model) {
|
||||||
// AnalyticsHelper::logPageImpression();
|
$model->testo = strip_tags($model->testo);
|
||||||
|
$model->sottotitolo = strip_tags($model->sottotitolo);
|
||||||
|
return $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
$config = GlobalVariables::get("config");
|
$config = GlobalVariables::get("config");
|
||||||
$directLink = $config->pages->remoteLocationPath."index.php";
|
$directLink = $config->pages->remoteLocationPath."index.php";
|
||||||
|
|
||||||
@@ -17,122 +21,107 @@ try {
|
|||||||
|
|
||||||
GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHeaders));
|
GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHeaders));
|
||||||
|
|
||||||
// echo "OK";
|
|
||||||
|
|
||||||
// var_dump(date("n"));
|
|
||||||
$mesi = array(1=>'Gennaio', 'Febbraio', 'Marzo', 'Aprile',
|
$mesi = array(1=>'Gennaio', 'Febbraio', 'Marzo', 'Aprile',
|
||||||
'Maggio', 'Giugno', 'Luglio', 'Agosto',
|
'Maggio', 'Giugno', 'Luglio', 'Agosto',
|
||||||
'Settembre', 'Ottobre', 'Novembre','Dicembre');
|
'Settembre', 'Ottobre', 'Novembre','Dicembre');
|
||||||
// $day = date("d");
|
|
||||||
$pageSelected="home";
|
$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",
|
$ansaNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||||
array("isAnsa"=>true,"status"=>NotiziaModel::STATUS_ACCEPTED,"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
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));
|
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",
|
$politicaNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_POLITICA,'_id'=>array('$nin'=>$ansaIds),
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_POLITICA,'_id'=>array('$nin'=>$ansaIds),
|
||||||
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
||||||
array("sort"=>array("about.lastEdit"=>-1),"limit"=>4)
|
array("sort"=>array("about.lastEdit"=>-1),"limit"=>4)
|
||||||
);
|
);
|
||||||
if (sizeof($politicaNews)>0){
|
$politicaNews = array_map(
|
||||||
$politicaNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $politicaNews);
|
'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",
|
$cronacaNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_CRONACA,'_id'=>array('$nin'=>$ansaIds),
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_CRONACA,'_id'=>array('$nin'=>$ansaIds),
|
||||||
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
||||||
array("sort"=>array("about.lastEdit"=>-1),"limit"=>6)
|
array("sort"=>array("about.lastEdit"=>-1),"limit"=>6)
|
||||||
);
|
);
|
||||||
if (sizeof($cronacaNews)>0){
|
$cronacaNews = array_map(
|
||||||
$cronacaNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $cronacaNews);
|
'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",
|
$sportNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_SPORT,'_id'=>array('$nin'=>$ansaIds),
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_SPORT,'_id'=>array('$nin'=>$ansaIds),
|
||||||
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
||||||
array("sort"=>array("about.lastEdit"=>-1),"limit"=>4)
|
array("sort"=>array("about.lastEdit"=>-1),"limit"=>4)
|
||||||
);
|
);
|
||||||
if (sizeof($sportNews)>0){
|
$sportNews = array_map(
|
||||||
$sportNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $sportNews);
|
'stripModelText',
|
||||||
}
|
$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)
|
|
||||||
// );
|
|
||||||
$culturaNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
$culturaNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_CULTURA,'_id'=>array('$nin'=>$ansaIds),
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_CULTURA,'_id'=>array('$nin'=>$ansaIds),
|
||||||
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
||||||
array("sort"=>array("about.lastEdit"=>-1),"limit"=>4)
|
array("sort"=>array("about.lastEdit"=>-1),"limit"=>4)
|
||||||
);
|
);
|
||||||
if (sizeof($culturaNews)>0){
|
$culturaNews = array_map(
|
||||||
$culturaNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $culturaNews);
|
'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",
|
$foodNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_RISTORANTI,'_id'=>array('$nin'=>$ansaIds),
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_RISTORANTI,'_id'=>array('$nin'=>$ansaIds),
|
||||||
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
||||||
array("sort"=>array("about.lastEdit"=>-1),"limit"=>4)
|
array("sort"=>array("about.lastEdit"=>-1),"limit"=>4)
|
||||||
);
|
);
|
||||||
if (sizeof($foodNews)>0){
|
$foodNews = array_map(
|
||||||
$foodNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $foodNews);
|
'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",
|
$professioniNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_MESTIERI,'_id'=>array('$nin'=>$ansaIds),
|
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_MESTIERI,'_id'=>array('$nin'=>$ansaIds),
|
||||||
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
||||||
array("sort"=>array("about.lastEdit"=>-1),"limit"=>4)
|
array("sort"=>array("about.lastEdit"=>-1),"limit"=>4)
|
||||||
);
|
);
|
||||||
if (sizeof($professioniNews)>0){
|
$professioniNews = array_map(
|
||||||
$professioniNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $professioniNews);
|
'stripModelText',
|
||||||
}
|
$professioniNews
|
||||||
|
);
|
||||||
|
|
||||||
$mondoSposiNews = GlobalVariables::get("dao")->query("NotiziaModel",
|
$varie = GlobalVariables::get("dao")->query(
|
||||||
array("status"=>NotiziaModel::STATUS_ACCEPTED,"category"=>NotiziaModel::CATEGORY_MONDO_SPOSI,'_id'=>array('$nin'=>$ansaIds),
|
NotiziaModel::class,
|
||||||
"about.lastEdit"=>array('$lte'=>new MongoDB\BSON\UTCDateTime( time() * 1000 ))),
|
[
|
||||||
array("sort"=>array("about.lastEdit"=>-1),"limit"=>4)
|
"status"=>NotiziaModel::STATUS_ACCEPTED,
|
||||||
);
|
"category"=>NotiziaModel::CATEGORY_VARIE,
|
||||||
if (sizeof($mondoSposiNews)>0){
|
'_id'=> [ '$nin'=>$ansaIds ],
|
||||||
$mondoSposiNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $mondoSposiNews);
|
"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){
|
catch (Exception $ex){
|
||||||
echo $ex->getMessage();
|
echo $ex->getMessage();
|
||||||
@@ -152,8 +141,7 @@ catch (Exception $ex){
|
|||||||
<?php $i=0; foreach($ansaNews as $ansa){
|
<?php $i=0; foreach($ansaNews as $ansa){
|
||||||
$i++;
|
$i++;
|
||||||
$stringTitolo = (strlen($ansa->titolo) > 103) ? htmlentities ( substr( html_entity_decode( $ansa->titolo ),0,100) ) .'...' : $ansa->titolo;
|
$stringTitolo = (strlen($ansa->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;?>
|
|
||||||
<div class="primaryNews">
|
<div class="primaryNews">
|
||||||
<a href="articolo.php?id=<?php echo $ansa->id;?>" id="ansa_<?php echo $i;?>" class="ansaNews"><?php
|
<a href="articolo.php?id=<?php echo $ansa->id;?>" id="ansa_<?php echo $i;?>" class="ansaNews"><?php
|
||||||
$media = DaoMediaHandler::getMainMediaFromModel($ansa);
|
$media = DaoMediaHandler::getMainMediaFromModel($ansa);
|
||||||
@@ -358,12 +346,12 @@ catch (Exception $ex){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="newsContainer">
|
<div class="newsContainer">
|
||||||
<div class="categoryBar" style="background-color:<?php echo NotiziaModel::$NOTIZIE_CATEGORY[NotiziaModel::CATEGORY_MONDO_SPOSI]["color"] ?>">
|
<div class="categoryBar" style="background-color: <?php echo NotiziaModel::$NOTIZIE_CATEGORY[NotiziaModel::CATEGORY_VARIE]["color"] ?>">
|
||||||
<span><?php echo NotiziaModel::$NOTIZIE_CATEGORY[NotiziaModel::CATEGORY_MONDO_SPOSI]["label"] ?></span>
|
<span><?php echo strtoupper($varieName); ?></span>
|
||||||
</div>
|
</div>
|
||||||
<?php if(sizeof($mondoSposiNews)>0){
|
<?php if(sizeof($varie)>0){
|
||||||
$i=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;
|
$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;?>
|
// $string = (strlen($politica->sottotitolo) > 33) ? substr($politica->sottotitolo,0,30).'...' : $politica->sottotitolo;?>
|
||||||
@@ -430,8 +418,6 @@ catch (Exception $ex){
|
|||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$(".newsBarMobile").css({"margin-top":$(".headContainer").outerHeight()});
|
|
||||||
|
|
||||||
$("img.poster").hide();
|
$("img.poster").hide();
|
||||||
$("video.localVideo").attr("style","");
|
$("video.localVideo").attr("style","");
|
||||||
|
|
||||||
|
|||||||
@@ -4,29 +4,6 @@ Author: Riccardo Di Dato
|
|||||||
Creation Date: 02/mar/2016
|
Creation Date: 02/mar/2016
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(dirname(__FILE__)."/../../load.php");
|
include(dirname(__FILE__)."/../../stats/bannerClick.php");
|
||||||
|
|
||||||
try {
|
|
||||||
if (array_key_exists("HTTP_REFERER",$_SERVER)){
|
|
||||||
$host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
|
|
||||||
|
|
||||||
if (strcmp($host,$_SERVER["SERVER_NAME"])==0){
|
|
||||||
$banner = PostHandler::get("banner");
|
|
||||||
$source = PostHandler::get("source");
|
|
||||||
if (!is_null($banner) && !is_null($source)){
|
|
||||||
AnalyticsHelper::saveBannerClick($banner, $source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from referer '".$host."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from null referer. Related ip '".$_SERVER['REMOTE_ADDR']."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception $ex){
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Error while logging statistical data. Message: '".$ex->getMessage()."'");
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -4,30 +4,6 @@ Author: Riccardo Di Dato
|
|||||||
Creation Date: 02/mar/2016
|
Creation Date: 02/mar/2016
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(dirname(__FILE__)."/../../load.php");
|
include(dirname(__FILE__)."/../../stats/bannerImpression.php");
|
||||||
|
|
||||||
try {
|
|
||||||
if (array_key_exists("HTTP_REFERER",$_SERVER)){
|
|
||||||
$host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
|
|
||||||
|
|
||||||
if (strcmp($host,$_SERVER["SERVER_NAME"])==0){
|
|
||||||
$ip = PostHandler::get("ip");
|
|
||||||
$banner = PostHandler::get("banner");
|
|
||||||
$source = PostHandler::get("source");
|
|
||||||
if (!is_null($ip) && !is_null($banner) && !is_null($source)){
|
|
||||||
AnalyticsHelper::saveBannerImpression($ip, $banner, $source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from referer '".$host."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from null referer. Related ip '".$_SERVER['REMOTE_ADDR']."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception $ex){
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Error while logging statistical data. Message: '".$ex->getMessage()."'");
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
Author: Riccardo Di Dato
|
||||||
|
Creation Date: 02/mar/2016
|
||||||
|
*/
|
||||||
|
|
||||||
|
include(dirname(__FILE__)."/../../stats/bannerMultiImpression.php");
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -3,31 +3,6 @@
|
|||||||
Author: Riccardo Di Dato
|
Author: Riccardo Di Dato
|
||||||
Creation Date: 28/gen/2016
|
Creation Date: 28/gen/2016
|
||||||
*/
|
*/
|
||||||
|
include(dirname(__FILE__)."/../../stats/notiziaImpression.php");
|
||||||
require_once(dirname(__FILE__)."/../../load.php");
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (array_key_exists("HTTP_REFERER",$_SERVER)){
|
|
||||||
$host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
|
|
||||||
|
|
||||||
if (strcmp($host,$_SERVER["SERVER_NAME"])==0){
|
|
||||||
$ip = PostHandler::get("ip");
|
|
||||||
$notizia = PostHandler::get("notizia");
|
|
||||||
$source = PostHandler::get("source");
|
|
||||||
if (!is_null($ip) && !is_null($notizia) && !is_null($source)){
|
|
||||||
AnalyticsHelper::saveNotiziaImpression($ip, $notizia, $source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from referer '".$host."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from null referer. Related ip '".$_SERVER['REMOTE_ADDR']."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception $ex){
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Error while logging statistical data. Message: '".$ex->getMessage()."'");
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -4,30 +4,6 @@ Author: Riccardo Di Dato
|
|||||||
Creation Date: 27/gen/2016
|
Creation Date: 27/gen/2016
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(dirname(__FILE__)."/../../load.php");
|
include(dirname(__FILE__)."/../../stats/pageImpression.php");
|
||||||
|
|
||||||
try {
|
|
||||||
if (array_key_exists("HTTP_REFERER",$_SERVER)){
|
|
||||||
$host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
|
|
||||||
|
|
||||||
if (strcmp($host,$_SERVER["SERVER_NAME"])==0){
|
|
||||||
$ip = PostHandler::get("ip");
|
|
||||||
$content = PostHandler::get("content");
|
|
||||||
$source = PostHandler::get("source");
|
|
||||||
if (!is_null($ip) && !is_null($content) && !is_null($source)){
|
|
||||||
AnalyticsHelper::savePageImpression($ip, $content, $source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from referer '".$host."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Dropped statistical data coming from null referer. Related ip '".$_SERVER['REMOTE_ADDR']."'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception $ex){
|
|
||||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_INFO,"Error while logging statistical data. Message: '".$ex->getMessage()."'");
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -4,7 +4,7 @@ a{text-decoration:none;}
|
|||||||
body{font-family:lato, arial;}
|
body{font-family:lato, arial;}
|
||||||
|
|
||||||
/* TOP HEAD BAR/Menu/Footer (GUIHandler)*/
|
/* TOP HEAD BAR/Menu/Footer (GUIHandler)*/
|
||||||
.headContainer{position:fixed;background-color:white;width:100vw;top:0;left:0;z-index:10;overflow:hidden;}
|
.headContainer{position:sticky;background-color:white;width:100vw;top:0;left:0;z-index:10;overflow:hidden;}
|
||||||
.upperBar{text-align:center;border:1px solid #949494;border-left:0px;border-right:0px;margin:5px 0;padding:2px;font-size:8pt;color:#949494;}
|
.upperBar{text-align:center;border:1px solid #949494;border-left:0px;border-right:0px;margin:5px 0;padding:2px;font-size:8pt;color:#949494;}
|
||||||
.logo{text-align:center;}
|
.logo{text-align:center;}
|
||||||
.logo img{width:50vw;margin:auto;}
|
.logo img{width:50vw;margin:auto;}
|
||||||
@@ -102,7 +102,7 @@ body{font-family:lato, arial;}
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.newsBarMobile{margin-top:32vw;width:100vw;}
|
.newsBarMobile{width:100vw;}
|
||||||
.newsContainer{width:100vw;}
|
.newsContainer{width:100vw;}
|
||||||
.newsContainer .categoryBar{padding:5px 10px;}
|
.newsContainer .categoryBar{padding:5px 10px;}
|
||||||
.newsContainer .categoryBar > span{color:white;font-weight:bold;font-size:14pt;}
|
.newsContainer .categoryBar > span{color:white;font-weight:bold;font-size:14pt;}
|
||||||
@@ -154,7 +154,7 @@ body{font-family:lato, arial;}
|
|||||||
.headArticolo .newsImage{width:100vw;text-align:center;overflow:hidden;}
|
.headArticolo .newsImage{width:100vw;text-align:center;overflow:hidden;}
|
||||||
.headArticolo .newsImage img{max-width:100%;}
|
.headArticolo .newsImage img{max-width:100%;}
|
||||||
.articoloTitle{width:90%;padding:10px;margin:auto;}
|
.articoloTitle{width:90%;padding:10px;margin:auto;}
|
||||||
.articoloTitle .title{ font-weight:bold; color:black; }
|
.articoloTitle .title{ font-weight:bold; color:black; margin: 0; font-size: 1.8em; }
|
||||||
.articoloTitle .subTitle{font-weight:italic;color:#9a9a9a;}
|
.articoloTitle .subTitle{font-weight:italic;color:#9a9a9a;}
|
||||||
.articoloBody{width:90vw;margin:auto;}
|
.articoloBody{width:90vw;margin:auto;}
|
||||||
.articoloBody .articoloTesto{text-align:justify;padding:5px;}
|
.articoloBody .articoloTesto{text-align:justify;padding:5px;}
|
||||||
|
|||||||
@@ -331,10 +331,13 @@ display: inline-block;
|
|||||||
.gossipTitle{margin-bottom:5px;font-weight:bold;font-size:20px;}
|
.gossipTitle{margin-bottom:5px;font-weight:bold;font-size:20px;}
|
||||||
.gossipSubtitle{margin-bottom:5px;color:#64bff0;font-weight:bold;font-size:15px;}
|
.gossipSubtitle{margin-bottom:5px;color:#64bff0;font-weight:bold;font-size:15px;}
|
||||||
|
|
||||||
.animaliContainer,.viaggiContainer{display:block;margin-bottom:5px;text-decoration:none;color:black;}
|
.animaliContainer, .viaggiContainer, .variousContainer {display:block;margin-bottom:5px;text-decoration:none;color:black;}
|
||||||
.animaliContainer > .culturaMainMedia,.viaggiContainer > .culturaMainMedia{text-align:left;}
|
.animaliContainer > .culturaMainMedia,.viaggiContainer > .culturaMainMedia{text-align:left;}
|
||||||
.animaliTitle,.viaggiTitle{cursor:pointer;margin-bottom:5px;font-weight:bold;font-size:17px;}
|
.animaliTitle,.viaggiTitle{cursor:pointer;margin-bottom:5px;font-weight:bold;font-size:17px;}
|
||||||
|
|
||||||
|
.rightCategory .categoryBar{ margin-bottom: 5px;}
|
||||||
|
.rightColumnTitle{ margin-bottom:5px; font-weight:bold; font-size:17px; color: black; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
_ _ _ _
|
_ _ _ _
|
||||||
/ \ _ __| |_(_) ___ ___ | | ___
|
/ \ _ __| |_(_) ___ ___ | | ___
|
||||||
@@ -367,7 +370,7 @@ display: inline-block;
|
|||||||
.articoloMainMedia.mediaContent img{max-height:225px;cursor:pointer;}
|
.articoloMainMedia.mediaContent img{max-height:225px;cursor:pointer;}
|
||||||
|
|
||||||
.articoloTitle{display:inline-block;width:550px;padding:0px 20px;vertical-align:top;text-align:left;}
|
.articoloTitle{display:inline-block;width:550px;padding:0px 20px;vertical-align:top;text-align:left;}
|
||||||
.articoloTitle > .title{font-size:20px;font-weight:bold;text-transform:uppercase;font-family:"Arial Bold";}
|
.articoloTitle > .title{font-size:20px;font-weight:bold;text-transform:uppercase;font-family:"Arial Bold"; margin: 0;}
|
||||||
.articoloTitle > .subTitle{font-style:italic;font-family:"Arial Bold";}
|
.articoloTitle > .subTitle{font-style:italic;font-family:"Arial Bold";}
|
||||||
.subTitle > span:first-child{color:rgb(150,150,150);text-transform:none;font-weight:bold;}
|
.subTitle > span:first-child{color:rgb(150,150,150);text-transform:none;font-weight:bold;}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
git pull --quiet
|
git pull --quiet
|
||||||
git tag -l --sort=-version:refname | head -n 1
|
git tag | tr - \~ | sort -V | tr \~ - | tail -n 1
|
||||||
Reference in New Issue
Block a user