Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1a33940ff | ||
|
|
b9be324698 | ||
|
|
40d0e6071a | ||
|
|
60dfebc676 | ||
|
|
0479701b70 | ||
|
|
f80dc6ec64 | ||
|
|
fc63d04c6b | ||
|
|
0cbf98d43e | ||
|
|
0359e12555 | ||
|
|
83e17cec7c | ||
|
|
05e4c00b7f | ||
|
|
69eb59b93b | ||
|
|
4883c53419 | ||
|
|
a0bafc453f | ||
|
|
b515760e6d | ||
|
|
ea4e0c0ec3 |
@@ -36,7 +36,7 @@ $currentSystem->apache->user = "var-www";
|
|||||||
$currentSystem->apache->group = "var-www";
|
$currentSystem->apache->group = "var-www";
|
||||||
$currentSystem->apache->workdir = "/var/www"; // Il path in cui inserire la cartella con le pagine html
|
$currentSystem->apache->workdir = "/var/www"; // Il path in cui inserire la cartella con le pagine html
|
||||||
|
|
||||||
$currentSystem->remoteLocationPath = getenv('ASD_PUBLIC_URL')."/";
|
$currentSystem->remoteLocationPath = getenv('DDNINJA_PUBLIC_URL')."/";
|
||||||
|
|
||||||
// Deprecato in quanto CBS2 è stato dismesso
|
// Deprecato in quanto CBS2 è stato dismesso
|
||||||
$backupSystem = new stdClass();
|
$backupSystem = new stdClass();
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class BannerHelper {
|
|||||||
|
|
||||||
|
|
||||||
private static function getBannerImpressions($bannerIds) {
|
private static function getBannerImpressions($bannerIds) {
|
||||||
$time = strtotime("today CET");
|
$time = strtotime("today");
|
||||||
$stats = GlobalVariables::get("dao")->query(
|
$stats = GlobalVariables::get("dao")->query(
|
||||||
BannerStatsModel::class,
|
BannerStatsModel::class,
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ class PipelineHelper {
|
|||||||
'statType'=>StatisticModel::STAT_TYPE_BANNER_IMPRESSION,
|
'statType'=>StatisticModel::STAT_TYPE_BANNER_IMPRESSION,
|
||||||
'content.position'=>$position,
|
'content.position'=>$position,
|
||||||
// 'date'=>array( '$gte'=>new MongoDate(strtotime("today")) )
|
// 'date'=>array( '$gte'=>new MongoDate(strtotime("today")) )
|
||||||
'date'=>array( '$gte'=>new MongoDB\BSON\UTCDateTime(strtotime("today CET") * 1000) )
|
'date'=>array( '$gte'=>new MongoDB\BSON\UTCDateTime(strtotime("today") * 1000) )
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
|||||||
@@ -49,10 +49,8 @@ class MailModel extends Model implements FDN_MailInterface{
|
|||||||
$email->isMail();
|
$email->isMail();
|
||||||
|
|
||||||
$email->From = $this->from;
|
$email->From = $this->from;
|
||||||
if ($this->hasProperty("fromName")){
|
$email->FromName = "I Fatti di Napoli";
|
||||||
$email->FromName = $this->fromName;
|
|
||||||
}
|
|
||||||
|
|
||||||
$email->Subject = $this->subject;
|
$email->Subject = $this->subject;
|
||||||
|
|
||||||
$email->IsHTML(true);
|
$email->IsHTML(true);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class ArticleStatsModel extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function getFilter($articleId, $day, $month, $year) {
|
public static function getFilter($articleId, $day, $month, $year) {
|
||||||
$time = strtotime("$year-$month-$day CET");
|
$time = strtotime("$year-$month-$day");
|
||||||
return [
|
return [
|
||||||
'notizia' => $articleId,
|
'notizia' => $articleId,
|
||||||
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
|
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class BannerStatsModel extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function new($bannerId, $day, $month, $year) {
|
public static function new($bannerId, $day, $month, $year) {
|
||||||
$time = strtotime("$year-$month-$day CET");
|
$time = strtotime("$year-$month-$day");
|
||||||
return new static(
|
return new static(
|
||||||
(object)[
|
(object)[
|
||||||
'banner' => $bannerId,
|
'banner' => $bannerId,
|
||||||
@@ -30,7 +30,7 @@ class BannerStatsModel extends Model {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
public static function getFilter($bannerId, $day, $month, $year) {
|
public static function getFilter($bannerId, $day, $month, $year) {
|
||||||
$time = strtotime("$year-$month-$day CET");
|
$time = strtotime("$year-$month-$day");
|
||||||
return [
|
return [
|
||||||
'banner' => $bannerId,
|
'banner' => $bannerId,
|
||||||
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
|
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class PageViewStatsModel extends Model {
|
|||||||
return "pageview_stats";
|
return "pageview_stats";
|
||||||
}
|
}
|
||||||
public static function new($page, $day, $month, $year) {
|
public static function new($page, $day, $month, $year) {
|
||||||
$time = strtotime("$year-$month-$day CET");
|
$time = strtotime("$year-$month-$day");
|
||||||
|
|
||||||
return new static(
|
return new static(
|
||||||
(object)[
|
(object)[
|
||||||
@@ -33,7 +33,7 @@ class PageViewStatsModel extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function getFilter($page, $day, $month, $year) {
|
public static function getFilter($page, $day, $month, $year) {
|
||||||
$time = strtotime("$year-$month-$day CET");
|
$time = strtotime("$year-$month-$day");
|
||||||
return [
|
return [
|
||||||
'page' => $page,
|
'page' => $page,
|
||||||
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
|
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ class GUIHandler {
|
|||||||
<div class="leftBanner topBanner mediaContent">
|
<div class="leftBanner topBanner mediaContent">
|
||||||
<?php BannerHelper::printBanner(BannerModel::POSITION_HEAD);?>
|
<?php BannerHelper::printBanner(BannerModel::POSITION_HEAD);?>
|
||||||
</div>
|
</div>
|
||||||
<div class="logo"><a href="http://ifattidinapoli.it/index.php"><img src="http://ifattidinapoli.it/images/logo_uff.png"></a></div>
|
<div class="logo"><a href="http://www.ifattidinapoli.it/index.php"><img src="http://www.ifattidinapoli.it/images/logo_uff.png"></a></div>
|
||||||
<div class="rightBanner topBanner mediaContent">
|
<div class="rightBanner topBanner mediaContent">
|
||||||
<?php BannerHelper::printBanner(BannerModel::POSITION_HEAD);?>
|
<?php BannerHelper::printBanner(BannerModel::POSITION_HEAD);?>
|
||||||
</div>
|
</div>
|
||||||
@@ -381,7 +381,7 @@ class GUIHandler {
|
|||||||
|
|
||||||
$stats = GlobalVariables::get("dao")->aggregate(
|
$stats = GlobalVariables::get("dao")->aggregate(
|
||||||
ArticleStatsModel::class,
|
ArticleStatsModel::class,
|
||||||
PipelineHelper::getMostViewedOfLastDays(strtotime("-7 days CET"),5)
|
PipelineHelper::getMostViewedOfLastDays(strtotime("-7 days"),5)
|
||||||
);
|
);
|
||||||
$idArray = array_map(function ($ele){ return new MongoDB\BSON\ObjectID($ele["notizia"]);}, $stats);
|
$idArray = array_map(function ($ele){ return new MongoDB\BSON\ObjectID($ele["notizia"]);}, $stats);
|
||||||
|
|
||||||
@@ -449,19 +449,16 @@ class GUIHandler {
|
|||||||
|
|
||||||
public static function generateGoogleAnalyticsScripts(){
|
public static function generateGoogleAnalyticsScripts(){
|
||||||
?>
|
?>
|
||||||
<script>
|
<!-- Google tag (gtag.js) -->
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5YTMS8G32Q"></script>
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
<script>
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
window.dataLayer = window.dataLayer || [];
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
// ga('create', 'UA-75287906-1', 'auto');
|
|
||||||
// ga('send', 'pageview');
|
gtag('config', 'G-5YTMS8G32Q');
|
||||||
|
</script>
|
||||||
|
|
||||||
ga('create', 'UA-6137905-1', 'auto');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -467,19 +467,16 @@ class GUIHandlerMobile {
|
|||||||
|
|
||||||
public static function generateGoogleAnalyticsScripts(){
|
public static function generateGoogleAnalyticsScripts(){
|
||||||
?>
|
?>
|
||||||
<script>
|
<!-- Google tag (gtag.js) -->
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5YTMS8G32Q"></script>
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
<script>
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
window.dataLayer = window.dataLayer || [];
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
ga('create', 'UA-75287906-1', 'auto');
|
|
||||||
ga('send', 'pageview');
|
gtag('config', 'G-5YTMS8G32Q');
|
||||||
|
</script>
|
||||||
|
|
||||||
ga('create', 'UA-6137905-1', 'auto');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ Author: Riccardo Di Dato
|
|||||||
Creation Date: 04/feb/2013
|
Creation Date: 04/feb/2013
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
date_default_timezone_set("Europe/Rome");
|
||||||
|
|
||||||
require_once(dirname(__FILE__)."/common/config.php");
|
require_once(dirname(__FILE__)."/common/config.php");
|
||||||
|
|
||||||
require_once(dirname(__FILE__)."/lib/lib.inclusions.php");
|
require_once(dirname(__FILE__)."/lib/lib.inclusions.php");
|
||||||
|
|||||||
@@ -72,13 +72,13 @@ try{
|
|||||||
<div class="bannerStat">
|
<div class="bannerStat">
|
||||||
<div>
|
<div>
|
||||||
<div class="statName">Oggi</div>
|
<div class="statName">Oggi</div>
|
||||||
<div>Visualizzazioni: <?php echo AnalyticsHelper::countBannerImpressions($banner->id,strtotime("today CET"));?></div>
|
<div>Visualizzazioni: <?php echo AnalyticsHelper::countBannerImpressions($banner->id,strtotime("today"));?></div>
|
||||||
<div class="toHide">Click: <?php echo AnalyticsHelper::countBannerClicks($banner->id,strtotime("today CET"));?></div>
|
<div class="toHide">Click: <?php echo AnalyticsHelper::countBannerClicks($banner->id,strtotime("today"));?></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="statName">Ultima settimana</div>
|
<div class="statName">Ultima settimana</div>
|
||||||
<div>Visualizzazioni: <?php echo AnalyticsHelper::countBannerImpressions($banner->id,strtotime("-7 days CET"));?></div>
|
<div>Visualizzazioni: <?php echo AnalyticsHelper::countBannerImpressions($banner->id,strtotime("-7 days"));?></div>
|
||||||
<div class="toHide">Click: <?php echo AnalyticsHelper::countBannerClicks($banner->id,strtotime("-7 days CET"));?></div>
|
<div class="toHide">Click: <?php echo AnalyticsHelper::countBannerClicks($banner->id,strtotime("-7 days"));?></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="statName">Totali</div>
|
<div class="statName">Totali</div>
|
||||||
|
|||||||
@@ -144,11 +144,11 @@ try{
|
|||||||
<div class="notiziaStat">
|
<div class="notiziaStat">
|
||||||
<div>
|
<div>
|
||||||
<div class="statName">Oggi</div>
|
<div class="statName">Oggi</div>
|
||||||
<div><?php echo AnalyticsHelper::countNotiziaImpressions($notizia->id,strtotime("today CET"));?></div>
|
<div><?php echo AnalyticsHelper::countNotiziaImpressions($notizia->id,strtotime("today"));?></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="statName">Ultima settimana</div>
|
<div class="statName">Ultima settimana</div>
|
||||||
<div><?php echo AnalyticsHelper::countNotiziaImpressions($notizia->id,strtotime("-7 days CET"));?></div>
|
<div><?php echo AnalyticsHelper::countNotiziaImpressions($notizia->id,strtotime("-7 days"));?></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="statName">Totali</div>
|
<div class="statName">Totali</div>
|
||||||
|
|||||||
+24
-2
@@ -1,5 +1,5 @@
|
|||||||
const MAX_EXECUTIONS = 12;
|
const MAX_EXECUTIONS = 12;
|
||||||
const ROTATION_INTERVAL = 30000;
|
const ROTATION_INTERVAL = 12000;
|
||||||
|
|
||||||
const executions = {};
|
const executions = {};
|
||||||
|
|
||||||
@@ -41,7 +41,29 @@ function bannerGroup(group, grpName) {
|
|||||||
(target) => {
|
(target) => {
|
||||||
if (rval.length > 0) {
|
if (rval.length > 0) {
|
||||||
const ele = rval.shift();
|
const ele = rval.shift();
|
||||||
$('#'+target).html(ele.media);
|
let mediaHtml = ele.media;
|
||||||
|
if (ele.link) {
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = ele.link;
|
||||||
|
a.target = "_blank";
|
||||||
|
a.innerHTML = ele.media;
|
||||||
|
mediaHtml = a;
|
||||||
|
}
|
||||||
|
mediaHtml.addEventListener(
|
||||||
|
'click',
|
||||||
|
() => {
|
||||||
|
$.ajax({
|
||||||
|
url: "stats/bannerClick.php",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
banner: ele.id,
|
||||||
|
source: document.URL
|
||||||
|
},
|
||||||
|
dataType: "html"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
$('#'+target).html(mediaHtml);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ try {
|
|||||||
|
|
||||||
if (!is_null($ip) && !is_null($banners) && !is_null($source)){
|
if (!is_null($ip) && !is_null($banners) && !is_null($source)){
|
||||||
$banners = explode(",", $banners);
|
$banners = explode(",", $banners);
|
||||||
$ts = strtotime('today CET');
|
$ts = strtotime('today');
|
||||||
|
|
||||||
foreach ($banners as $banner) {
|
foreach ($banners as $banner) {
|
||||||
AnalyticsHelper::bannerImpression(
|
AnalyticsHelper::bannerImpression(
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ DDNINJA_ENVIRONMENT_NAME=production
|
|||||||
DDNINJA_IS_PRODUCTION=true
|
DDNINJA_IS_PRODUCTION=true
|
||||||
|
|
||||||
DDNINJA_MONGO_DBNAME=fdn2
|
DDNINJA_MONGO_DBNAME=fdn2
|
||||||
DDNINJA_MONGO_LOCATION=database
|
DDNINJA_MONGO_LOCATION=mongo
|
||||||
|
|
||||||
DDNINJA_PUBLIC_URL=http://preproduction.ifattidinapoli.it
|
DDNINJA_PUBLIC_URL=http://www.ifattidinapoli.it
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ DDNINJA_ENVIRONMENT_NAME=production
|
|||||||
DDNINJA_IS_PRODUCTION=true
|
DDNINJA_IS_PRODUCTION=true
|
||||||
|
|
||||||
DDNINJA_MONGO_DBNAME=fdn2
|
DDNINJA_MONGO_DBNAME=fdn2
|
||||||
DDNINJA_MONGO_LOCATION=database
|
DDNINJA_MONGO_LOCATION=mongo
|
||||||
|
|
||||||
DDNINJA_PUBLIC_URL=http://preproduction.ifattidinapoli.it
|
DDNINJA_PUBLIC_URL=http://www.ifattidinapoli.it
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ DDNINJA_ENVIRONMENT_NAME=test
|
|||||||
DDNINJA_IS_PRODUCTION=false
|
DDNINJA_IS_PRODUCTION=false
|
||||||
|
|
||||||
DDNINJA_MONGO_DBNAME=fdn2_test
|
DDNINJA_MONGO_DBNAME=fdn2_test
|
||||||
DDNINJA_MONGO_LOCATION=database
|
DDNINJA_MONGO_LOCATION=mongo
|
||||||
|
|
||||||
DDNINJA_PUBLIC_URL=http://test.ifattidinapoli.it
|
DDNINJA_PUBLIC_URL=http://test.ifattidinapoli.it
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ DDNINJA_ENVIRONMENT_NAME=test
|
|||||||
DDNINJA_IS_PRODUCTION=false
|
DDNINJA_IS_PRODUCTION=false
|
||||||
|
|
||||||
DDNINJA_MONGO_DBNAME=fdn2_test
|
DDNINJA_MONGO_DBNAME=fdn2_test
|
||||||
DDNINJA_MONGO_LOCATION=database
|
DDNINJA_MONGO_LOCATION=mongo
|
||||||
|
|
||||||
DDNINJA_PUBLIC_URL=http://test.ifattidinapoli.it
|
DDNINJA_PUBLIC_URL=http://test.ifattidinapoli.it
|
||||||
|
|||||||
Reference in New Issue
Block a user