15 Commits
Author SHA1 Message Date
r.didato b1a33940ff Merge branch 'development' of ssh://gogs.didato.ninja:2022/Work/fdn2 into development 2023-06-26 21:34:08 +02:00
r.didato b9be324698 #16 - Inserito nuovo tag 2023-06-26 21:34:06 +02:00
r.didato 40d0e6071a Update 'cicd/environments/production/worker.env' 2022-12-24 00:49:26 +00:00
r.didato 60dfebc676 Update 'cicd/environments/production/webserver.env' 2022-12-24 00:49:13 +00:00
r.didato 0479701b70 Update 'cicd/environments/test/worker.env' 2022-12-24 00:46:05 +00:00
r.didato f80dc6ec64 Update 'cicd/environments/test/webserver.env' 2022-12-24 00:45:53 +00:00
r.didato fc63d04c6b Fix paths 2022-11-16 22:23:00 +01:00
r.didato 0cbf98d43e Ridotto tempo di rotazione banner 2022-11-16 21:15:30 +01:00
r.didato 0359e12555 #15 Rimossi allineamenti non necessari 2022-10-10 21:02:48 +02:00
r.didato 83e17cec7c #15 - Fixed 2022-10-10 20:57:18 +02:00
r.didato 05e4c00b7f asd 2022-10-04 20:45:14 +02:00
r.didato 69eb59b93b Typpo 2022-10-04 20:42:00 +02:00
r.didato 4883c53419 Fix click Banner 2022-10-04 20:41:22 +02:00
r.didato a0bafc453f CICD 2022-10-04 19:56:49 +02:00
r.didato b515760e6d Fix config 2022-10-04 19:47:16 +02:00
17 changed files with 67 additions and 49 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ $currentSystem->apache->user = "var-www";
$currentSystem->apache->group = "var-www";
$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
$backupSystem = new stdClass();
+1 -1
View File
@@ -61,7 +61,7 @@ class BannerHelper {
private static function getBannerImpressions($bannerIds) {
$time = strtotime("today CET");
$time = strtotime("today");
$stats = GlobalVariables::get("dao")->query(
BannerStatsModel::class,
[
+1 -1
View File
@@ -193,7 +193,7 @@ class PipelineHelper {
'statType'=>StatisticModel::STAT_TYPE_BANNER_IMPRESSION,
'content.position'=>$position,
// '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(
@@ -28,7 +28,7 @@ class ArticleStatsModel extends Model {
}
public static function getFilter($articleId, $day, $month, $year) {
$time = strtotime("$year-$month-$day CET");
$time = strtotime("$year-$month-$day");
return [
'notizia' => $articleId,
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
@@ -16,7 +16,7 @@ class BannerStatsModel extends Model {
}
public static function new($bannerId, $day, $month, $year) {
$time = strtotime("$year-$month-$day CET");
$time = strtotime("$year-$month-$day");
return new static(
(object)[
'banner' => $bannerId,
@@ -30,7 +30,7 @@ class BannerStatsModel extends Model {
);
}
public static function getFilter($bannerId, $day, $month, $year) {
$time = strtotime("$year-$month-$day CET");
$time = strtotime("$year-$month-$day");
return [
'banner' => $bannerId,
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
@@ -15,7 +15,7 @@ class PageViewStatsModel extends Model {
return "pageview_stats";
}
public static function new($page, $day, $month, $year) {
$time = strtotime("$year-$month-$day CET");
$time = strtotime("$year-$month-$day");
return new static(
(object)[
@@ -33,7 +33,7 @@ class PageViewStatsModel extends Model {
}
public static function getFilter($page, $day, $month, $year) {
$time = strtotime("$year-$month-$day CET");
$time = strtotime("$year-$month-$day");
return [
'page' => $page,
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
+11 -14
View File
@@ -215,7 +215,7 @@ class GUIHandler {
<div class="leftBanner topBanner mediaContent">
<?php BannerHelper::printBanner(BannerModel::POSITION_HEAD);?>
</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">
<?php BannerHelper::printBanner(BannerModel::POSITION_HEAD);?>
</div>
@@ -381,7 +381,7 @@ class GUIHandler {
$stats = GlobalVariables::get("dao")->aggregate(
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);
@@ -449,19 +449,16 @@ class GUIHandler {
public static function generateGoogleAnalyticsScripts(){
?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
// ga('create', 'UA-75287906-1', 'auto');
// ga('send', 'pageview');
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5YTMS8G32Q"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-5YTMS8G32Q');
</script>
ga('create', 'UA-6137905-1', 'auto');
ga('send', 'pageview');
</script>
<?php
}
+9 -12
View File
@@ -467,19 +467,16 @@ class GUIHandlerMobile {
public static function generateGoogleAnalyticsScripts(){
?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-75287906-1', 'auto');
ga('send', 'pageview');
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5YTMS8G32Q"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-5YTMS8G32Q');
</script>
ga('create', 'UA-6137905-1', 'auto');
ga('send', 'pageview');
</script>
<?php
}
+2
View File
@@ -4,6 +4,8 @@ Author: Riccardo Di Dato
Creation Date: 04/feb/2013
*/
date_default_timezone_set("Europe/Rome");
require_once(dirname(__FILE__)."/common/config.php");
require_once(dirname(__FILE__)."/lib/lib.inclusions.php");
+4 -4
View File
@@ -72,13 +72,13 @@ try{
<div class="bannerStat">
<div>
<div class="statName">Oggi</div>
<div>Visualizzazioni: <?php echo AnalyticsHelper::countBannerImpressions($banner->id,strtotime("today CET"));?></div>
<div class="toHide">Click: <?php echo AnalyticsHelper::countBannerClicks($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"));?></div>
</div>
<div>
<div class="statName">Ultima settimana</div>
<div>Visualizzazioni: <?php echo AnalyticsHelper::countBannerImpressions($banner->id,strtotime("-7 days CET"));?></div>
<div class="toHide">Click: <?php echo AnalyticsHelper::countBannerClicks($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"));?></div>
</div>
<div>
<div class="statName">Totali</div>
+2 -2
View File
@@ -144,11 +144,11 @@ try{
<div class="notiziaStat">
<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 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 class="statName">Totali</div>
+24 -2
View File
@@ -1,5 +1,5 @@
const MAX_EXECUTIONS = 12;
const ROTATION_INTERVAL = 30000;
const ROTATION_INTERVAL = 12000;
const executions = {};
@@ -41,7 +41,29 @@ function bannerGroup(group, grpName) {
(target) => {
if (rval.length > 0) {
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);
}
}
);
+1 -1
View File
@@ -17,7 +17,7 @@ try {
if (!is_null($ip) && !is_null($banners) && !is_null($source)){
$banners = explode(",", $banners);
$ts = strtotime('today CET');
$ts = strtotime('today');
foreach ($banners as $banner) {
AnalyticsHelper::bannerImpression(
+2 -2
View File
@@ -2,6 +2,6 @@ DDNINJA_ENVIRONMENT_NAME=production
DDNINJA_IS_PRODUCTION=true
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 -2
View File
@@ -2,6 +2,6 @@ DDNINJA_ENVIRONMENT_NAME=production
DDNINJA_IS_PRODUCTION=true
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
+1 -1
View File
@@ -2,6 +2,6 @@ DDNINJA_ENVIRONMENT_NAME=test
DDNINJA_IS_PRODUCTION=false
DDNINJA_MONGO_DBNAME=fdn2_test
DDNINJA_MONGO_LOCATION=database
DDNINJA_MONGO_LOCATION=mongo
DDNINJA_PUBLIC_URL=http://test.ifattidinapoli.it
+1 -1
View File
@@ -2,6 +2,6 @@ DDNINJA_ENVIRONMENT_NAME=test
DDNINJA_IS_PRODUCTION=false
DDNINJA_MONGO_DBNAME=fdn2_test
DDNINJA_MONGO_LOCATION=database
DDNINJA_MONGO_LOCATION=mongo
DDNINJA_PUBLIC_URL=http://test.ifattidinapoli.it