Modifications 4202
This commit is contained in:
parent
596ac5e53d
commit
ee78381b74
|
@ -1,5 +1,13 @@
|
|||
# Changelog
|
||||
|
||||
## Version 4.2.02 de Deltacms
|
||||
- Modifications :
|
||||
- Statislite : sécurité vis à vis d'une corruption des fichiers json,
|
||||
- Statislite : mise à jour de la ressource d'identification des systèmes d'exploitation,
|
||||
- Personnalisation du thème / menu burger avec affichage du titre : réglage de la taille et de la couleur du texte.
|
||||
- Corrections :
|
||||
- Statislite : erreur sur le nom d'une variable.
|
||||
|
||||
## Version 4.2.01 de Deltacms
|
||||
- Modifications :
|
||||
- Gestionnaire de fichiers : compatibilité PHP 8.1,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
# DeltaCMS 4.2.01
|
||||
# DeltaCMS 4.2.02
|
||||
|
||||
DeltaCMS est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.
|
||||
L'administration du site est bilingue anglais ou français, le site peut être rédigé dans une des principales langues européennes.
|
||||
|
|
|
@ -48,7 +48,7 @@ class common {
|
|||
|
||||
// Numéro de version
|
||||
const DELTA_UPDATE_URL = 'https://update.deltacms.fr/master/';
|
||||
const DELTA_VERSION = '4.2.01';
|
||||
const DELTA_VERSION = '4.2.02';
|
||||
const DELTA_UPDATE_CHANNEL = "v4";
|
||||
|
||||
public static $actions = [];
|
||||
|
@ -2507,7 +2507,7 @@ class core extends common {
|
|||
/*$color2 = helper::colorVariants($this->getData(['theme', 'menu', 'textColor']));
|
||||
$css .= 'nav a.active{color:' . $color2['text'] . '}';*/
|
||||
}
|
||||
$css .= 'nav #burgerText{color:' . $colors['text'] . '}';
|
||||
$css .= 'nav #burgerText{color:' . $this->getData(['theme','menu','burgerTextColor']) .';font-size:'.$this->getData(['theme','menu','burgerFontSize']) .';}';
|
||||
// Sous menu
|
||||
$colors = helper::colorVariants($this->getData(['theme', 'menu', 'backgroundColorSub']));
|
||||
$css .= 'nav .navSub a{background-color:' . $colors['normal'] . '}';
|
||||
|
|
|
@ -53,9 +53,10 @@ if ($this->getData(['core', 'dataVersion']) < 4104) {
|
|||
$this->setData(['core', 'dataVersion', 4104]);
|
||||
}
|
||||
|
||||
if ($this->getData(['core', 'dataVersion']) < 4201) {
|
||||
|
||||
if ($this->getData(['core', 'dataVersion']) < 4202) {
|
||||
$this->setData(['theme', 'menu', 'burgerTextColor', '#DDD']);
|
||||
$this->setData(['theme', 'menu', 'burgerFontSize', '1.5em']);
|
||||
// Mise à jour
|
||||
$this->setData(['core', 'dataVersion', 4201]);
|
||||
$this->setData(['core', 'dataVersion', 4202]);
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<p><a href="https://deltacms.fr" target="_blank" rel="noopener"><img src="site/file/source/icones/logo_menu_couleur_600_200.png" alt="Deltacms" title="Deltacms" style="display: block; margin-left: auto; margin-right: auto;" width="300" height="75" /></a></p>
|
||||
<div class="row"><div style="text-align: center;"><div class="block" style="display: inline-block;">
|
||||
<h2 style="text-align: left;">Welcome to your new DeltaCMS website !</h2>
|
||||
<p style="text-align: left;"><strong>An email containing the summary of your installation has just been sent to you.</strong></p><br /><p> </p>
|
||||
<p style="text-align: left;">Log in now to your member area to create a site that suits you ! <br/><br/>You will be able to customize the theme, create pages, add users and much more !</p>
|
||||
</div></div></div>
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"locale": {
|
||||
"homePageId": "accueil",
|
||||
"homePageId": "home",
|
||||
"page302": "none",
|
||||
"page403": "none",
|
||||
"page404": "none",
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"page": {
|
||||
"accueil": {
|
||||
"home": {
|
||||
"typeMenu": "text",
|
||||
"iconUrl": "",
|
||||
"disable": false,
|
||||
"content": "accueil.html",
|
||||
"content": "home.html",
|
||||
"hideTitle": true,
|
||||
"homePageId": true,
|
||||
"breadCrumb": false,
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"imageContainer": "auto",
|
||||
"tinyHidden": true,
|
||||
"feature": "wallpaper",
|
||||
"featureContent": "<p>Bannière vide<\/p>",
|
||||
"featureContent": "<p>Banner empty<\/p>",
|
||||
"width": "container"
|
||||
},
|
||||
"menu": {
|
||||
|
@ -80,7 +80,9 @@
|
|||
"memberBar": true,
|
||||
"burgerLogo": "",
|
||||
"burgerContent": "title",
|
||||
"width": "container"
|
||||
"width": "container",
|
||||
"burgerTextColor": "#DDD",
|
||||
"burgerFontSize": "1.5em"
|
||||
},
|
||||
"site": {
|
||||
"backgroundColor": "rgba(255, 255, 255, 1)",
|
||||
|
|
|
@ -70,7 +70,7 @@ class init extends common {
|
|||
]
|
||||
],
|
||||
'core' => [
|
||||
'dataVersion' => 4201,
|
||||
'dataVersion' => 4202,
|
||||
'lastBackup' => 0,
|
||||
'lastClearTmp' => 0,
|
||||
'lastAutoUpdate' => 0,
|
||||
|
@ -358,7 +358,9 @@ class init extends common {
|
|||
'memberBar' => true,
|
||||
'burgerLogo' => '',
|
||||
'burgerContent' => 'title',
|
||||
'width' => 'container'
|
||||
'width' => 'container',
|
||||
'burgerFontSize' => '1.5em',
|
||||
'burgerTextColor' => '#DDD'
|
||||
],
|
||||
'site' => [
|
||||
'backgroundColor' => 'rgba(255, 255, 255, 1)',
|
||||
|
|
|
@ -236,6 +236,22 @@ class theme extends common {
|
|||
'1.2em' => 'Large (120%)',
|
||||
'1.3em' => 'Very large (130%)'
|
||||
];
|
||||
public static $menuBurgerFontSizes = [
|
||||
'1em' => 'Très petite (100%)',
|
||||
'1.2em' => 'Petite (120%)',
|
||||
'1.5em' => 'Standard (150%)',
|
||||
'1.8em' => 'Moyenne (180%)',
|
||||
'2em' => 'Grande (200%)',
|
||||
'2.5em' => 'Très grande (250%)'
|
||||
];
|
||||
public static $menuBurgerFontSizes_en = [
|
||||
'1em' => 'Very small (100%)',
|
||||
'1.2em' => 'Small (120%)',
|
||||
'1.5em' => 'Standard (150%)',
|
||||
'1.8em' => 'Medium (180%)',
|
||||
'2em' => 'Large (200%)',
|
||||
'2.5em' => 'Very large (250%)'
|
||||
];
|
||||
public static $menuHeights = [
|
||||
'5px 10px' => 'Très petite',
|
||||
'10px' => 'Petite',
|
||||
|
@ -1079,7 +1095,9 @@ class theme extends common {
|
|||
'burgerTitle' => $this->getInput('themeMenuBurgerTitle', helper::FILTER_BOOLEAN),
|
||||
'memberBar' => $this->getInput('themeMenuMemberBar', helper::FILTER_BOOLEAN),
|
||||
'burgerLogo' => $this->getInput('themeMenuBurgerLogo'),
|
||||
'burgerContent' => $this->getInput('themeMenuBurgerContent')
|
||||
'burgerContent' => $this->getInput('themeMenuBurgerContent'),
|
||||
'burgerTextColor' => $this->getInput('themeMenuBurgerTextColor'),
|
||||
'burgerFontSize' => $this->getInput('themeMenuBurgerFontSize')
|
||||
]]);
|
||||
|
||||
// Valeurs en sortie
|
||||
|
|
|
@ -192,4 +192,10 @@ $("#themeMenuBurgerContent").on("change", function() {
|
|||
else {
|
||||
$("#themeMenuBurgerLogoId").slideUp();
|
||||
}
|
||||
if($(this).val() === 'title') {
|
||||
$("#themeMenuBurgerTitle").slideDown();
|
||||
}
|
||||
else {
|
||||
$("#themeMenuBurgerTitle").slideUp();
|
||||
}
|
||||
}).trigger("select");
|
||||
|
|
|
@ -49,6 +49,7 @@ switch ($val) {
|
|||
$aligns = $module::$aligns;
|
||||
$burgerContent = $module::$burgerContent;
|
||||
$menuFontSizes = $module::$menuFontSizes;
|
||||
$menuBurgerFontSizes = $module::$menuBurgerFontSizes;
|
||||
$fontWeights = $module::$fontWeights;
|
||||
$textTransforms = $module::$textTransforms;
|
||||
break;
|
||||
|
@ -98,6 +99,7 @@ switch ($val) {
|
|||
$aligns = $module::$aligns_en;
|
||||
$burgerContent = $module::$burgerContent_en;
|
||||
$menuFontSizes = $module::$menuFontSizes_en;
|
||||
$menuBurgerFontSizes = $module::$menuBurgerFontSizes_en;
|
||||
$fontWeights = $module::$fontWeights_en;
|
||||
$textTransforms = $module::$textTransforms_en;
|
||||
break;
|
||||
|
@ -212,6 +214,25 @@ switch ($val) {
|
|||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="themeMenuBurgerTitle" class=" <?php if( $this->getData(['theme', 'menu', 'burgerContent']) !== 'title') echo 'displayNone';?>">
|
||||
<div class="row">
|
||||
<div class="col3 offset6">
|
||||
<?php echo template::text('themeMenuBurgerTextColor', [
|
||||
'class' => 'colorPicker',
|
||||
'help' => $text[21],
|
||||
'label' => $text[22],
|
||||
'value' => $this->getData(['theme', 'menu', 'burgerTextColor'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeMenuBurgerFontSize', $menuBurgerFontSizes, [
|
||||
'label' => $text[32],
|
||||
'help' => $text[33],
|
||||
'selected' => $this->getData(['theme', 'menu', 'burgerFontSize'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="themeMenuBurgerLogoId" class="col6 offset6 <?php if( $this->getData(['theme', 'menu', 'burgerContent']) !== 'logo') echo 'displayNone';?>">
|
||||
<?php
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/*
|
||||
* Fichier stat.php à inclure par le fichier body.inc.html
|
||||
* Fichier stat.php inclut par le fichier body.inc.html
|
||||
* Depuis la version 2.2 l'inscription dans body.inc.html est automatique
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
android 4,Android 4*
|
||||
android 5,Android 5*android 6,Android 6*android 7,Android 7*android 8,Android 8*
|
||||
android 9,Android 9*android 10,Android 10*android 11,Android 11*
|
||||
android 9,Android 9*android 10,Android 10*android 11,Android 11*android 12,Android 12*
|
||||
android,Android*
|
||||
linux,Linux*
|
||||
cros,Chrome OS*
|
||||
windows nt 5.1,Windows XP*windows nt 5.2,Windows XP 64*windows nt 6.0,Windows Vista.1*windows nt 6.1,Windows 7*
|
||||
windows nt 6.2,Windows 8*windows nt 6.3,Windows 8.1*windows nt 10.0,Windows 10*
|
||||
windows nt 6.2,Windows 8*windows nt 6.3,Windows 8.1*windows nt 10.0,Windows 10*windows nt 11.0,Windows 11*
|
||||
win,Windows*
|
||||
ipad,Ipad Apple*iphone, Iphone Apple*mac os x,Apple Macintosh Mac OS X*
|
||||
mac,Apple Macintosh*
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
*
|
||||
* Module StatisLite, un analyseur d'audience léger
|
||||
* @author Sylvain Lelièvre <lelievresylvain@free.fr>
|
||||
* @copyright Copyright (C) 2020-2021, Sylvain Lelièvre
|
||||
* @copyright Copyright (C) 2020-2022, Sylvain Lelièvre
|
||||
*/
|
||||
|
||||
class statislite extends common {
|
||||
|
@ -31,7 +31,7 @@ class statislite extends common {
|
|||
'conversionTime' => self::GROUP_VISITOR
|
||||
];
|
||||
|
||||
const VERSION = '4.0';
|
||||
const VERSION = '4.1';
|
||||
const REALNAME = 'Statislite';
|
||||
const DELETE = true;
|
||||
const UPDATE = '2.6';
|
||||
|
@ -122,14 +122,14 @@ class statislite extends common {
|
|||
'5' => '5 dates',
|
||||
'10' => '10 dates',
|
||||
'20' => '20 dates',
|
||||
'1000' => 'toutes les dates'
|
||||
'50' => '50 dates'
|
||||
];
|
||||
public static $nbAffiDates_en = [
|
||||
'0' => 'None',
|
||||
'5' => '5 dates',
|
||||
'10' => '10 dates',
|
||||
'20' => '20 dates',
|
||||
'1000' => 'All dates'
|
||||
'50' => '50 dates'
|
||||
];
|
||||
|
||||
// Nombre de pages vues affichées graphiquement
|
||||
|
@ -250,9 +250,9 @@ class statislite extends common {
|
|||
private function update() {
|
||||
|
||||
// Installation ou mise à jour vers la version 4.0
|
||||
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.0', '<') ) {
|
||||
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.1', '<') ) {
|
||||
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.0']);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.1']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -293,27 +293,29 @@ class statislite extends common {
|
|||
if( is_file( self::$fichiers_json.'filtre_primaire.json')){
|
||||
$json = file_get_contents(self::$fichiers_json.'filtre_primaire.json');
|
||||
$fp = json_decode($json, true);
|
||||
$pageStat = 0;
|
||||
if( ! empty($fp['listeQS'])){
|
||||
foreach( $fp['listeQS'] as $key=>$PageQS){
|
||||
if( $PageQS == $this->getUrl(0) ) $PageStat = 1;
|
||||
}
|
||||
}
|
||||
if( $PageStat == 0 ){
|
||||
$fp['listeQS'][count($fp['listeQS'])] = $this->getUrl(0);
|
||||
// Suppression des pages inconnues de la listeQS
|
||||
$i=0;
|
||||
foreach($this->getData(['page']) as $key=>$page){
|
||||
self::$listePages[$i] = $this->getData(['page', $key, 'title']);
|
||||
$i++;
|
||||
}
|
||||
foreach( $fp['listeQS'] as $keyQS=>$PageQS){
|
||||
$noexist = true;
|
||||
foreach( self::$listePages as $keyPage=>$Page){
|
||||
$Pagemod = strtolower(str_replace(' ','-',$Page));
|
||||
if( $PageQS === $Pagemod) $noexist = false;
|
||||
$PageStat = 0;
|
||||
if(isset( $fp['listeQS'])){
|
||||
if( ! empty($fp['listeQS'])){
|
||||
foreach( $fp['listeQS'] as $key=>$PageQS){
|
||||
if( $PageQS == $this->getUrl(0) ) $PageStat = 1;
|
||||
}
|
||||
}
|
||||
if( $PageStat === 0 ){
|
||||
$fp['listeQS'][count($fp['listeQS'])] = $this->getUrl(0);
|
||||
// Suppression des pages inconnues de la listeQS
|
||||
$i=0;
|
||||
foreach($this->getData(['page']) as $key=>$page){
|
||||
self::$listePages[$i] = $this->getData(['page', $key, 'title']);
|
||||
$i++;
|
||||
}
|
||||
foreach( $fp['listeQS'] as $keyQS=>$PageQS){
|
||||
$noexist = true;
|
||||
foreach( self::$listePages as $keyPage=>$Page){
|
||||
$Pagemod = strtolower(str_replace(' ','-',$Page));
|
||||
if( $PageQS === $Pagemod) $noexist = false;
|
||||
}
|
||||
if( $noexist ) unset( $fp['listeQS'][$keyQS]);
|
||||
}
|
||||
if( $noexist ) unset( $fp['listeQS'][$keyQS]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -687,14 +689,7 @@ class statislite extends common {
|
|||
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData'])
|
||||
]]);
|
||||
// Initialisation de filtre_primaire.json qui contient les paramètres de la configuration avancée
|
||||
$json = '{}';
|
||||
$fp= json_decode($json, true);
|
||||
$fp['robots'] = array( 'ua' => 0, 'ip'=> 0);
|
||||
$fp['listeIP'] = [];
|
||||
$fp['listeQS'] = array( 0 => $this->getUrl(0));
|
||||
$fp['listeBot'] = [];
|
||||
$json = json_encode($fp);
|
||||
file_put_contents(self::$fichiers_json.'filtre_primaire.json',$json);
|
||||
$this->init_fp();
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl().$this->getUrl(0).'/config',
|
||||
|
@ -704,7 +699,6 @@ class statislite extends common {
|
|||
}
|
||||
else{
|
||||
|
||||
|
||||
/*
|
||||
* Paramètres réglés en configuration du module
|
||||
*/
|
||||
|
@ -739,15 +733,35 @@ class statislite extends common {
|
|||
self::$dureevisites = 0;
|
||||
$datedebut = date('Y/m/d H:i:s');
|
||||
|
||||
// Initialisation du fichier cumul.json
|
||||
// Initialisation du fichier cumul.json et contrôle de cohérence
|
||||
if(! is_file(self::$fichiers_json.'cumul.json')){
|
||||
$this -> initcumul();
|
||||
} else{
|
||||
// Contrôle de cohérence du fichier cumul.json, sinon restauration du dernier fichier valide
|
||||
$json = file_get_contents(self::$fichiers_json.'cumul.json');
|
||||
$cumul = json_decode($json, true);
|
||||
if( ! isset($cumul['nb_clics']) || ! isset($cumul['nb_visites']) || ! isset($cumul['duree_visites']) || ! isset($cumul['clients'])
|
||||
|| ! isset($cumul['robots']) || ! isset($cumul['date_debut']) || ! isset($cumul['date_fin']) || ! isset($cumul['pages'])){
|
||||
if( is_file( self::$json_sauve.'cumul.json')) copy( self::$json_sauve.'cumul.json', self::$fichiers_json.'cumul.json');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Initialisation du fichier chrono.json avec pour clef la date, pour valeurs le nombre visites, le nombre de pages vues, la durée totale
|
||||
if(! is_file(self::$fichiers_json.'chrono.json')){
|
||||
$this -> initchrono();
|
||||
}
|
||||
|
||||
// Contrôle de cohérence du fichier filtre_primaire.json, sinon il est initialisé
|
||||
if( is_file(self::$fichiers_json.'filtre_primaire.json')){
|
||||
$json = file_get_contents(self::$fichiers_json.'filtre_primaire.json');
|
||||
$fp = json_decode($json, true);
|
||||
if( ! isset($fp['robots']) || ! isset($fp['listeIP']) || ! isset($fp['listeQS']) || ! isset($fp['listeBot'])){
|
||||
$this->init_fp();
|
||||
}
|
||||
} else{
|
||||
$this->init_fp();
|
||||
}
|
||||
|
||||
// Lecture et décodage du fichier sessionLog.json
|
||||
if( is_file(self::$fichiers_json.'sessionLog.json')){
|
||||
|
@ -764,12 +778,17 @@ class statislite extends common {
|
|||
break;
|
||||
}
|
||||
|
||||
// Remplacement du nom de vue 'Page d'accueil' par le nom de la page d'accueil
|
||||
// Remplacement du nom de vue 'Page d'accueil' par le nom de la page d'accueil et nom raccourci pour la page employant agenda
|
||||
foreach($log as $numSession=>$values){
|
||||
foreach($values['vues'] as $key=>$value){
|
||||
if( substr($value, 22 , strlen($value)) == 'Page d\'accueil'){
|
||||
$log[$numSession]['vues'][$key] = substr($value, 0 , 19).' * '.$this->getData(['locale','homePageId']);
|
||||
}
|
||||
// agenda
|
||||
if( strpos( $value, 'vue:dayGrid')){
|
||||
$posSlash = strpos( $value, '/', 22);
|
||||
$log[$numSession]['vues'][$key] = substr($value, 0 , 19).' * '.substr( $value,22, $posSlash - 22).'/date';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -849,7 +868,8 @@ class statislite extends common {
|
|||
if(isset($log[$numSession]['ip'])){
|
||||
$ip = $log[$numSession]['ip'];
|
||||
}
|
||||
$datetimei = strtotime(substr($log[$numSession]['vues'][0], 0 , 19));
|
||||
$datetimei = time();
|
||||
if( $nbpageparsession > 0) $datetimei = strtotime(substr($log[$numSession]['vues'][0], 0 , 19));
|
||||
// Si $nbpageparsession <=1 on force la valeur de $datetimef
|
||||
if($nbpageparsession <= 1){
|
||||
$datetimef = $datetimei + $timeVisiteMini;
|
||||
|
@ -938,6 +958,11 @@ class statislite extends common {
|
|||
$cumul['robots'][$type] = $cumul['robots'][$type] + 1;
|
||||
$json = json_encode($cumul);
|
||||
file_put_contents(self::$fichiers_json.'cumul.json',$json);
|
||||
// Sauvegarde de sécurité de cumul.json dans le dossier json_sauve après un contrôle de cohérence
|
||||
if( isset($cumul['nb_clics']) && isset($cumul['nb_visites']) && isset($cumul['duree_visites']) && isset($cumul['clients'])
|
||||
&& isset($cumul['robots']) && isset($cumul['date_debut']) && isset($cumul['date_fin']) && isset($cumul['pages'])){
|
||||
file_put_contents(self::$json_sauve.'cumul.json',$json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -956,11 +981,11 @@ class statislite extends common {
|
|||
foreach($log as $numSession=>$values){
|
||||
$tampon[$numSession] = $log[$numSession];
|
||||
}
|
||||
// Fichier limité à 200 enregistrements
|
||||
if( count($tampon) > 200){
|
||||
// Fichier limité à 100 enregistrements
|
||||
if( count($tampon) > 100){
|
||||
foreach($tampon as $key=>$value){
|
||||
unset($tampon[$key]);
|
||||
if(count($tampon) <= 200){ break; }
|
||||
if(count($tampon) <= 100){ break; }
|
||||
}
|
||||
}
|
||||
$json = json_encode($tampon);
|
||||
|
@ -1066,26 +1091,6 @@ class statislite extends common {
|
|||
}
|
||||
}
|
||||
|
||||
// Geolocalisation
|
||||
/*if($log[$numSession]['geolocalisation'] != 'Fichier - clef_ipapi_com.txt - absent , .'){
|
||||
// Extraction du pays
|
||||
$postiret = strpos($log[$numSession]['geolocalisation'], '-');
|
||||
$pays = substr($log[$numSession]['geolocalisation'], 0, $postiret - 1);
|
||||
$clefreconnue = false;
|
||||
foreach($cumul['clients']['localisation'] as $key => $value){
|
||||
// Si la clef == l'enregistrement dans log de la geolocalisation on incrémente la valeur
|
||||
if( $key == $pays){
|
||||
$cumul['clients']['localisation'][$key]++;
|
||||
$clefreconnue = true;
|
||||
}
|
||||
}
|
||||
// Si une clef valide n'a pas été trouvée on la crée avec une valeur initialisée à 1
|
||||
if(!$clefreconnue){
|
||||
$cumul['clients']['localisation'][$pays] = 1;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Mise à jour des variables liées au fichier sessionLog.json
|
||||
self::$comptepages = self::$comptepages - $nbpageparsession;
|
||||
self::$comptevisite--;
|
||||
|
@ -1114,8 +1119,8 @@ class statislite extends common {
|
|||
$chrono[$dateclef]['duree'] = $chrono[$dateclef]['duree'] + $dureesession;
|
||||
// Tri du tableau par clefs en commençant par la date la plus récente
|
||||
krsort($chrono);
|
||||
// Limitation aux 100 dernières dates
|
||||
if( count($chrono) > 100){
|
||||
// Limitation aux 50 dernières dates
|
||||
if( count($chrono) > 50){
|
||||
$derniereclef = '';
|
||||
foreach($chrono as $key => $value){
|
||||
$derniereclef = $key;
|
||||
|
@ -1130,11 +1135,17 @@ class statislite extends common {
|
|||
unset($log[$numSession]);
|
||||
}
|
||||
}
|
||||
|
||||
// Mise à jour des fichiers sessionLog.json et cumul.json
|
||||
$json = json_encode($log);
|
||||
file_put_contents(self::$fichiers_json.'sessionLog.json',$json);
|
||||
$json = json_encode($cumul);
|
||||
file_put_contents(self::$fichiers_json.'cumul.json',$json);
|
||||
// Sauvegarde de sécurité de cumul.json dans le dossier json_sauve après un contrôle de cohérence
|
||||
if( isset($cumul['nb_clics']) && isset($cumul['nb_visites']) && isset($cumul['duree_visites']) && isset($cumul['clients'])
|
||||
&& isset($cumul['robots']) && isset($cumul['date_debut']) && isset($cumul['date_fin']) && isset($cumul['pages'])){
|
||||
file_put_contents(self::$json_sauve.'cumul.json',$json);
|
||||
}
|
||||
|
||||
// Comptage des visites
|
||||
self::$comptepagestotal = self::$comptepages + $cumul['nb_clics'];
|
||||
|
@ -1405,30 +1416,7 @@ class statislite extends common {
|
|||
return 'fichier systemes.txt absent';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Geolocalisation */
|
||||
/* Utilisation de cette fonction supprimée */
|
||||
/*private function geolocalise($ip){
|
||||
// Géolocalisation avec le site www.ipapi.com qui offre 10000 requêtes / mois
|
||||
if( is_file(self::$base.'clef_ipapi_com.txt')){
|
||||
$access_key = file_get_contents(self::$base.'clef_ipapi_com.txt');
|
||||
// Requête
|
||||
$ch = curl_init('http://api.ipapi.com/'.$ip.'?access_key='.$access_key.'');
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
//Enregistrement des données
|
||||
$json = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
// Decode JSON response:
|
||||
$api_result = json_decode($json, true);
|
||||
}
|
||||
else{
|
||||
$api_result = array( 'country_name'=>'Fichier ','city'=> 'clef_ipapi_com.txt ','latitude'=> 'absent','longitude' => '.');
|
||||
}
|
||||
return $api_result;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/* Initialisation de cumul.json */
|
||||
private function initcumul(){
|
||||
$json = '{}';
|
||||
|
@ -1467,6 +1455,18 @@ class statislite extends common {
|
|||
$json = json_encode($chrono);
|
||||
file_put_contents(self::$fichiers_json.'chrono.json',$json);
|
||||
}
|
||||
|
||||
/* Initialisation de filtre_primaire.son */
|
||||
private function init_fp(){
|
||||
$json = '{}';
|
||||
$fp= json_decode($json, true);
|
||||
$fp['robots'] = array( 'ua' => 0, 'ip'=> 0);
|
||||
$fp['listeIP'] = [];
|
||||
$fp['listeQS'] = array( 0 => $this->getUrl(0));
|
||||
$fp['listeBot'] = [];
|
||||
$json = json_encode($fp);
|
||||
file_put_contents(self::$fichiers_json.'filtre_primaire.json',$json);
|
||||
}
|
||||
|
||||
/* Sauvegarde des fichiers json */
|
||||
private function sauvegardeJson(){
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
* This file is part of DeltaCMS.
|
||||
* For full copyright and license information, please see the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
* @author Sylvain Lelièvre <lelievresylvain@free.fr>
|
||||
* @copyright Copyright (C) 2021-2022, Sylvain Lelièvre
|
||||
* @license GNU General Public License, version 3
|
||||
* @link https://deltacms.fr/
|
||||
*
|
||||
* Delta was created from version 11.2.00.24 of ZwiiCMS
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2021, Frédéric Tempez
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
|
@ -2,4 +2,4 @@
|
|||
<p>Le filtrage primaire permet de ne pas enregistrer les sessions dans les cas suivants :</P>
|
||||
<p> - un IP de la liste 'Filtrage des IP' est reconnu, cette liste est vide à l'initialisation, vous pouvez ajouter des IP au format décimal pointé (exemple 156.23.45.185), l'IP proposé est le vôtre,</p>
|
||||
<p> - un robot est reconnu à partir d'un fichier complexe inclus dans Statislite, vous pouvez ajouter le repère d'un robot inconnu inscrit dans le paramètre de connexion User Agent.</p>
|
||||
<p>Le filtrage primaire permet également de ne pas enregistrer les pages de la liste 'Filtrage des pages', cette liste est vide au départ, sélectionnez les pages dans la liste. </p>
|
||||
<p>Le filtrage primaire permet également de ne pas enregistrer les pages de la liste 'Filtrage des pages', cette liste est initialisée avec le nom de la page de statistiques, sélectionnez les pages dans la liste. </p>
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
<p>Primary filtering allows you to not register sessions in the following cases:</P>
|
||||
<p> - an IP from the 'IP Filtering' list is recognised, this list is empty at initialisation, you can add IPs in dotted decimal format (example 156.23.45.185), the proposed IP is yours,</p>
|
||||
<p> - a robot is recognized from a complex file included in Statislite, you can add the marker of an unknown robot listed in the User Agent connection parameter.</p>
|
||||
<p>Primary filtering also allows you to not register pages in the 'Page Filtering' list, this list is empty at first, select pages from the list. </p>
|
||||
<p>Primary filtering also allows you to not register pages in the 'Page Filtering' list, this list is initialized with the name of the statistics page, select pages from the list. </p>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>site/data/admin.css">
|
||||
<?php
|
||||
// Lexique
|
||||
$text = [];
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
* This file is part of DeltaCMS.
|
||||
* For full copyright and license information, please see the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
* @author Sylvain Lelièvre <lelievresylvain@free.fr>
|
||||
* @copyright Copyright (C) 2021-2022, Sylvain Lelièvre
|
||||
* @license GNU General Public License, version 3
|
||||
* @link https://deltacms.fr/
|
||||
*
|
||||
* Delta was created from version 11.2.00.24 of ZwiiCMS
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2021, Frédéric Tempez
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
|
@ -1,4 +1,3 @@
|
|||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>site/data/admin.css">
|
||||
<?php
|
||||
// Lexique
|
||||
$text = [];
|
||||
|
|
Loading…
Reference in New Issue