Display warning message in search result if grid is auto-detected by

qrz.com
This commit is contained in:
phl0
2025-09-04 15:57:12 +02:00
parent d2dd0ab428
commit c159b2fd2a
3 changed files with 29 additions and 25 deletions

View File

@@ -22,35 +22,35 @@ class Callbook {
case 'qrz':
if ($this->ci->config->item('qrz_username') == null || $this->ci->config->item('qrz_password') == null) {
$callbook['error'] = 'Lookup not configured. Please review configuration.';
return $callbook;
}
return $this->qrz($this->ci->config->item('qrz_username'), $this->ci->config->item('qrz_password'), $callsign, $this->ci->config->item('use_fullname'));
$callbook = $this->qrz($this->ci->config->item('qrz_username'), $this->ci->config->item('qrz_password'), $callsign, $this->ci->config->item('use_fullname'));
break;
case 'qrzcq':
if ($this->ci->config->item('qrzcq_username') == null || $this->ci->config->item('qrzcq_password') == null) {
$callbook['error'] = 'Lookup not configured. Please review configuration.';
return $callbook;
}
return $this->qrzcq($this->ci->config->item('qrzcq_username'), $this->ci->config->item('qrzcq_password'), $callsign);
$callbook = $this->qrzcq($this->ci->config->item('qrzcq_username'), $this->ci->config->item('qrzcq_password'), $callsign);
break;
case 'hamqth':
if ($this->ci->config->item('hamqth_username') == null || $this->ci->config->item('hamqth_password') == null) {
$callbook['error'] = 'Lookup not configured. Please review configuration.';
return $callbook;
}
return $this->hamqth($this->ci->config->item('hamqth_username'), $this->ci->config->item('hamqth_password'), $callsign);
$callbook = $this->hamqth($this->ci->config->item('hamqth_username'), $this->ci->config->item('hamqth_password'), $callsign);
break;
case 'qrzru':
if ($this->ci->config->item('qrzru_username') == null || $this->ci->config->item('qrzru_password') == null) {
$callbook['error'] = 'Lookup not configured. Please review configuration.';
return $callbook;
}
return $this->qrzru($this->ci->config->item('qrzru_username'), $this->ci->config->item('qrzru_password'), $callsign);
$callbook = $this->qrzru($this->ci->config->item('qrzru_username'), $this->ci->config->item('qrzru_password'), $callsign);
break;
default:
$callbook['error'] = 'No callbook defined. Please review configuration.';
return $callbook;
}
// Handle callbook specific fields
if (! array_key_exists('geoloc', $callbook)) {
$callbook['geoloc'] = '';
}
return $callbook;
}
function qrz($username, $password, $callsign, $fullname) {

View File

@@ -112,16 +112,17 @@ class Qrz {
if ($reduced == false) {
$data['gridsquare'] = $clean_gridsquare;
$data['city'] = (string)$xml->Callsign->addr2;
$data['lat'] = (string)$xml->Callsign->lat;
$data['long'] = (string)$xml->Callsign->lon;
$data['dxcc'] = (string)$xml->Callsign->dxcc;
$data['state'] = (string)$xml->Callsign->state;
$data['iota'] = (string)$xml->Callsign->iota;
$data['geoloc'] = (string)$xml->Callsign->geoloc;
$data['city'] = (string)$xml->Callsign->addr2;
$data['lat'] = (string)$xml->Callsign->lat;
$data['long'] = (string)$xml->Callsign->lon;
$data['dxcc'] = (string)$xml->Callsign->dxcc;
$data['state'] = (string)$xml->Callsign->state;
$data['iota'] = (string)$xml->Callsign->iota;
$data['qslmgr'] = (string)$xml->Callsign->qslmgr;
$data['image'] = (string)$xml->Callsign->image;
$data['ituz'] = (string)$xml->Callsign->ituzone;
$data['cqz'] = (string)$xml->Callsign->cqzone;
$data['image'] = (string)$xml->Callsign->image;
$data['ituz'] = (string)$xml->Callsign->ituzone;
$data['cqz'] = (string)$xml->Callsign->cqzone;
if ($xml->Callsign->country == "United States") {
$data['us_county'] = (string)$xml->Callsign->county;
@@ -132,14 +133,14 @@ class Qrz {
} else {
$data['gridsquare'] = '';
$data['city'] = '';
$data['lat'] = '';
$data['long'] = '';
$data['dxcc'] = '';
$data['state'] = '';
$data['iota'] = '';
$data['city'] = '';
$data['lat'] = '';
$data['long'] = '';
$data['dxcc'] = '';
$data['state'] = '';
$data['iota'] = '';
$data['qslmgr'] = (string)$xml->Callsign->qslmgr;
$data['image'] = (string)$xml->Callsign->image;
$data['image'] = (string)$xml->Callsign->image;
$data['us_county'] = '';
$data['ituz'] = '';
$data['cqz'] = '';

View File

@@ -54,6 +54,9 @@
} else {
echo " <span data-bs-toggle=\"tooltip\" title=\"Not Worked\" class=\"badge text-bg-danger\" style=\"padding-left: 0.2em; padding-right: 0.2em;\">".strtoupper($callsign['gridsquare'])."</span>";
}
if ($callsign['geoloc'] == "grid") {
echo " <span data-bs-toggle=\"tooltip\" title=\"Grid auto-detected\" class=\"badge text-bg-danger\">".__("Grid is auto-detected by callbook and probably wrong")."</span>";
}
?>
</td>
</tr>