From c62a4c70a0f3ef4bf38e34b3418b4bfd26c97cb9 Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 21 Jul 2023 14:44:14 +0000 Subject: [PATCH] Added filtering on maxAge / de-cont to bandmap (apply settings) --- application/controllers/Dxcluster.php | 10 ++++++++-- application/models/Logbook_model.php | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/application/controllers/Dxcluster.php b/application/controllers/Dxcluster.php index 807e3793..af10c8cf 100644 --- a/application/controllers/Dxcluster.php +++ b/application/controllers/Dxcluster.php @@ -11,8 +11,14 @@ class Dxcluster extends CI_Controller { } - function spots($band,$age = 60) { - $calls_found=$this->logbook_model->dxc_spotlist($band, $age); + function spots($band,$age = '', $de = '') { + if ($age == '') { + $age = $this->optionslib->get_option('dxcluster_maxage'); + } + if ($de == '') { + $de = $this->optionslib->get_option('dxcluster_decont'); + } + $calls_found=$this->logbook_model->dxc_spotlist($band, $age, $de); header('Content-Type: application/json'); if ($calls_found) { echo json_encode($calls_found, JSON_PRETTY_PRINT); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 704e5bad..a3327d22 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -3993,7 +3993,7 @@ class Logbook_model extends CI_Model { return false; } - public function dxc_spotlist($band = '20m',$maxage = 60) { + public function dxc_spotlist($band = '20m',$maxage = 60, $de = '') { $CI =& get_instance(); if ( ($this->optionslib->get_option('dxcache_url') != '') ) { $dxcache_url = $this->optionslib->get_option('dxcache_url').'/spots/'; @@ -4025,7 +4025,13 @@ class Logbook_model extends CI_Model { if ($minutes<=$maxage) { $dxcc=$this->dxcc_lookup($singlespot->spotter,date('Ymd', time())); $singlespot->dxcc_spotter=$dxcc; - array_push($spotsout,$singlespot); + if ($de != '') { + if ($de == $dxcc['cont']) { + array_push($spotsout,$singlespot); + } + } else { + array_push($spotsout,$singlespot); + } } } return ($spotsout);