diff --git a/core/core.js.php b/core/core.js.php index 057be31..cdbf36f 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -674,10 +674,11 @@ $(document).ready(function(){ $('.clicked_link_count').on('click', function(event) { // Récupérer le chemin vers le fichier var filePath = $(this).attr('href'); + console.log(filePath); // Envoyer une requête AJAX pour enregistrer le téléchargement $.ajax({ type: 'POST', - url: '/site/data/statislite/module/download_counter/download_counter.php', + url: "site/data/statislite/module/download_counter/download_counter.php", data: {'url': filePath}, }); }); diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 9c84372..4aef8b1 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -164,6 +164,10 @@ if ($this->getData(['core', 'dataVersion']) < 4501) { $this->setData(['locale', 'editorLabel', $groupWhoIs[2] ]); $this->setData(['locale', 'moderatorLabel', $groupWhoIs[3] ]); $this->setData(['locale', 'administratorLabel', $groupWhoIs[4] ]); + if( is_dir('./site/data/statislite/module') ){ + if ( !is_dir('./site/data/statislite/module/download_counter') ) mkdir('./site/data/statislite/module/download_counter', 0700); + copy('./module/statislite/ressource/download_counter/download_counter.php', './site/data/statislite/module/download_counter/download_counter.php'); + } $this->setData(['core', 'dataVersion', 4501]); } ?> diff --git a/module/statislite/statislite.php b/module/statislite/statislite.php index 03bacd7..36a175f 100644 --- a/module/statislite/statislite.php +++ b/module/statislite/statislite.php @@ -538,7 +538,7 @@ class statislite extends common { 'timeVisiteMini' => '30', 'timePageMini' => '5', 'nbPageMini' => '2', - 'usersExclus' => '3', + 'usersExclus' => '4', 'nbEnregSession' => '5', 'geolocalisation' => false, 'nbaffipagesvues' => '10', diff --git a/module/statislite/view/index/index.php b/module/statislite/view/index/index.php index d95efdb..118c6d5 100644 --- a/module/statislite/view/index/index.php +++ b/module/statislite/view/index/index.php @@ -152,23 +152,28 @@ if( function_exists('datefmt_create') && function_exists('datefmt_format') && ex * Affichage des téléchargements * */ -if( file_exists( $module::$downloadLink.'counter.json' ) && file_get_contents($module::$downloadLink.'counter.json') !== '{}'){ +if( file_exists( $module::$downloadLink.'counter.json' )){ + if( file_get_contents($module::$downloadLink.'counter.json') !== '{}'){ $json = file_get_contents($module::$downloadLink.'counter.json'); $download = json_decode($json, true); - if( function_exists('datefmt_create') && function_exists('datefmt_format') && extension_loaded('intl') ){ - // Affichage au format de la langue d'administration - $fmt = datefmt_create( - $text['statislite_view']['index'][29], - IntlDateFormatter::LONG, - IntlDateFormatter::SHORT, - $text['statislite_view']['index'][30], - IntlDateFormatter::GREGORIAN - ); - $datedeb = datefmt_format($fmt, strtotime($download["date_creation_fichier"])); + if( isset($download["date_creation_fichier"])){ + if( function_exists('datefmt_create') && function_exists('datefmt_format') && extension_loaded('intl') ){ + // Affichage au format de la langue d'administration + $fmt = datefmt_create( + $text['statislite_view']['index'][29], + IntlDateFormatter::LONG, + IntlDateFormatter::SHORT, + $text['statislite_view']['index'][30], + IntlDateFormatter::GREGORIAN + ); + $datedeb = datefmt_format($fmt, strtotime($download["date_creation_fichier"])); - } else{ - $datedeb = $download["date_creation_fichier"]; - } ?> + } else{ + $datedeb = $download["date_creation_fichier"]; + } + } else { + $datedeb =" ? "; + }?>
- +