4 Commits
Author SHA1 Message Date
r.didato daabdbb566 Fixata priorità banner 2022-09-28 20:27:24 +02:00
r.didato 2ed3a2bf3c #1 - Titoli H1 2022-09-28 20:00:33 +02:00
r.didato 3b12ce1786 #11 - Fix banner sorting 2022-09-28 19:48:51 +02:00
r.didato 6c3acfe5e9 Fix git tag detection 2022-09-25 21:29:34 +02:00
12 changed files with 26 additions and 114 deletions
+7 -8
View File
@@ -61,17 +61,16 @@ class BannerHelper {
private static function getBannerImpressions($bannerIds) {
$time = strtotime("today CET");
$stats = GlobalVariables::get("dao")->query(
BannerStatsModel::class,
[
'_id' => [
'$in' => array_map(
function($banner) {
return new \MongoDB\BSON\ObjectID($banner);
},
$bannerIds
)
'banner' => [
'$in' => $bannerIds
],
'y' => intval(date('Y', $time)),
'm' => intval(date('m', $time)),
'd' => intval(date('d', $time))
]
);
$rval = array_reduce(
@@ -83,7 +82,7 @@ class BannerHelper {
[]
);
foreach ($stats as $stat) {
$rval[strval($stat->id)] = intval($stat->views);
$rval[strval($stat->banner)] = intval($stat->views);
}
return $rval;
}
+1 -1
View File
@@ -172,7 +172,7 @@ GUIHandler::generateHtmlHeaders(array("additionalMetadata"=>$additionalHeaders,"
?>
</div>
<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">
<span><?php echo $data;?> &mdash;</span>
<span itemprop="headline"><?php echo $articolo->sottotitolo;?></span>
+1 -1
View File
@@ -66,5 +66,5 @@ function resortGroup(group) {
}
function compareEle(a, b) {
return a.views >= b.views;
return a.views - b.views;
}
+1 -1
View File
@@ -198,7 +198,7 @@ GUIHandlerMobile::generateHtmlHeaders(array("additionalMetadata"=>$additionalHea
?>
</div>
<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">
<span><?php echo $data;?> &mdash;</span>
<span itemprop="headline"><?php echo $articolo->sottotitolo;?></span>
+1 -24
View File
@@ -4,29 +4,6 @@ Author: Riccardo Di Dato
Creation Date: 02/mar/2016
*/
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){
$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()."'");
}
include(dirname(__FILE__)."/../../stats/bannerClick.php");
?>
+1 -25
View File
@@ -4,30 +4,6 @@ Author: Riccardo Di Dato
Creation Date: 02/mar/2016
*/
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");
$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()."'");
}
include(dirname(__FILE__)."/../../stats/bannerImpression.php");
?>
@@ -0,0 +1,9 @@
<?php
/*
Author: Riccardo Di Dato
Creation Date: 02/mar/2016
*/
include(dirname(__FILE__)."/../../stats/bannerMultiImpression.php");
?>
+1 -26
View File
@@ -3,31 +3,6 @@
Author: Riccardo Di Dato
Creation Date: 28/gen/2016
*/
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()."'");
}
include(dirname(__FILE__)."/../../stats/notiziaImpression.php");
?>
+1 -25
View File
@@ -4,30 +4,6 @@ Author: Riccardo Di Dato
Creation Date: 27/gen/2016
*/
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");
$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()."'");
}
include(dirname(__FILE__)."/../../stats/pageImpression.php");
?>
+1 -1
View File
@@ -154,7 +154,7 @@ body{font-family:lato, arial;}
.headArticolo .newsImage{width:100vw;text-align:center;overflow:hidden;}
.headArticolo .newsImage img{max-width:100%;}
.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;}
.articoloBody{width:90vw;margin:auto;}
.articoloBody .articoloTesto{text-align:justify;padding:5px;}
+1 -1
View File
@@ -370,7 +370,7 @@ display: inline-block;
.articoloMainMedia.mediaContent img{max-height:225px;cursor:pointer;}
.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";}
.subTitle > span:first-child{color:rgb(150,150,150);text-transform:none;font-weight:bold;}
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash
git pull --quiet
git tag -l --sort=-version:refname | head -n 1
git tag | tr - \~ | sort -V | tr \~ - | tail -n 1