Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cbf98d43e | ||
|
|
0359e12555 | ||
|
|
83e17cec7c | ||
|
|
05e4c00b7f | ||
|
|
69eb59b93b | ||
|
|
4883c53419 | ||
|
|
a0bafc453f | ||
|
|
b515760e6d |
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
[
|
||||
|
||||
@@ -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 ),
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -4,4 +4,4 @@ DDNINJA_IS_PRODUCTION=true
|
||||
DDNINJA_MONGO_DBNAME=fdn2
|
||||
DDNINJA_MONGO_LOCATION=database
|
||||
|
||||
DDNINJA_PUBLIC_URL=http://preproduction.ifattidinapoli.it
|
||||
DDNINJA_PUBLIC_URL=http://www.ifattidinapoli.it
|
||||
|
||||
@@ -4,4 +4,4 @@ DDNINJA_IS_PRODUCTION=true
|
||||
DDNINJA_MONGO_DBNAME=fdn2
|
||||
DDNINJA_MONGO_LOCATION=database
|
||||
|
||||
DDNINJA_PUBLIC_URL=http://preproduction.ifattidinapoli.it
|
||||
DDNINJA_PUBLIC_URL=http://www.ifattidinapoli.it
|
||||
|
||||
Reference in New Issue
Block a user