From e0416b60537b9c5e49ff3d023f689193ab8b5ef4 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 21 Jun 2025 18:45:03 +0200 Subject: [PATCH] [DXCluster] Mode filtering --- application/controllers/Dxcluster.php | 7 +++-- application/models/Dxcluster_model.php | 12 +++++++- application/views/bandmap/list.php | 42 +++++++++++++++----------- assets/js/sections/bandmap_list.js | 19 +++++++----- 4 files changed, 52 insertions(+), 28 deletions(-) diff --git a/application/controllers/Dxcluster.php b/application/controllers/Dxcluster.php index 4414873f5..8b9771bac 100644 --- a/application/controllers/Dxcluster.php +++ b/application/controllers/Dxcluster.php @@ -11,15 +11,16 @@ class Dxcluster extends CI_Controller { } - function spots($band,$age = '', $de = '') { + function spots($band, $age = '', $de = '', $mode = 'All') { if ($age == '') { $age = $this->optionslib->get_option('dxcluster_maxage') ?? 60; } if ($de == '') { $de = $this->optionslib->get_option('dxcluster_decont') ?? 'EU'; } - $calls_found=$this->dxcluster_model->dxc_spotlist($band, $age, $de); - header('Content-Type: application/json'); + $calls_found = $this->dxcluster_model->dxc_spotlist($band, $age, $de, $mode); + + header('Content-Type: application/json'); if ($calls_found) { echo json_encode($calls_found, JSON_PRETTY_PRINT); } else { diff --git a/application/models/Dxcluster_model.php b/application/models/Dxcluster_model.php index f4459c1de..de609c0d9 100644 --- a/application/models/Dxcluster_model.php +++ b/application/models/Dxcluster_model.php @@ -3,7 +3,7 @@ use Wavelog\Dxcc\Dxcc; class Dxcluster_model extends CI_Model { - public function dxc_spotlist($band = '20m', $maxage = 60, $de = '') { + public function dxc_spotlist($band = '20m', $maxage = 60, $de = '', $mode = 'All') { $this->load->helper(array('psr4_autoloader')); if($this->session->userdata('user_date_format')) { @@ -52,6 +52,7 @@ class Dxcluster_model extends CI_Model { } $singlespot->band=$spotband; if (($band != 'All') && ($band != $spotband)) { continue; } + if (($mode != 'All') && ($mode != $this->modefilter($singlespot, $mode))) { continue; } $datetimecurrent = new DateTime("now", new DateTimeZone('UTC')); // Today's Date/Time $datetimespot = new DateTime($singlespot->when, new DateTimeZone('UTC')); $spotage = $datetimecurrent->diff($datetimespot); @@ -113,6 +114,15 @@ class Dxcluster_model extends CI_Model { } + function modefilter($spot, $mode) { + if ($mode == 'cw') { + if (isset($spot->message) && stripos($spot->message, 'cw') !== false) { + return true; + } + } + return false; + } + public function dxc_qrg_lookup($qrg, $maxage = 120) { $this->load->helper(array('psr4_autoloader')); if (is_numeric($qrg)) { diff --git a/application/views/bandmap/list.php b/application/views/bandmap/list.php index 788917194..d7507dd6b 100644 --- a/application/views/bandmap/list.php +++ b/application/views/bandmap/list.php @@ -106,30 +106,38 @@ } ?> + +
+
| = __("Date"); ?>/= __("Time"); ?> | += __("Frequency"); ?> | += __("Call"); ?> | += __("DXCC"); ?> | += __("WAC"); ?> | += __("Spotter"); ?> | += __("Message"); ?> | += __("Last Worked"); ?> | +
|---|
| = __("Date"); ?>/= __("Time"); ?> | -= __("Frequency"); ?> | -= __("Call"); ?> | -= __("DXCC"); ?> | -= __("WAC"); ?> | -= __("Spotter"); ?> | -= __("Message"); ?> | -= __("Last Worked"); ?> | -
|---|