Permalink
Browse files

Halloween-Edition, hi

now resolving Callsigns from ID when using sqlite-database, so no further
needs to activate dmrids.dat in MMDVM.ini
  • Loading branch information...
dg9vh committed Oct 29, 2017
1 parent f4eb4f2 commit 30598cd68d50ef919cc358d53e6d0b4a06bf4d61
Showing with 22 additions and 6 deletions.
  1. +21 −5 include/functions.php
  2. +1 −1 version.php
View
@@ -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
@@ -1,3 +1,3 @@
<?php
define("VERSION", "20171017-1 (".getGitVersion().")");
define("VERSION", "20171031-1 (".getGitVersion().")");
?>

0 comments on commit 30598cd

Please sign in to comment.