From 8de3b1cf9240bd509aba9464c8176a9ab407fff1 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Tue, 10 Dec 2024 15:12:33 +0100 Subject: [PATCH 01/17] new cache_buster function --- application/libraries/Paths.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/application/libraries/Paths.php b/application/libraries/Paths.php index 9d4d262aa..7c1ad66b6 100644 --- a/application/libraries/Paths.php +++ b/application/libraries/Paths.php @@ -32,4 +32,12 @@ class Paths } return $datadir . "/" . $path; } + + function cache_buster($filepath) { + $fullpath = $_SERVER['DOCUMENT_ROOT'] . $filepath; + if (file_exists($fullpath)) { + return base_url($filepath) . '?v=' . filemtime($fullpath); + } + return base_url($filepath); + } } From 969de0fa55fc2947a88d8c042ed6abdc2cd4ba96 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Tue, 10 Dec 2024 15:12:42 +0100 Subject: [PATCH 02/17] cache_buster in header --- application/views/interface_assets/header.php | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 4b5e0c6e5..2998124c0 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -8,51 +8,51 @@ - + - + - + optionslib->get_theme(); if ($theme) { ?> - - - - - - + + + + + + - + - + - - + + uri->segment(1) == "search" && $this->uri->segment(2) == "filter") { ?> - + uri->segment(1) == "notes" && ($this->uri->segment(2) == "add" || $this->uri->segment(2) == "edit")) { ?> - + - - + + uri->segment(1) == "sattimers") { ?> - + - '; - } ?> + + + - '; - } ?> + + '); ?>"> + - + <?php if (isset($page_title)) { echo $page_title; @@ -81,7 +81,7 @@ <body dir="<?php echo $language['direction']; ?>"> <nav class="navbar navbar-expand-lg navbar-light bg-light main-nav" id="header-menu"> <div class="container"> - <a class="navbar-brand" href="<?php echo site_url(); ?>"><img class="headerLogo" src="<?php echo base_url(); ?>assets/logo/<?php echo $this->optionslib->get_logo('header_logo'); ?>.png" alt="Logo" /></a> + <a class="navbar-brand" href="<?php echo site_url(); ?>"><img class="headerLogo" src="<?php echo $this->paths->cache_buster('assets/logo/'. $this->optionslib->get_logo('header_logo').'.png'); ?>" alt="Logo" /></a> <?php if (ENVIRONMENT == "development") { ?> <span class="badge text-bg-danger"><?= __("Developer Mode"); ?></span> <?php } ?> From bac89a2fe8e03bf4e726c0670b9b695e4eb5b910 Mon Sep 17 00:00:00 2001 From: HB9HIL <fabian.berg@hb9hil.org> Date: Tue, 10 Dec 2024 19:36:30 +0100 Subject: [PATCH 03/17] syntax fix --- application/views/interface_assets/header.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 2998124c0..3af9a2ab4 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -51,7 +51,7 @@ <?php } ?> <?php if (file_exists(APPPATH . '../assets/css/custom.css')) { ?> - <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('assets/css/custom.css'); ?>"> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('assets/css/custom.css'); ?>" /> <?php } ?> <script> @@ -68,7 +68,7 @@ </script> <?php if (file_exists(APPPATH . '../assets/js/sections/custom.js')) { ?> - <script src="<?php echo $this->paths->cache_buster('assets/js/sections/custom.js"></script>'); ?>"> + <script src="<?php echo $this->paths->cache_buster('assets/js/sections/custom.js'); ?>"></script> <?php } ?> <link rel="icon" href="<?php echo $this->paths->cache_buster('favicon.ico'); ?>"> From fbe630500c88bad735e6503934453b3c2cc42260 Mon Sep 17 00:00:00 2001 From: HB9HIL <fabian.berg@hb9hil.org> Date: Tue, 10 Dec 2024 19:59:18 +0100 Subject: [PATCH 04/17] finishing header and footer, replaced file loadings with cache buster --- application/libraries/Paths.php | 2 + application/views/interface_assets/footer.php | 174 +++++++++--------- application/views/interface_assets/header.php | 44 ++--- 3 files changed, 111 insertions(+), 109 deletions(-) diff --git a/application/libraries/Paths.php b/application/libraries/Paths.php index 7c1ad66b6..c5e72205b 100644 --- a/application/libraries/Paths.php +++ b/application/libraries/Paths.php @@ -37,6 +37,8 @@ class Paths $fullpath = $_SERVER['DOCUMENT_ROOT'] . $filepath; if (file_exists($fullpath)) { return base_url($filepath) . '?v=' . filemtime($fullpath); + } else { + log_message('debug', 'File does not exist: ' . $fullpath); } return base_url($filepath); } diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 4bf67917e..8fe839125 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -20,7 +20,7 @@ <?php } ?> - var icon_dot_url = "<?php echo base_url();?>assets/images/dot.png"; + var icon_dot_url = "<?php echo $this->paths->cache_buster('/assets/images/dot.png');?>"; // get the user_callsign from session var my_call = "<?php echo $this->session->userdata('user_callsign'); ?>".toUpperCase(); @@ -55,31 +55,31 @@ </script> <!-- General JS Files used across Wavelog --> -<script src="<?php echo base_url(); ?>assets/js/jquery-3.3.1.min.js"></script> -<script src="<?php echo base_url(); ?>assets/js/jquery.fancybox.min.js"></script> -<script src="<?php echo base_url(); ?>assets/js/bootstrap.bundle.min.js"></script> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/leaflet.js"></script> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/Control.FullScreen.js"></script> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/L.Maidenhead.qrb.js"></script> +<script src="<?php echo $this->paths->cache_buster('/assets/js/jquery-3.3.1.min.js'); ?>"></script> +<script src="<?php echo $this->paths->cache_buster('/assets/js/jquery.fancybox.min.js'); ?>"></script> +<script src="<?php echo $this->paths->cache_buster('/assets/js/bootstrap.bundle.min.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/leaflet.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/Control.FullScreen.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/L.Maidenhead.qrb.js'); ?>"></script> <?php if ($this->uri->segment(1) == "activators") { ?> -<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.Maidenhead.activators.js"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/L.Maidenhead.activators.js'); ?>"></script> <?php } ?> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/leaflet.geodesic.js"></script> -<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/radiohelpers.js"></script> -<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/darkmodehelpers.js"></script> -<script src="<?php echo base_url(); ?>assets/js/bootstrapdialog/js/bootstrap-dialog.min.js"></script> -<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/easyprint.js"></script> -<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/sections/common.js"></script> -<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/sections/eqslcharcounter.js"></script> -<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/sections/version_dialog.js"></script> -<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/showdown.min.js"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/leaflet.geodesic.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/radiohelpers.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/darkmodehelpers.js'); ?>"></script> +<script src="<?php echo $this->paths->cache_buster('/assets/js/bootstrapdialog/js/bootstrap-dialog.min.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/easyprint.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/sections/common.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/sections/eqslcharcounter.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/sections/version_dialog.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/showdown.min.js'); ?>"></script> <script type="module" defer> - import { polyfillCountryFlagEmojis } from "<?php echo base_url() ;?>assets/js/country-flag-emoji-polyfill.js"; + import { polyfillCountryFlagEmojis } from "<?php echo $this->paths->cache_buster('/assets/js/country-flag-emoji-polyfill.js') ;?>"; polyfillCountryFlagEmojis(); </script> -<script src="<?php echo base_url(); ?>assets/js/htmx.min.js"></script> +<script src="<?php echo $this->paths->cache_buster('/assets/js/htmx.min.js'); ?>"></script> <script> // Reinitialize tooltips after new content has been loaded @@ -151,7 +151,7 @@ if($this->session->userdata('user_id') != null) { <!-- SPECIAL CALLSIGN OPERATOR FEATURE --> <?php if ($this->config->item('special_callsign') == true && $this->uri->segment(1) == "dashboard") { ?> -<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/sections/operator.js"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/sections/operator.js'); ?>"></script> <script> <?php # Set some variables for better readability @@ -187,12 +187,12 @@ if($this->session->userdata('user_id') != null) { </script> <?php if ($this->uri->segment(1) == "oqrs") { ?> - <script src="<?php echo base_url() ;?>assets/js/sections/oqrs.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/oqrs.js'); ?>"></script> <?php } ?> <!-- JS library to convert cron format to human readable --> <?php if ($this->uri->segment(1) == "cron") { ?> - <script src="<?php echo base_url() ;?>assets/js/cronstrue.min.js"async></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/cronstrue.min.js'); ?>"async></script> <?php } ?> <?php if ($this->uri->segment(1) == "options") { ?> @@ -208,50 +208,50 @@ if($this->session->userdata('user_id') != null) { <?php } ?> <?php if ($this->uri->segment(1) == "awards" && ($this->uri->segment(2) == "iota") ) { ?> - <script id="iotamapjs" type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/iotamap.js" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script> + <script id="iotamapjs" type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/sections/iotamap.js'); ?>" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "awards" && ($this->uri->segment(2) == "dxcc") ) { ?> - <script id="dxccmapjs" type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/dxccmap.js" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script> + <script id="dxccmapjs" type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/sections/dxccmap.js'); ?>" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "statistics" && $this->uri->segment(2) == "") { ?> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chart.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chartjs-plugin-piechart-outlabels.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/statistics.js"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/chart.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/chartjs-plugin-piechart-outlabels.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/sections/statistics.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "continents") { ?> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chart.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chartjs-plugin-piechart-outlabels.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/continents.js"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/chart.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/chartjs-plugin-piechart-outlabels.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/sections/continents.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "adif" || $this->uri->segment(1) == "qrz" || $this->uri->segment(1) == "hrdlog" || $this->uri->segment(1) == "webadif" || $this->uri->segment(1) == "sattimers") { ?> <!-- Javascript used for ADIF Import and Export Areas --> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/moment.min.js"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/moment.min.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "adif" ) { ?> - <script src="<?php echo base_url() ;?>assets/js/sections/adif.js"></script> - <script src="<?php echo base_url() ;?>assets/js/jszip.min.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/adif.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/jszip.min.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "notes" && ($this->uri->segment(2) == "add" || $this->uri->segment(2) == "edit") ) { ?> <!-- Javascript used for Notes Area --> - <script src="<?php echo base_url() ;?>assets/plugins/quill/quill.min.js"></script> - <script src="<?php echo base_url() ;?>assets/js/sections/notes.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/plugins/quill/quill.min.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/notes.js'); ?>"></script> <?php } ?> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/datatables.min.js"></script> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/dataTables.buttons.min.js"></script> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/buttons.html5.min.js"></script> -<script type="text/javascript" src="<?php echo base_url();?>assets/js/selectize.js"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/datatables.min.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/dataTables.buttons.min.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/buttons.html5.min.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/selectize.js'); ?>"></script> <?php if ($this->uri->segment(1) == "station") { ?> - <script language="javascript" src="<?php echo base_url() ;?>assets/js/HamGridSquare.js"></script> - <script src="<?php echo base_url() ;?>assets/js/sections/station_locations.js"></script> - <script src="<?php echo base_url() ;?>assets/js/bootstrap-multiselect.js"></script> + <script language="javascript" src="<?php echo $this->paths->cache_buster('/assets/js/HamGridSquare.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/station_locations.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/bootstrap-multiselect.js'); ?>"></script> <script> var position; function getLocation() { @@ -270,7 +270,7 @@ if($this->session->userdata('user_id') != null) { <?php } ?> <?php if ($this->uri->segment(1) == "logbooks") { ?> - <script src="<?php echo base_url() ;?>assets/js/sections/station_logbooks.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/station_logbooks.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "debug") { ?> @@ -321,7 +321,7 @@ $(function () { <?php if ($this->uri->segment(1) == "search" && $this->uri->segment(2) == "filter") { ?> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/query-builder.standalone.min.js"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/query-builder.standalone.min.js'); ?>"></script> <script type="text/javascript"> $(".search-results-box").hide(); @@ -766,8 +766,8 @@ function showActivatorsMap(call, count, grids) { </script> <?php if ($this->uri->segment(1) == "" || $this->uri->segment(1) == "dashboard" ) { ?> - <script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.Maidenhead.js"></script> - <script id="leafembed" type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/leafembed.js" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/L.Maidenhead.js'); ?>"></script> + <script id="leafembed" type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/leafembed.js'); ?>" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script> <script type="text/javascript"> $(function () { @@ -919,8 +919,8 @@ $($('#callsign')).on('keypress',function(e) { <?php } ?> <?php if ($this->uri->segment(1) == "logbook" && $this->uri->segment(2) != "view") { ?> - <script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.Maidenhead.js"></script> - <script id="leafembed" type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/leafembed.js" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/L.Maidenhead.js'); ?>"></script> + <script id="leafembed" type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/leafembed.js'); ?>" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script> <script type="text/javascript"> $(function () { $('[data-bs-toggle="tooltip"]').tooltip() @@ -950,10 +950,10 @@ $($('#callsign')).on('keypress',function(e) { <?php if ($this->uri->segment(1) == "qso") { ?> -<script src="<?php echo base_url() ;?>assets/js/sections/qso.js"></script> -<script src="<?php echo base_url() ;?>assets/js/bootstrap-multiselect.js"></script> +<script src="<?php echo $this->paths->cache_buster('/assets/js/sections/qso.js'); ?>"></script> +<script src="<?php echo $this->paths->cache_buster('/assets/js/bootstrap-multiselect.js'); ?>"></script> <?php if ($this->session->userdata('isWinkeyEnabled')) { ?> - <script src="<?php echo base_url() ;?>assets/js/winkey.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/winkey.js'); ?>"></script> <?php } ?> <script type="text/javascript"> var dxcluster_provider = '<?php echo base_url(); ?>index.php/dxcluster'; @@ -1159,9 +1159,9 @@ $($('#callsign')).on('keypress',function(e) { <?php } ?> <?php if ( $this->uri->segment(1) == "qso" || ($this->uri->segment(1) == "contesting" && $this->uri->segment(2) != "add")) { ?> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/qrg_handler.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/moment.min.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/datetime-moment.js"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/sections/qrg_handler.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/moment.min.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/datetime-moment.js'); ?>"></script> <script> $( document ).ready(function() { @@ -1365,7 +1365,7 @@ $(document).ready(function(){ <?php if ($this->uri->segment(1) == "gridsquares" && !empty($this->uri->segment(2))) { ?> <script>var gridsquaremap = true;</script> -<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.MaidenheadColoured.js"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/L.MaidenheadColoured.js'); ?>"></script> <script> @@ -1517,7 +1517,7 @@ $(document).ready(function(){ <?php if ($this->uri->segment(1) == "activated_grids" && !empty($this->uri->segment(2))) { ?> -<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.MaidenheadColoured.js"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/L.MaidenheadColoured.js'); ?>"></script> <script> var layer = L.tileLayer('<?php echo $this->optionslib->get_option('option_map_tile_server');?>', { @@ -1655,27 +1655,27 @@ $(document).ready(function(){ <?php } ?> <?php if ($this->uri->segment(1) == "dayswithqso") { ?> - <script src="<?php echo base_url(); ?>assets/js/chart.js"></script> - <script src="<?php echo base_url(); ?>assets/js/sections/dayswithqso.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/chart.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/dayswithqso.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "distances") { ?> - <script src="<?php echo base_url(); ?>assets/js/highstock.js"></script> - <script src="<?php echo base_url(); ?>assets/js/highstock/exporting.js"></script> - <script src="<?php echo base_url(); ?>assets/js/highstock/offline-exporting.js"></script> - <script src="<?php echo base_url(); ?>assets/js/highstock/export-data.js"></script> - <script src="<?php echo base_url(); ?>assets/js/sections/distances.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/highstock.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/highstock/exporting.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/highstock/offline-exporting.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/highstock/export-data.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/distances.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "hrdlog") { ?> - <script src="<?php echo base_url(); ?>assets/js/sections/hrdlog.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/hrdlog.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "qrz") { ?> - <script src="<?php echo base_url(); ?>assets/js/sections/qrzlogbook.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/qrzlogbook.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "webadif") { ?> - <script src="<?php echo base_url(); ?>assets/js/sections/webadif.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/webadif.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(2) == "dxcc") { ?> @@ -2014,7 +2014,7 @@ $(document).ready(function(){ } function displayTimelineContacts(querystring, band, mode, propmode, type) { - var baseURL= "<?php echo base_url();?>"; + var baseURL= "<?php echo base_url(); ?>"; $.ajax({ url: baseURL + 'index.php/timeline/details', type: 'post', @@ -2052,24 +2052,24 @@ $(document).ready(function(){ <?php if ($this->uri->segment(1) == "mode") { ?> - <script src="<?php echo base_url(); ?>assets/js/sections/mode.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/mode.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "band") { ?> - <script src="<?php echo base_url(); ?>assets/js/sections/bands.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/bands.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "accumulated") { ?> - <script src="<?php echo base_url(); ?>assets/js/chart.js"></script> - <script src="<?php echo base_url(); ?>assets/js/sections/accumulatedstatistics.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/chart.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/accumulatedstatistics.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "timeplotter") { ?> - <script src="<?php echo base_url(); ?>assets/js/highstock.js"></script> - <script src="<?php echo base_url(); ?>assets/js/highstock/exporting.js"></script> - <script src="<?php echo base_url(); ?>assets/js/highstock/offline-exporting.js"></script> - <script src="<?php echo base_url(); ?>assets/js/highstock/export-data.js"></script> - <script src="<?php echo base_url(); ?>assets/js/sections/timeplot.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/highstock.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/highstock/exporting.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/highstock/offline-exporting.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/highstock/export-data.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/timeplot.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "qsl" || $this->uri->segment(1) == "eqsl") { @@ -2095,8 +2095,8 @@ $(document).ready(function(){ } ?> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/moment.min.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/datetime-moment.js"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/moment.min.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/datetime-moment.js'); ?>"></script> <script> $.fn.dataTable.moment('<?php echo $usethisformat ?>'); $.fn.dataTable.ext.buttons.clear = { @@ -2206,7 +2206,7 @@ function deleteQsl(id) { <script> function viewEqsl(picture, callsign) { var webpath_eqsl = '<?php echo $this->paths->getPathEqsl(); ?>'; - var baseURL= "<?php echo base_url();?>"; + var baseURL= "<?php echo base_url(); ?>"; var $textAndPic = $('<div></div>'); $textAndPic.append('<img class="img-fluid" style="height:auto;width:auto;"src="'+baseURL+webpath_eqsl+'/'+picture+'" />'); var title = ''; @@ -2539,7 +2539,7 @@ function viewEqsl(picture, callsign) { } function displayCountyContacts(state, county) { - var baseURL= "<?php echo base_url();?>"; + var baseURL= "<?php echo base_url(); ?>"; $.ajax({ url: baseURL + 'index.php/awards/counties_details_ajax', type: 'post', @@ -2594,11 +2594,11 @@ function viewEqsl(picture, callsign) { <?php } ?> <?php if ($this->uri->segment(1) == "contesting" && $this->uri->segment(2) == "add") { ?> - <script src="<?php echo base_url() ;?>assets/js/sections/contestingnames.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/contestingnames.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "themes") { ?> - <script src="<?php echo base_url() ;?>assets/js/sections/themes.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/themes.js'); ?>"></script> <?php } ?> @@ -2622,8 +2622,8 @@ function viewEqsl(picture, callsign) { <?php } ?> <?php if ($this->uri->segment(1) == "distancerecords") { ?> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/moment.min.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/datetime-moment.js"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/moment.min.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/datetime-moment.js'); ?>"></script> <script> $.fn.dataTable.moment('<?php echo $usethisformat ?>'); $.fn.dataTable.ext.buttons.clear = { @@ -2706,8 +2706,8 @@ function viewEqsl(picture, callsign) { } ?> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/moment.min.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/datetime-moment.js"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/moment.min.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/datetime-moment.js'); ?>"></script> <?php if ($this->uri->segment(2) == "wwff") { ?> <script> $.fn.dataTable.moment('<?php echo $usethisformat ?>'); @@ -2847,7 +2847,7 @@ function viewEqsl(picture, callsign) { <?php } ?> <?php if ($this->uri->segment(1) == "user") { ?> - <script src="<?php echo base_url() ;?>assets/js/sections/user.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/user.js'); ?>"></script> <?php } ?> <?php diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 3af9a2ab4..99c22f8d9 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -8,50 +8,50 @@ <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="default"> - <link rel="manifest" href="<?php echo $this->paths->cache_buster('manifest.json'); ?>" /> + <link rel="manifest" href="<?php echo $this->paths->cache_buster('/manifest.json'); ?>" /> - <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('assets/css/buttons.dataTables.min.css'); ?>" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/css/buttons.dataTables.min.css'); ?>" /> - <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('assets/css/datatables.min.css'); ?>" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/css/datatables.min.css'); ?>" /> <!-- Bootstrap CSS --> <?php $theme = $this->optionslib->get_theme(); if ($theme) { ?> - <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('assets/css/bootstrap-multiselect.css'); ?>"> - <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('assets/css/'.$theme.'/bootstrap.min.css'); ?>"> - <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('assets/css/general.css'); ?>"> - <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('assets/css/selectize.bootstrap4.css'); ?>" /> - <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('assets/css/bootstrap-dialog.css'); ?>" /> - <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('assets/css/'.$theme.'/overrides.css'); ?>"> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/bootstrap-multiselect.css'); ?>"> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/'.$theme.'/bootstrap.min.css'); ?>"> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/general.css'); ?>"> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/selectize.bootstrap4.css'); ?>" /> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/bootstrap-dialog.css'); ?>" /> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/'.$theme.'/overrides.css'); ?>"> <?php } ?> - <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('assets/fontawesome/css/all.min.css'); ?>"> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/fontawesome/css/all.min.css'); ?>"> - <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('assets/css/jquery.fancybox.min.css'); ?>" /> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/jquery.fancybox.min.css'); ?>" /> <!-- Maps --> - <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('assets/js/leaflet/leaflet.css'); ?>" /> - <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('assets/js/leaflet/Control.FullScreen.css'); ?>" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/js/leaflet/leaflet.css'); ?>" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/js/leaflet/Control.FullScreen.css'); ?>" /> <?php if ($this->uri->segment(1) == "search" && $this->uri->segment(2) == "filter") { ?> - <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('assets/css/query-builder.default.min.css'); ?>" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/css/query-builder.default.min.css'); ?>" /> <?php } ?> <?php if ($this->uri->segment(1) == "notes" && ($this->uri->segment(2) == "add" || $this->uri->segment(2) == "edit")) { ?> - <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('assets/plugins/quill/quill.snow.css'); ?>" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/plugins/quill/quill.snow.css'); ?>" /> <?php } ?> - <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('assets/css/loading.min.css'); ?>" /> - <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('assets/css/ldbtn.min.css'); ?>" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/css/loading.min.css'); ?>" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/css/ldbtn.min.css'); ?>" /> <?php if ($this->uri->segment(1) == "sattimers") { ?> - <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('assets/css/sattimers.css'); ?>" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/css/sattimers.css'); ?>" /> <?php } ?> <?php if (file_exists(APPPATH . '../assets/css/custom.css')) { ?> - <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('assets/css/custom.css'); ?>" /> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/custom.css'); ?>" /> <?php } ?> <script> @@ -68,10 +68,10 @@ </script> <?php if (file_exists(APPPATH . '../assets/js/sections/custom.js')) { ?> - <script src="<?php echo $this->paths->cache_buster('assets/js/sections/custom.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/custom.js'); ?>"></script> <?php } ?> - <link rel="icon" href="<?php echo $this->paths->cache_buster('favicon.ico'); ?>"> + <link rel="icon" href="<?php echo $this->paths->cache_buster('/favicon.ico'); ?>"> <title><?php if (isset($page_title)) { echo $page_title; @@ -81,7 +81,7 @@ <body dir="<?php echo $language['direction']; ?>"> <nav class="navbar navbar-expand-lg navbar-light bg-light main-nav" id="header-menu"> <div class="container"> - <a class="navbar-brand" href="<?php echo site_url(); ?>"><img class="headerLogo" src="<?php echo $this->paths->cache_buster('assets/logo/'. $this->optionslib->get_logo('header_logo').'.png'); ?>" alt="Logo" /></a> + <a class="navbar-brand" href="<?php echo site_url(); ?>"><img class="headerLogo" src="<?php echo $this->paths->cache_buster('/assets/logo/'. $this->optionslib->get_logo('header_logo').'.png'); ?>" alt="Logo" /></a> <?php if (ENVIRONMENT == "development") { ?> <span class="badge text-bg-danger"><?= __("Developer Mode"); ?></span> <?php } ?> From 9f0be163b4cee04a9c9ac852c14987a50520db9c Mon Sep 17 00:00:00 2001 From: HB9HIL <fabian.berg@hb9hil.org> Date: Tue, 10 Dec 2024 20:00:52 +0100 Subject: [PATCH 05/17] debugging --- application/libraries/Paths.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/Paths.php b/application/libraries/Paths.php index c5e72205b..2b70ef3d2 100644 --- a/application/libraries/Paths.php +++ b/application/libraries/Paths.php @@ -38,7 +38,7 @@ class Paths if (file_exists($fullpath)) { return base_url($filepath) . '?v=' . filemtime($fullpath); } else { - log_message('debug', 'File does not exist: ' . $fullpath); + log_message('debug', 'File does not exist: ' . $fullpath . '; Search in code for: ' . $filepath); } return base_url($filepath); } From 13ad1b9e1194aee11856808098533e3e5ce86633 Mon Sep 17 00:00:00 2001 From: HB9HIL <fabian.berg@hb9hil.org> Date: Tue, 10 Dec 2024 20:02:34 +0100 Subject: [PATCH 06/17] only show filepath --- application/libraries/Paths.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/Paths.php b/application/libraries/Paths.php index 2b70ef3d2..34aa5097b 100644 --- a/application/libraries/Paths.php +++ b/application/libraries/Paths.php @@ -38,7 +38,7 @@ class Paths if (file_exists($fullpath)) { return base_url($filepath) . '?v=' . filemtime($fullpath); } else { - log_message('debug', 'File does not exist: ' . $fullpath . '; Search in code for: ' . $filepath); + log_message('debug', 'File does not exist: ' . $filepath); } return base_url($filepath); } From 605b2967524bf6496d32848659f12c8b1308f0be Mon Sep 17 00:00:00 2001 From: HB9HIL <fabian.berg@hb9hil.org> Date: Tue, 10 Dec 2024 20:03:05 +0100 Subject: [PATCH 07/17] adjust log_message --- application/libraries/Paths.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/Paths.php b/application/libraries/Paths.php index 34aa5097b..15841feaf 100644 --- a/application/libraries/Paths.php +++ b/application/libraries/Paths.php @@ -38,7 +38,7 @@ class Paths if (file_exists($fullpath)) { return base_url($filepath) . '?v=' . filemtime($fullpath); } else { - log_message('debug', 'File does not exist: ' . $filepath); + log_message('error', 'CACHE BUSTER - File does not exist: ' . $filepath); } return base_url($filepath); } From 82cc0cf99d0d0a4a81f75cc7c1bb3d6ed9d8af7b Mon Sep 17 00:00:00 2001 From: HB9HIL <fabian.berg@hb9hil.org> Date: Fri, 13 Feb 2026 16:58:57 +0100 Subject: [PATCH 08/17] remove filemtime from single js loads and load it global in the footerdata script by using the cache_buster --- application/controllers/Activated_gridmap.php | 4 +-- application/controllers/Activators.php | 2 +- application/controllers/Awards.php | 28 +++++++++---------- application/controllers/Band.php | 2 +- application/controllers/Bandmap.php | 14 +++++----- application/controllers/Callstats.php | 2 +- application/controllers/Calltester.php | 2 +- application/controllers/Club.php | 2 +- application/controllers/Clublog.php | 2 +- application/controllers/Contestcalendar.php | 2 +- application/controllers/Contesting.php | 6 ++-- application/controllers/Cron.php | 4 +-- application/controllers/Dashboard.php | 4 +-- application/controllers/Dxcalendar.php | 2 +- application/controllers/Generic_qsl.php | 4 +-- application/controllers/Gridmap.php | 6 ++-- application/controllers/Hamsat.php | 2 +- application/controllers/Logbookadvanced.php | 16 +++++------ application/controllers/Map.php | 6 ++-- application/controllers/Qsl.php | 2 +- application/controllers/Radio.php | 2 +- application/controllers/Satellite.php | 14 +++++----- application/controllers/Simplefle.php | 2 +- application/controllers/Stationsetup.php | 2 +- application/controllers/Statistics.php | 8 +++--- application/controllers/User.php | 6 ++-- application/views/interface_assets/footer.php | 2 +- 27 files changed, 74 insertions(+), 74 deletions(-) diff --git a/application/controllers/Activated_gridmap.php b/application/controllers/Activated_gridmap.php index f105f149f..4e09f162c 100644 --- a/application/controllers/Activated_gridmap.php +++ b/application/controllers/Activated_gridmap.php @@ -44,8 +44,8 @@ class Activated_gridmap extends CI_Controller { $footerData['scripts'] = [ 'assets/js/leaflet/geocoding.js', 'assets/js/leaflet/L.MaidenheadColouredGridMap.js', - 'assets/js/sections/gridmap.js?', - 'assets/js/bootstrap-multiselect.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/bootstrap-multiselect.js")), + 'assets/js/sections/gridmap.js', + 'assets/js/bootstrap-multiselect.js', ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Activators.php b/application/controllers/Activators.php index 652833dc6..d1d8315bc 100644 --- a/application/controllers/Activators.php +++ b/application/controllers/Activators.php @@ -50,7 +50,7 @@ class Activators extends CI_Controller $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/activators.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/activators.js")), + 'assets/js/sections/activators.js', ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index bdd98ac16..3379dc64a 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -277,7 +277,7 @@ class Awards extends CI_Controller { public function waja () { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/wajamap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/wajamap.js")), + 'assets/js/sections/wajamap.js', 'assets/js/leaflet/L.Maidenhead.js', ]; @@ -357,8 +357,8 @@ class Awards extends CI_Controller { public function jcc () { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/jcc.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/jcc.js")), - 'assets/js/sections/jccmap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/jccmap.js")) + 'assets/js/sections/jcc.js', + 'assets/js/sections/jccmap.js' ]; $this->load->model('jcc_model'); @@ -637,8 +637,8 @@ class Awards extends CI_Controller { public function cq() { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/cqmap_geojson.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/cqmap_geojson.js")), - 'assets/js/sections/cqmap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/cqmap.js")) + 'assets/js/sections/cqmap_geojson.js', + 'assets/js/sections/cqmap.js' ]; $this->load->model('logbooks_model'); @@ -713,7 +713,7 @@ class Awards extends CI_Controller { public function was() { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/wasmap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/wasmap.js")), + 'assets/js/sections/wasmap.js', 'assets/js/leaflet/L.Maidenhead.js', ]; @@ -775,7 +775,7 @@ class Awards extends CI_Controller { public function rac() { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/racmap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/racmap.js")), + 'assets/js/sections/racmap.js', 'assets/js/leaflet/L.Maidenhead.js', ]; @@ -837,7 +837,7 @@ class Awards extends CI_Controller { public function helvetia() { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/helvetiamap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/helvetiamap.js")), + 'assets/js/sections/helvetiamap.js', 'assets/js/leaflet/L.Maidenhead.js', ]; @@ -1367,7 +1367,7 @@ class Awards extends CI_Controller { public function wap() { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/wapmap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/wapmap.js")), + 'assets/js/sections/wapmap.js', 'assets/js/leaflet/L.Maidenhead.js', ]; @@ -1895,7 +1895,7 @@ class Awards extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/wab.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/wab.js")) + 'assets/js/sections/wab.js' ]; // Render page @@ -1975,8 +1975,8 @@ class Awards extends CI_Controller { public function itu() { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/itumap_geojson.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/itumap_geojson.js")), - 'assets/js/sections/itumap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/itumap.js")) + 'assets/js/sections/itumap_geojson.js', + 'assets/js/sections/itumap.js' ]; $this->load->model('logbooks_model'); @@ -2271,7 +2271,7 @@ class Awards extends CI_Controller { public function wpx () { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/wpx.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/wpx.js")), + 'assets/js/sections/wpx.js', ]; $this->load->model('wpx'); @@ -2385,7 +2385,7 @@ class Awards extends CI_Controller { public function pl_polska() { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/award_pl_polska.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/award_pl_polska.js")), + 'assets/js/sections/award_pl_polska.js', 'assets/js/leaflet/L.Maidenhead.js', ]; diff --git a/application/controllers/Band.php b/application/controllers/Band.php index 3afe7ef72..181287cef 100644 --- a/application/controllers/Band.php +++ b/application/controllers/Band.php @@ -36,7 +36,7 @@ class Band extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/bandedges.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/bandedges.js")), + 'assets/js/sections/bandedges.js', ]; // Render Page diff --git a/application/controllers/Bandmap.php b/application/controllers/Bandmap.php index 15788d870..4c4b6fcd9 100644 --- a/application/controllers/Bandmap.php +++ b/application/controllers/Bandmap.php @@ -41,13 +41,13 @@ class Bandmap extends CI_Controller { $footerData = []; $footerData['scripts'] = [ 'assets/js/moment.min.js', - 'assets/js/datetime-moment.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/datetime-moment.js")), - 'assets/js/cat.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/cat.js")), - 'assets/js/leaflet/leaflet.geodesic.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/leaflet/leaflet.geodesic.js")), - 'assets/js/leaflet.polylineDecorator.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/leaflet.polylineDecorator.js")), - 'assets/js/leaflet/L.Terminator.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/leaflet/L.Terminator.js")), - 'assets/js/sections/callstats.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/callstats.js")), - 'assets/js/sections/bandmap_list.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/bandmap_list.js")), + 'assets/js/datetime-moment.js', + 'assets/js/cat.js', + 'assets/js/leaflet/leaflet.geodesic.js', + 'assets/js/leaflet.polylineDecorator.js', + 'assets/js/leaflet/L.Terminator.js', + 'assets/js/sections/callstats.js', + 'assets/js/sections/bandmap_list.js', ]; // Get Date format diff --git a/application/controllers/Callstats.php b/application/controllers/Callstats.php index b813a60d1..e80cb1c68 100644 --- a/application/controllers/Callstats.php +++ b/application/controllers/Callstats.php @@ -74,7 +74,7 @@ class Callstats extends CI_Controller $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/callstats.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/callstats.js")), + 'assets/js/sections/callstats.js', ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Calltester.php b/application/controllers/Calltester.php index f1088151e..9280f14e2 100644 --- a/application/controllers/Calltester.php +++ b/application/controllers/Calltester.php @@ -26,7 +26,7 @@ class Calltester extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/calltester.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/calltester.js")) + 'assets/js/sections/calltester.js', ]; $data['page_title'] = __("Call Tester"); diff --git a/application/controllers/Club.php b/application/controllers/Club.php index eb8daf0e6..8b7a08de5 100644 --- a/application/controllers/Club.php +++ b/application/controllers/Club.php @@ -61,7 +61,7 @@ class Club extends CI_Controller $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/club_permissions.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/club_permissions.js")), + 'assets/js/sections/club_permissions.js', ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Clublog.php b/application/controllers/Clublog.php index 47dab8ebb..163d32b9c 100644 --- a/application/controllers/Clublog.php +++ b/application/controllers/Clublog.php @@ -96,7 +96,7 @@ class Clublog extends CI_Controller $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/clublog.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/clublog.js")), + 'assets/js/sections/clublog.js', ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Contestcalendar.php b/application/controllers/Contestcalendar.php index 6979a21af..9a9e1ce9a 100644 --- a/application/controllers/Contestcalendar.php +++ b/application/controllers/Contestcalendar.php @@ -36,7 +36,7 @@ class Contestcalendar extends CI_Controller { } $footerData['scripts'] = [ - 'assets/js/sections/dxcalendar.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/dxcalendar.js")) + 'assets/js/sections/dxcalendar.js' ]; } else { $data['contestsToday']=''; diff --git a/application/controllers/Contesting.php b/application/controllers/Contesting.php index 63ebe9c47..94e44ed13 100644 --- a/application/controllers/Contesting.php +++ b/application/controllers/Contesting.php @@ -45,7 +45,7 @@ class Contesting extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/contesting.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/contesting.js")), + 'assets/js/sections/contesting.js', ]; $this->load->library('form_validation'); @@ -121,7 +121,7 @@ class Contesting extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/contesting.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/contesting.js")), + 'assets/js/sections/contesting.js', ]; // Render Page @@ -143,7 +143,7 @@ class Contesting extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/contesting.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/contesting.js")), + 'assets/js/sections/contesting.js', ]; $this->form_validation->set_rules('name', 'Contest Name', 'required'); diff --git a/application/controllers/Cron.php b/application/controllers/Cron.php index 20a489f13..d318048bc 100644 --- a/application/controllers/Cron.php +++ b/application/controllers/Cron.php @@ -31,8 +31,8 @@ class cron extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/cronstrue.min.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/cronstrue.min.js")), - 'assets/js/sections/cron.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/cron.js")) + 'assets/js/cronstrue.min.js', + 'assets/js/sections/cron.js' ]; $data['page_title'] = __("Cron Manager"); diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index 02bab2fb5..a7a04fd89 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -160,7 +160,7 @@ class Dashboard extends CI_Controller { $dxcc = $this->dxcc->list_current(); $footerData['scripts'] = [ - 'assets/js/sections/dashboard.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/dashboard.js")), + 'assets/js/sections/dashboard.js', ]; // First Login Wizard @@ -189,7 +189,7 @@ class Dashboard extends CI_Controller { $this->load->model('dxcc'); $viewdata['dxcc_list'] = $this->dxcc->list(); - $footerData['scripts'][] = 'assets/js/bootstrap-multiselect.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/bootstrap-multiselect.js")); + $footerData['scripts'][] = 'assets/js/bootstrap-multiselect.js'; $this->load->library('form_validation'); diff --git a/application/controllers/Dxcalendar.php b/application/controllers/Dxcalendar.php index ea024e577..1d0e23075 100644 --- a/application/controllers/Dxcalendar.php +++ b/application/controllers/Dxcalendar.php @@ -85,7 +85,7 @@ class Dxcalendar extends CI_Controller { $footerData['scripts'] = [ - 'assets/js/sections/dxcalendar.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/dxcalendar.js")) + 'assets/js/sections/dxcalendar.js' ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Generic_qsl.php b/application/controllers/Generic_qsl.php index 37198bdd1..ba773ef6f 100644 --- a/application/controllers/Generic_qsl.php +++ b/application/controllers/Generic_qsl.php @@ -21,8 +21,8 @@ class Generic_qsl extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/bootstrap-multiselect.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/bootstrap-multiselect.js")), - 'assets/js/sections/qsl.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/qsl.js")), + 'assets/js/bootstrap-multiselect.js', + 'assets/js/sections/qsl.js', ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Gridmap.php b/application/controllers/Gridmap.php index 9beae0b32..b12df12d1 100644 --- a/application/controllers/Gridmap.php +++ b/application/controllers/Gridmap.php @@ -46,9 +46,9 @@ class Gridmap extends CI_Controller { 'assets/js/leaflet/geocoding.js', 'assets/js/sections/gridmap.js?', 'assets/js/leaflet/L.MaidenheadColouredGridMap.js', - 'assets/js/sections/itumap_geojson.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/itumap_geojson.js")), - 'assets/js/sections/cqmap_geojson.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/cqmap_geojson.js")), - 'assets/js/bootstrap-multiselect.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/bootstrap-multiselect.js")), + 'assets/js/sections/itumap_geojson.js', + 'assets/js/sections/cqmap_geojson.js', + 'assets/js/bootstrap-multiselect.js', ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Hamsat.php b/application/controllers/Hamsat.php index 306ec89e0..9ccfb4e77 100644 --- a/application/controllers/Hamsat.php +++ b/application/controllers/Hamsat.php @@ -15,7 +15,7 @@ class Hamsat extends CI_Controller { public function index() { $data['scripts'] = [ - 'assets/js/sections/hamsat.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/hamsat.js")), + 'assets/js/sections/hamsat.js', 'assets/js/moment.min.js', 'assets/js/datetime-moment.js' ]; diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 0e1e34f1d..35d04ef01 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -91,15 +91,15 @@ class Logbookadvanced extends CI_Controller { $footerData['scripts'] = [ 'assets/js/moment.min.js', 'assets/js/datetime-moment.js', - 'assets/js/sections/logbookadvanced.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/logbookadvanced.js")), - 'assets/js/sections/logbookadvanced_edit.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/logbookadvanced_edit.js")), - 'assets/js/sections/logbookadvanced_map.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/logbookadvanced_map.js")), - 'assets/js/sections/cqmap_geojson.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/cqmap_geojson.js")), - 'assets/js/sections/itumap_geojson.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/itumap_geojson.js")), - 'assets/js/leaflet/L.Terminator.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/leaflet/L.Terminator.js")), + 'assets/js/sections/logbookadvanced.js', + 'assets/js/sections/logbookadvanced_edit.js', + 'assets/js/sections/logbookadvanced_map.js', + 'assets/js/sections/cqmap_geojson.js', + 'assets/js/sections/itumap_geojson.js', + 'assets/js/leaflet/L.Terminator.js', 'assets/js/leaflet/geocoding.js', - 'assets/js/globe/globe.gl.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/globe/globe.gl.js")), - 'assets/js/bootstrap-multiselect.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/bootstrap-multiselect.js")), + 'assets/js/globe/globe.gl.js', + 'assets/js/bootstrap-multiselect.js', 'assets/js/leaflet/L.MaidenheadColouredGridMap.js', ]; diff --git a/application/controllers/Map.php b/application/controllers/Map.php index cc3c3838c..41ba2ff2b 100644 --- a/application/controllers/Map.php +++ b/application/controllers/Map.php @@ -51,9 +51,9 @@ class Map extends CI_Controller { $footerData['scripts'] = [ 'assets/js/leaflet/geocoding.js', 'assets/js/leaflet/L.Maidenhead.js', - 'assets/js/sections/qso_map.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/qso_map.js")), - 'assets/js/sections/itumap_geojson.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/itumap_geojson.js")), - 'assets/js/sections/cqmap_geojson.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/cqmap_geojson.js")), + 'assets/js/sections/qso_map.js', + 'assets/js/sections/itumap_geojson.js', + 'assets/js/sections/cqmap_geojson.js', ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Qsl.php b/application/controllers/Qsl.php index c93d3e4e3..91b22e91d 100644 --- a/application/controllers/Qsl.php +++ b/application/controllers/Qsl.php @@ -27,7 +27,7 @@ class Qsl extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/qsl.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/qsl.js")), + 'assets/js/sections/qsl.js', ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Radio.php b/application/controllers/Radio.php index 2af84a353..a4ebc4543 100644 --- a/application/controllers/Radio.php +++ b/application/controllers/Radio.php @@ -18,7 +18,7 @@ class Radio extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/radio.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/radio.js")), + 'assets/js/sections/radio.js', ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Satellite.php b/application/controllers/Satellite.php index f3b887011..658e8560d 100644 --- a/application/controllers/Satellite.php +++ b/application/controllers/Satellite.php @@ -34,7 +34,7 @@ class Satellite extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/satellite.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/satellite.js")), + 'assets/js/sections/satellite.js', ]; // Render Page @@ -184,10 +184,10 @@ class Satellite extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/satellite.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/satellite.js")), - 'assets/js/sections/three-orbit-controls.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/three-orbit-controls.js")), - 'assets/js/sections/satellite_functions.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/satellite_functions.js")), - 'assets/js/sections/flightpath.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/flightpath.js")), + 'assets/js/sections/satellite.js', + 'assets/js/sections/three-orbit-controls.js', + 'assets/js/sections/satellite_functions.js', + 'assets/js/sections/flightpath.js', 'assets/js/leaflet/L.Maidenhead.js', 'assets/js/leaflet/geocoding.js', ]; @@ -245,8 +245,8 @@ class Satellite extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/bootstrap-multiselect.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/bootstrap-multiselect.js")), - 'assets/js/sections/satpasses.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/satpasses.js")), + 'assets/js/bootstrap-multiselect.js', + 'assets/js/sections/satpasses.js', ]; // Render Page diff --git a/application/controllers/Simplefle.php b/application/controllers/Simplefle.php index 5cbd7e3f6..51b142677 100644 --- a/application/controllers/Simplefle.php +++ b/application/controllers/Simplefle.php @@ -27,7 +27,7 @@ class SimpleFLE extends CI_Controller { $footerData['scripts'] = [ 'assets/js/moment.min.js', 'assets/js/datetime-moment.js', - 'assets/js/sections/simplefle.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/simplefle.js")) + 'assets/js/sections/simplefle.js' ]; $this->load->view('interface_assets/header', $data); diff --git a/application/controllers/Stationsetup.php b/application/controllers/Stationsetup.php index 9b7456365..4fdcd50f6 100644 --- a/application/controllers/Stationsetup.php +++ b/application/controllers/Stationsetup.php @@ -32,7 +32,7 @@ class Stationsetup extends CI_Controller { $footerData['scripts'] = [ 'assets/js/moment.min.js', 'assets/js/datetime-moment.js', - 'assets/js/sections/stationsetup.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/stationsetup.js")), + 'assets/js/sections/stationsetup.js', ]; // Get Date format diff --git a/application/controllers/Statistics.php b/application/controllers/Statistics.php index 074f0383a..328d2c620 100644 --- a/application/controllers/Statistics.php +++ b/application/controllers/Statistics.php @@ -321,9 +321,9 @@ class Statistics extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/chart.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/chart.js")), - 'assets/js/sections/antennastats.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/antennastats.js")), - 'assets/js/bootstrap-multiselect.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/bootstrap-multiselect.js")), + 'assets/js/chart.js', + 'assets/js/sections/antennastats.js', + 'assets/js/bootstrap-multiselect.js', ]; // Load Views @@ -389,7 +389,7 @@ class Statistics extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/initials.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/initials.js")), + 'assets/js/sections/initials.js', ]; // Load Views diff --git a/application/controllers/User.php b/application/controllers/User.php index 92631c434..34069fe54 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -44,7 +44,7 @@ class User extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/user.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/user.js")), + 'assets/js/sections/user.js', ]; $data['page_title'] = __("User Accounts"); @@ -174,7 +174,7 @@ class User extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/user.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/user.js")), + 'assets/js/sections/user.js', ]; // Get timezones @@ -418,7 +418,7 @@ class User extends CI_Controller { $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/user.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/user.js")), + 'assets/js/sections/user.js', ]; // Get timezones diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 2ee03283d..85b1cff33 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -3240,7 +3240,7 @@ function viewEqsl(picture, callsign) { <?php if (isset($scripts) && is_array($scripts)){ foreach($scripts as $script){ - ?><script type="text/javascript" src="<?php echo base_url() . $script ;?>"></script> + ?><script type="text/javascript" src="<?php echo $this->paths->cache_buster('/'.$script); ?>"></script> <?php } } From 74d56d5f45836a5c0eeb0af48dbe48072319ecd6 Mon Sep 17 00:00:00 2001 From: HB9HIL <fabian.berg@hb9hil.org> Date: Fri, 13 Feb 2026 17:04:57 +0100 Subject: [PATCH 09/17] check for / in filepath to make sure path doesn't get broken --- application/libraries/Paths.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/libraries/Paths.php b/application/libraries/Paths.php index 15841feaf..3afaaccc7 100644 --- a/application/libraries/Paths.php +++ b/application/libraries/Paths.php @@ -34,11 +34,14 @@ class Paths } function cache_buster($filepath) { + // make sure $filepath starts with a slash + if (substr($filepath, 0, 1) !== '/') $filepath = '/' . $filepath; + $fullpath = $_SERVER['DOCUMENT_ROOT'] . $filepath; if (file_exists($fullpath)) { return base_url($filepath) . '?v=' . filemtime($fullpath); } else { - log_message('error', 'CACHE BUSTER - File does not exist: ' . $filepath); + log_message('error', 'CACHE BUSTER: File does not exist: ' . $fullpath); } return base_url($filepath); } From 6aa5321f973f0174494fbaea24de77282fbfc863 Mon Sep 17 00:00:00 2001 From: HB9HIL <fabian.berg@hb9hil.org> Date: Fri, 13 Feb 2026 17:07:57 +0100 Subject: [PATCH 10/17] fix notes js --- application/views/interface_assets/footer.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 85b1cff33..f8094c46a 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -370,12 +370,6 @@ function stopImpersonate_modal() { <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/notes.js'); ?>"></script> <?php } ?> -<?php if ($this->uri->segment(1) == "notes" && ($this->uri->segment(2) == "view") ) { ?> - <!-- Javascript used for Notes Area --> - <script src="<?php echo $this->paths->cache_buster('/assets/plugins/easymde/easymde.min.js'); ?>"></script> - <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/notes_view.js'); ?>"></script> -<?php } ?> - <?php if ($this->uri->segment(1) == "qso" ) { ?> <!-- Javascript used for QSO Notes Area --> <script src="<?php echo base_url() ;?>assets/plugins/easymde/easymde.min.js"></script> From 5269f8c47345ee0f7cdb5ceb9b3f8df379875a90 Mon Sep 17 00:00:00 2001 From: HB9HIL <fabian.berg@hb9hil.org> Date: Sat, 14 Feb 2026 12:01:21 +0100 Subject: [PATCH 11/17] found some more imports --- application/views/interface_assets/footer.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index f8094c46a..21bf6c109 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -181,7 +181,7 @@ <?php $local_code = $language['locale']; $lang_code = $language['code']; -$file_path = base_url() . "assets/json/datatables_languages/" . $local_code . ".json"; +$file_path = $this->paths->cache_buster('/assets/json/datatables_languages/' . $local_code . '.json'); // Check if the file exists if ($lang_code != 'en' && !file_exists(FCPATH . "assets/json/datatables_languages/" . $local_code . ".json")) { @@ -372,19 +372,19 @@ function stopImpersonate_modal() { <?php if ($this->uri->segment(1) == "qso" ) { ?> <!-- Javascript used for QSO Notes Area --> - <script src="<?php echo base_url() ;?>assets/plugins/easymde/easymde.min.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/plugins/easymde/easymde.min.js'); ?>"></script> <?php if(($this->session->userdata('user_dxwaterfall_enable') == 'E' || $this->session->userdata('user_dxwaterfall_enable') == 'Y') && isset($manual_mode) && $manual_mode == 0) { ?> <script> var dxwaterfall_enable='<?php echo $this->session->userdata('user_dxwaterfall_enable'); ?>'; </script> - <script type="text/javascript" src="<?php echo base_url() ;?>assets/js/dxwaterfall.js?v=<?php echo floor(time() / 3600); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/dxwaterfall.js'); ?>"></script> <?php } ?> <?php } ?> <?php if ($this->uri->segment(1) == "notes" && ($this->uri->segment(2) == "view") ) { ?> <!-- Javascript used for Notes Area --> - <script src="<?php echo base_url() ;?>assets/plugins/easymde/easymde.min.js"></script> - <script src="<?php echo base_url() ;?>assets/js/sections/notes_view.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/plugins/easymde/easymde.min.js'); ?>"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/notes_view.js'); ?>"></script> <?php } ?> <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/datatables.min.js'); ?>"></script> @@ -436,7 +436,7 @@ $(function () { <?php } ?> <?php if ($this->uri->segment(1) == "api") { ?> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/api.js"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/sections/api.js'); ?>"></script> <script type="text/javascript"> // Pass PHP variable to JavaScript var apiSiteUrl = "<?php echo site_url(); ?>"; @@ -1349,7 +1349,7 @@ mymap.on('mousemove', onQsoMapMove); var dxwaterfall_cat_state = "none"; </script> <?php } ?> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/cat.js"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/cat.js'); ?>"></script> <?php } ?> @@ -2279,7 +2279,7 @@ $('#sats').change(function(){ <?php if ($this->uri->segment(1) == "usermode") { ?> - <script src="<?php echo base_url(); ?>assets/js/sections/usermode.js"></script> + <script src="<?php echo $this->paths->cache_buster('/assets/js/sections/usermode.js'); ?>"></script> <?php } ?> <?php if ($this->uri->segment(1) == "mode") { ?> From 333ad951f553fe36fee7a165f6e7b82fb3ed697d Mon Sep 17 00:00:00 2001 From: HB9HIL <fabian.berg@hb9hil.org> Date: Sat, 14 Feb 2026 12:12:08 +0100 Subject: [PATCH 12/17] fixed old typo --- application/controllers/Gridmap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Gridmap.php b/application/controllers/Gridmap.php index b12df12d1..30df7a4e1 100644 --- a/application/controllers/Gridmap.php +++ b/application/controllers/Gridmap.php @@ -44,7 +44,7 @@ class Gridmap extends CI_Controller { $footerData = []; $footerData['scripts'] = [ 'assets/js/leaflet/geocoding.js', - 'assets/js/sections/gridmap.js?', + 'assets/js/sections/gridmap.js', 'assets/js/leaflet/L.MaidenheadColouredGridMap.js', 'assets/js/sections/itumap_geojson.js', 'assets/js/sections/cqmap_geojson.js', From 91e387995e95c99daeb43f5fac0920587195e3ca Mon Sep 17 00:00:00 2001 From: HB9HIL <fabian.berg@hb9hil.org> Date: Sat, 14 Feb 2026 12:17:40 +0100 Subject: [PATCH 13/17] add the same logic to visitor page --- application/views/visitor/layout/footer.php | 40 ++++++++++----------- application/views/visitor/layout/header.php | 36 +++++++++---------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/application/views/visitor/layout/footer.php b/application/views/visitor/layout/footer.php index 2dc434e9d..24e722d67 100644 --- a/application/views/visitor/layout/footer.php +++ b/application/views/visitor/layout/footer.php @@ -6,7 +6,7 @@ */ var base_url = "<?php echo base_url(); ?>"; // Base URL var site_url = "<?php echo site_url(); ?>"; // Site URL - var icon_dot_url = "<?php echo base_url();?>assets/images/dot.png"; + var icon_dot_url = "<?php echo $this->paths->cache_buster('/assets/images/dot.png'); ?>"; var option_map_tile_server_copyright = '<?php echo $this->optionslib->get_option('option_map_tile_server_copyright');?>'; var option_map_tile_subdomains = '<?php echo $this->optionslib->get_option('option_map_tile_subdomains') ?? 'abc';?>'; var lang_general_gridsquares = "<?= __("Gridsquares"); ?>"; @@ -14,21 +14,21 @@ </script> <!-- General JS Files used across Wavelog --> -<script src="<?php echo base_url(); ?>assets/js/jquery-3.3.1.min.js"></script> -<script src="<?php echo base_url(); ?>assets/js/jquery.fancybox.min.js"></script> -<script src="<?php echo base_url(); ?>assets/js/bootstrap.bundle.js"></script> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/leaflet.js"></script> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/L.Maidenhead.qrb.js"></script> -<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/leaflet.geodesic.js"></script> -<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/darkmodehelpers.js"></script> -<script src="<?php echo base_url(); ?>assets/js/bootstrapdialog/js/bootstrap-dialog.min.js"></script> -<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/easyprint.js"></script> +<script src="<?php echo $this->paths->cache_buster('/assets/js/jquery-3.3.1.min.js') ?>"></script> +<script src="<?php echo $this->paths->cache_buster('/assets/js/jquery.fancybox.min.js') ?>"></script> +<script src="<?php echo $this->paths->cache_buster('/assets/js/bootstrap.bundle.js') ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/leaflet.js') ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/L.Maidenhead.qrb.js') ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/leaflet.geodesic.js') ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/darkmodehelpers.js') ?>"></script> +<script src="<?php echo $this->paths->cache_buster('/assets/js/bootstrapdialog/js/bootstrap-dialog.min.js') ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/easyprint.js') ?>"></script> <!-- DATATABLES LANGUAGE --> <?php $local_code = $language['locale']; $lang_code = $language['code']; -$file_path = base_url() . "assets/json/datatables_languages/" . $local_code . ".json"; +$file_path = $this->paths->cache_buster('/assets/json/datatables_languages/' . $local_code . '.json'); // Check if the file exists if ($lang_code != 'en' && !file_exists(FCPATH . "assets/json/datatables_languages/" . $local_code . ".json")) { @@ -57,8 +57,8 @@ if ($lang_code != 'en' && !file_exists(FCPATH . "assets/json/datatables_language </script> <!-- DATATABLES LANGUAGE END --> - <script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.Maidenhead.js"></script> - <script id="leafembed" type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/leafembed.js" tileUrl="<?php echo $this->optionslib->get_option('map_tile_server');?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/L.Maidenhead.js') ?>"></script> + <script id="leafembed" type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/leafembed.js') ?>" tileUrl="<?php echo $this->optionslib->get_option('map_tile_server');?>"></script> <script type="text/javascript"> $(function () { $('[data-bs-toggle="tooltip"]').tooltip() @@ -93,8 +93,8 @@ if ($lang_code != 'en' && !file_exists(FCPATH . "assets/json/datatables_language <?php if ($this->uri->segment(2) == "satellites") { ?> -<script type="text/javascript" src="<?php echo base_url();?>assets/js/sections/gridmap.js?"></script> -<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.MaidenheadColoured.js"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/sections/gridmap.js'); ?>"></script> +<script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/leaflet/L.MaidenheadColoured.js'); ?>"></script> <script> @@ -199,11 +199,11 @@ if ($lang_code != 'en' && !file_exists(FCPATH . "assets/json/datatables_language <?php } ?> </script> <?php if ($public_search_enabled || $this->session->userdata('user_type') >= 2) { ?> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/datatables.min.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/dataTables.buttons.min.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/buttons.html5.min.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/moment.min.js"></script> - <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/datetime-moment.js"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/datatables.min.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/dataTables.buttons.min.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/buttons.html5.min.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/moment.min.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->paths->cache_buster('/assets/js/datetime-moment.js'); ?>"></script> <script> <?php switch($this->config->item('qso_date_format')) { case 'd/m/y': $usethisformat = 'D/MM/YY';break; diff --git a/application/views/visitor/layout/header.php b/application/views/visitor/layout/header.php index de9169bdc..0ce63203c 100644 --- a/application/views/visitor/layout/header.php +++ b/application/views/visitor/layout/header.php @@ -7,39 +7,39 @@ <!-- Bootstrap CSS --> <?php if($this->optionslib->get_theme()) { ?> - <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/<?php echo $this->optionslib->get_theme();?>/bootstrap.min.css"> - <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/general.css"> - <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/visitor.css"> - <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/selectize.bootstrap4.css"/> - <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap-dialog.css"/> - <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/<?php echo $this->optionslib->get_theme();?>/overrides.css"> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/' . $this->optionslib->get_theme() . '/bootstrap.min.css'); ?>"> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/general.css'); ?>"> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/visitor.css'); ?>"> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/selectize.bootstrap4.css'); ?>"/> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/bootstrap-dialog.css'); ?>"/> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/' . $this->optionslib->get_theme() . '/overrides.css'); ?>"> <?php } ?> - <link rel="stylesheet" href="<?php echo base_url(); ?>assets/fontawesome/css/all.min.css"> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/fontawesome/css/all.min.css'); ?>"> - <link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/jquery.fancybox.min.css" /> + <link rel="stylesheet" href="<?php echo $this->paths->cache_buster('/assets/css/jquery.fancybox.min.css'); ?>" /> <!-- Maps --> - <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/js/leaflet/leaflet.css" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/js/leaflet/leaflet.css'); ?>" /> - <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/loading.min.css" /> - <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/ldbtn.min.css" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/css/loading.min.css'); ?>" /> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/css/ldbtn.min.css'); ?>" /> - <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/buttons.dataTables.min.css"/> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/css/buttons.dataTables.min.css'); ?>"/> - <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/datatables.min.css"/> + <link rel="stylesheet" type="text/css" href="<?php echo $this->paths->cache_buster('/assets/css/datatables.min.css'); ?>"/> - <?php if (file_exists(APPPATH.'../assets/css/custom.css')) { echo '<link rel="stylesheet" href="'.base_url().'assets/css/custom.css">'; } ?> + <?php if (file_exists(APPPATH.'../assets/css/custom.css')) { echo '<link rel="stylesheet" href="'.$this->paths->cache_buster('/assets/css/custom.css').'">'; } ?> <script> var userName = 'visitor'; </script> <?php if (file_exists(APPPATH . '../assets/js/sections/custom.js')) { - echo '<script src="' . base_url() . 'assets/js/sections/custom.js"></script>'; + echo '<script src="' . $this->paths->cache_buster('/assets/js/sections/custom.js') . '"></script>'; } ?> - <link rel="icon" href="<?php echo base_url(); ?>favicon.ico"> + <link rel="icon" href="<?php echo $this->paths->cache_buster('/favicon.ico'); ?>"> <title><?php if(isset($page_title)) { echo $page_title; } ?> - Wavelog @@ -50,9 +50,9 @@ '; + echo ''; } else { - echo 'Logo'; + echo 'Logo'; } ?> From c468b7d19bd8e98ab8717368b18b6e1c6273b374 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sat, 14 Feb 2026 12:21:34 +0100 Subject: [PATCH 14/17] no need to load css assets again. use same logic here aswell --- .../views/interface_assets/mini_header.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/views/interface_assets/mini_header.php b/application/views/interface_assets/mini_header.php index 5d0463074..e00c27a1a 100644 --- a/application/views/interface_assets/mini_header.php +++ b/application/views/interface_assets/mini_header.php @@ -7,20 +7,20 @@ optionslib->get_theme()) { ?> - - - + + + - + - + - + - '; } ?> + paths->cache_buster('/assets/css/custom.css').'">'; } ?> - + <?php if(isset($page_title)) { echo $page_title; } ?> - Wavelog From a7c26e883bd75091987f60eb1cb04361e73013a5 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sat, 14 Feb 2026 12:24:05 +0100 Subject: [PATCH 15/17] found old typo --- application/controllers/Timeline.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Timeline.php b/application/controllers/Timeline.php index 34cbc6742..091e39c01 100644 --- a/application/controllers/Timeline.php +++ b/application/controllers/Timeline.php @@ -101,7 +101,7 @@ class Timeline extends CI_Controller { $data['onlynew'] = $onlynew; $data['selectedyear'] = $year; - $footerData['scripts'] = [ 'assets/js/sections/timeline.js?' ]; + $footerData['scripts'] = [ 'assets/js/sections/timeline.js' ]; $this->load->view('interface_assets/header', $data); $this->load->view('timeline/index'); $this->load->view('interface_assets/footer', $footerData); From 371b51c372c67c90104e8bc3b93e47263dfd9455 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sat, 14 Feb 2026 12:31:30 +0100 Subject: [PATCH 16/17] some more --- application/views/bandmap/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/views/bandmap/list.php b/application/views/bandmap/list.php index 3d3067df6..e30fa7e81 100644 --- a/application/views/bandmap/list.php +++ b/application/views/bandmap/list.php @@ -173,7 +173,7 @@ // Map configuration (matches QSO map settings) var map_tile_server = 'optionslib->get_option('option_map_tile_server');?>'; var map_tile_server_copyright = 'optionslib->get_option('option_map_tile_server_copyright');?>'; - var icon_dot_url = "assets/images/dot.png"; + var icon_dot_url = "paths->cache_buster('/assets/images/dot.png'); ?>"; // User gridsquare for home position marker var user_gridsquare = ''; - +
@@ -198,7 +198,7 @@
From 8437324556699c7e20b9232edfb931ce32cd0d85 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sat, 14 Feb 2026 12:36:46 +0100 Subject: [PATCH 17/17] last typo from early days --- application/controllers/Sattimers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Sattimers.php b/application/controllers/Sattimers.php index 4d51b45f1..ea3f3473f 100644 --- a/application/controllers/Sattimers.php +++ b/application/controllers/Sattimers.php @@ -13,7 +13,7 @@ class Sattimers extends CI_Controller { $this->load->model('stations'); $footerData = []; $footerData['scripts'] = [ - 'assets/js/sections/sattimers.js?' + 'assets/js/sections/sattimers.js' ]; $url = 'https://www.df2et.de/tevel/api2.php?grid='.strtoupper($this->stations->find_gridsquare());