diff --git a/app/public/js/banner.js b/app/public/js/banner.js index 6e8e95c..d04a441 100644 --- a/app/public/js/banner.js +++ b/app/public/js/banner.js @@ -66,5 +66,5 @@ function resortGroup(group) { } function compareEle(a, b) { - return a.views >= b.views; + return a.views - b.views; } \ No newline at end of file diff --git a/app/public/mobile/stats/bannerClick.php b/app/public/mobile/stats/bannerClick.php index 5c3974d..e2354ab 100644 --- a/app/public/mobile/stats/bannerClick.php +++ b/app/public/mobile/stats/bannerClick.php @@ -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"); ?> \ No newline at end of file diff --git a/app/public/mobile/stats/bannerImpression.php b/app/public/mobile/stats/bannerImpression.php index b98bc0d..7f5c946 100644 --- a/app/public/mobile/stats/bannerImpression.php +++ b/app/public/mobile/stats/bannerImpression.php @@ -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"); ?> \ No newline at end of file diff --git a/app/public/mobile/stats/bannerMultiImpression.php b/app/public/mobile/stats/bannerMultiImpression.php new file mode 100644 index 0000000..f32f788 --- /dev/null +++ b/app/public/mobile/stats/bannerMultiImpression.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/app/public/mobile/stats/notiziaImpression.php b/app/public/mobile/stats/notiziaImpression.php index 8e8568c..f568d0e 100644 --- a/app/public/mobile/stats/notiziaImpression.php +++ b/app/public/mobile/stats/notiziaImpression.php @@ -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"); ?> \ No newline at end of file diff --git a/app/public/mobile/stats/pageImpression.php b/app/public/mobile/stats/pageImpression.php index 6abfbcb..071b75a 100644 --- a/app/public/mobile/stats/pageImpression.php +++ b/app/public/mobile/stats/pageImpression.php @@ -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"); ?> \ No newline at end of file