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:
Kim Huebel 2017-10-29 18:19:57 +00:00
parent f4eb4f20bc
commit 30598cd68d
2 changed files with 22 additions and 6 deletions

View file

@ -451,7 +451,11 @@ function getHeardList($logLines, $onlyLast) {
$callsign = substr($callsign2, 0, strpos($callsign2,"/"));
}
$callsign = trim($callsign);
if (defined("USESQLITE")) {
if (is_numeric($callsign)) {
$callsign = getCallsignFromDB($callsign);
}
}
$id ="";
if ($mode == "D-Star") {
$id = substr($callsign2, strpos($callsign2,"/") + 1);
@ -864,19 +868,22 @@ function getYSFReflectorById($id, $reflectors) {
}
function getName($callsign) {
if (is_numeric($callsign)) {
return "---";
}
if (defined("USESQLITE")) {
return resolveNameFromDB($callsign);
} else {
if (is_numeric($callsign)) {
return "---";
}
return resolveNameFromFile($callsign);
}
}
function resolveNameFromDB($callsign) {
$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()) {
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
// 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
// M: 2017-02-13 15:53:30.991 0000: 04 00 5E 49 57 38 44 59 94 *..^IW8DY.*

View file

@ -1,3 +1,3 @@
<?php
define("VERSION", "20171017-1 (".getGitVersion().")");
define("VERSION", "20171031-1 (".getGitVersion().")");
?>