From 4f9d620994a929c62893d013b7e9ac52ac6ca821 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 29 Oct 2025 12:05:33 +0100 Subject: [PATCH] Hide QSO markers without grids from maps --- application/controllers/Map.php | 2 +- application/models/Logbook_model.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/application/controllers/Map.php b/application/controllers/Map.php index 158f7bece..bcae4da3e 100644 --- a/application/controllers/Map.php +++ b/application/controllers/Map.php @@ -15,7 +15,7 @@ class Map extends CI_Controller { // set informations // $nb_qso = (intval($this->input->post('nb_qso'))>0)?xss_clean($this->input->post('nb_qso')):18; $offset = (intval($this->input->post('offset'))>0)?xss_clean($this->input->post('offset')):null; - $qsos = $this->logbook_model->get_qsos($nb_qso, $offset); + $qsos = $this->logbook_model->get_qsos($nb_qso, $offset, null, '', true); // [PLOT] ADD plot // $plot_array = $this->logbook_model->get_plot_array_for_map($qsos->result()); // [MAP Custom] ADD Station // diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 9c20d8bc0..faf60e36e 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2140,7 +2140,7 @@ class Logbook_model extends CI_Model { return $query; } - function get_qsos($num, $offset, $StationLocationsArray = null, $band = '') { + function get_qsos($num, $offset, $StationLocationsArray = null, $band = '', $map = false) { if ($StationLocationsArray == null) { $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -2173,6 +2173,14 @@ class Logbook_model extends CI_Model { } } + if ($map == true) { + $this->db->group_start(); + $this->db->where($this->config->item('table_name') . '.col_gridsquare !=', ''); + $this->db->or_where($this->config->item('table_name') . '.col_vucc_grids !=', ''); + $this->db->group_end(); + } + + $this->db->where_in($this->config->item('table_name') . '.station_id', $logbooks_locations_array); $this->db->order_by('' . $this->config->item('table_name') . '.COL_TIME_ON', "desc"); $this->db->order_by('' . $this->config->item('table_name') . '.COL_PRIMARY_KEY', "desc");