Halloween-Edition, hi
now resolving Callsigns from ID when using sqlite-database, so no further needs to activate dmrids.dat in MMDVM.ini
This commit is contained in:
parent
f4eb4f20bc
commit
30598cd68d
2 changed files with 22 additions and 6 deletions
|
@ -451,7 +451,11 @@ function getHeardList($logLines, $onlyLast) {
|
||||||
$callsign = substr($callsign2, 0, strpos($callsign2,"/"));
|
$callsign = substr($callsign2, 0, strpos($callsign2,"/"));
|
||||||
}
|
}
|
||||||
$callsign = trim($callsign);
|
$callsign = trim($callsign);
|
||||||
|
if (defined("USESQLITE")) {
|
||||||
|
if (is_numeric($callsign)) {
|
||||||
|
$callsign = getCallsignFromDB($callsign);
|
||||||
|
}
|
||||||
|
}
|
||||||
$id ="";
|
$id ="";
|
||||||
if ($mode == "D-Star") {
|
if ($mode == "D-Star") {
|
||||||
$id = substr($callsign2, strpos($callsign2,"/") + 1);
|
$id = substr($callsign2, strpos($callsign2,"/") + 1);
|
||||||
|
@ -864,19 +868,22 @@ function getYSFReflectorById($id, $reflectors) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getName($callsign) {
|
function getName($callsign) {
|
||||||
if (is_numeric($callsign)) {
|
|
||||||
return "---";
|
|
||||||
}
|
|
||||||
if (defined("USESQLITE")) {
|
if (defined("USESQLITE")) {
|
||||||
return resolveNameFromDB($callsign);
|
return resolveNameFromDB($callsign);
|
||||||
} else {
|
} else {
|
||||||
|
if (is_numeric($callsign)) {
|
||||||
|
return "---";
|
||||||
|
}
|
||||||
return resolveNameFromFile($callsign);
|
return resolveNameFromFile($callsign);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolveNameFromDB($callsign) {
|
function resolveNameFromDB($callsign) {
|
||||||
$db = new SQLite3('database/callsigns.db');
|
$db = new SQLite3('database/callsigns.db');
|
||||||
$results = $db->query("SELECT distinct name FROM callsign where callsign = '$callsign'");
|
if (is_numeric($callsign))
|
||||||
|
$results = $db->query("SELECT distinct name FROM callsign where id = '$callsign'");
|
||||||
|
else
|
||||||
|
$results = $db->query("SELECT distinct name FROM callsign where callsign = '$callsign'");
|
||||||
while ($row = $results->fetchArray()) {
|
while ($row = $results->fetchArray()) {
|
||||||
return $row['name'];
|
return $row['name'];
|
||||||
}
|
}
|
||||||
|
@ -923,6 +930,15 @@ function resolveNameFromFile($callsign) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCallsignFromDB($id) {
|
||||||
|
$db = new SQLite3('database/callsigns.db');
|
||||||
|
$results = $db->query("SELECT distinct callsign FROM callsign where id = '$id'");
|
||||||
|
while ($row = $results->fetchArray()) {
|
||||||
|
return $row['callsign'];
|
||||||
|
}
|
||||||
|
return $id;
|
||||||
|
}
|
||||||
|
|
||||||
// 00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122
|
// 00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122
|
||||||
// 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
|
// 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
|
||||||
// M: 2017-02-13 15:53:30.991 0000: 04 00 5E 49 57 38 44 59 94 *..^IW8DY.*
|
// M: 2017-02-13 15:53:30.991 0000: 04 00 5E 49 57 38 44 59 94 *..^IW8DY.*
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<?php
|
<?php
|
||||||
define("VERSION", "20171017-1 (".getGitVersion().")");
|
define("VERSION", "20171031-1 (".getGitVersion().")");
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue