Extract recent QSO count in QSO page to a constant

This commit is contained in:
Filip Melík
2025-01-08 13:15:55 +01:00
parent 05502ce92d
commit 809b65247a

View File

@@ -1,6 +1,9 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class QSO extends CI_Controller {
class QSO extends CI_Controller
{
const LAST_QSOS_COUNT = 5; // max number of most recent qsos to be displayed on a qso page
function __construct()
{
@@ -34,7 +37,7 @@ class QSO extends CI_Controller {
$data['stations'] = $this->stations->all_of_user();
$data['radios'] = $this->cat->radios(true);
$data['radio_last_updated'] = $this->cat->last_updated()->row();
$data['query'] = $this->logbook_model->last_custom('5');
$data['query'] = $this->logbook_model->last_custom(self::LAST_QSOS_COUNT);
$data['dxcc'] = $this->logbook_model->fetchDxcc();
$data['iota'] = $this->logbook_model->fetchIota();
$data['modes'] = $this->modes->active();
@@ -601,7 +604,7 @@ class QSO extends CI_Controller {
$this->load->model('logbook_model');
session_write_close();
$data['query'] = $this->logbook_model->last_custom('5');
$data['query'] = $this->logbook_model->last_custom(self::LAST_QSOS_COUNT);
// Load view
$this->load->view('qso/components/previous_contacts', $data);