#11 - Fix banner sorting

This commit is contained in:
2022-09-28 19:48:51 +02:00
parent 6c3acfe5e9
commit 3b12ce1786
6 changed files with 14 additions and 101 deletions
+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 -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");
?>