Merge branch 'master' of gitea:museum-digital/MDNodaHelpers
This commit is contained in:
commit
99a5303773
|
@ -561,16 +561,16 @@ final class NodaTimeAutotranslater {
|
||||||
// Beginn: 1500. (1501 - 1) / 100 + 1 = 16. 16th century is the time.
|
// Beginn: 1500. (1501 - 1) / 100 + 1 = 16. 16th century is the time.
|
||||||
$start_cen = ((\intval($timeInfo['zeit_beginn']) - 1) / 100) + 1;
|
$start_cen = ((\intval($timeInfo['zeit_beginn']) - 1) / 100) + 1;
|
||||||
// End: 1600. 16th century is the time.
|
// End: 1600. 16th century is the time.
|
||||||
$end_cen = (\intval($timeInfo['zeit_ende']) / 100);
|
$end_cen = \intval($timeInfo['zeit_ende']) / 100;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// End: -1600. 16th century is the time.
|
// End: -1600. 16th century is the time.
|
||||||
$start_cen = (\intval($timeInfo['zeit_beginn']) / 100);
|
$start_cen = \intval($timeInfo['zeit_beginn']) / 100;
|
||||||
// End: -1500. (1501 - 1) / 100 + 1 = 16. 16th century is the time.
|
// End: -1500. (1501 - 1) / 100 + 1 = 16. 16th century is the time.
|
||||||
$end_cen = ((\intval($timeInfo['zeit_ende']) + 1) / 100) - 1;
|
$end_cen = ((\intval($timeInfo['zeit_ende']) + 1) / 100) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$suffixMode = self::getSuffixModeForYearsWSuffix((\intval($timeInfo['zeit_beginn']) - 1), \intval($timeInfo['zeit_ende']));
|
$suffixMode = self::getSuffixModeForYearsWSuffix(\intval($timeInfo['zeit_beginn']) - 1, \intval($timeInfo['zeit_ende']));
|
||||||
|
|
||||||
$output = [];
|
$output = [];
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ final class NodaTimeAutotranslater {
|
||||||
// End: 1600. 16th century is the time.
|
// End: 1600. 16th century is the time.
|
||||||
$end_cen = (\intval($timeInfo['zeit_ende']));
|
$end_cen = (\intval($timeInfo['zeit_ende']));
|
||||||
|
|
||||||
$suffixMode = self::getSuffixModeForYearsWSuffix((\intval($timeInfo['zeit_beginn']) - 1), \intval($timeInfo['zeit_ende']));
|
$suffixMode = self::getSuffixModeForYearsWSuffix(\intval($timeInfo['zeit_beginn']) - 1, \intval($timeInfo['zeit_ende']));
|
||||||
|
|
||||||
$output = [];
|
$output = [];
|
||||||
|
|
||||||
|
@ -822,7 +822,7 @@ final class NodaTimeAutotranslater {
|
||||||
return self::translateYearsWithSuffix($timeInfo);
|
return self::translateYearsWithSuffix($timeInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
$suffixMode = self::getSuffixModeForYearsWSuffix((\intval($timeInfo['zeit_beginn']) - 1), \intval($timeInfo['zeit_ende']));
|
$suffixMode = self::getSuffixModeForYearsWSuffix(\intval($timeInfo['zeit_beginn']) - 1, \intval($timeInfo['zeit_ende']));
|
||||||
|
|
||||||
if (\trim((string)$timeInfo['zeit_zaehlzeit_tag'], ", .0") === "") {
|
if (\trim((string)$timeInfo['zeit_zaehlzeit_tag'], ", .0") === "") {
|
||||||
$dateStr = "{$timeInfo['zeit_zaehlzeit_jahr']}-{$timeInfo['zeit_zaehlzeit_monat']}-05 00:00:01";
|
$dateStr = "{$timeInfo['zeit_zaehlzeit_jahr']}-{$timeInfo['zeit_zaehlzeit_monat']}-05 00:00:01";
|
||||||
|
|
|
@ -493,7 +493,7 @@ final class NodaTimeSplitter {
|
||||||
if (\substr($datum, -2, 1) === " " and self::is_numeric((string)\substr($datum, -1, 1))) {
|
if (\substr($datum, -2, 1) === " " and self::is_numeric((string)\substr($datum, -1, 1))) {
|
||||||
$day = "0" . \substr($datum, -1, 1);
|
$day = "0" . \substr($datum, -1, 1);
|
||||||
}
|
}
|
||||||
else if ((empty($day)) and \substr($datum, -3, 1) === " " and self::is_numeric((string)\substr($datum, -2, 1))) {
|
else if (empty($day) and \substr($datum, -3, 1) === " " and self::is_numeric((string)\substr($datum, -2, 1))) {
|
||||||
$day = "0" . \substr($datum, -2, 1);
|
$day = "0" . \substr($datum, -2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -757,7 +757,7 @@ final class NodaTimeSplitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
$output[1] = "?";
|
$output[1] = "?";
|
||||||
if (empty(trim($output[2], "0 .,"))) $output[0] = \strval((\intval($output[0]) + 1));
|
if (empty(trim($output[2], "0 .,"))) $output[0] = \strval(\intval($output[0]) + 1);
|
||||||
$output[5] = "Nach";
|
$output[5] = "Nach";
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
@ -775,7 +775,7 @@ final class NodaTimeSplitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
$output[1] = "?";
|
$output[1] = "?";
|
||||||
if (empty(trim($output[2], "0 .,"))) $output[0] = \strval((\intval($output[0]) + 1));
|
if (empty(trim($output[2], "0 .,"))) $output[0] = \strval(\intval($output[0]) + 1);
|
||||||
$output[5] = "Nach";
|
$output[5] = "Nach";
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
@ -788,7 +788,7 @@ final class NodaTimeSplitter {
|
||||||
if ($output = self::attempt_splitting(\substr($datum, $spacePos))) {
|
if ($output = self::attempt_splitting(\substr($datum, $spacePos))) {
|
||||||
|
|
||||||
$output[0] = "?";
|
$output[0] = "?";
|
||||||
if (empty(trim($output[2], "0 .,"))) $output[1] = \strval((\intval($output[1]) - 1));
|
if (empty(trim($output[2], "0 .,"))) $output[1] = \strval(\intval($output[1]) - 1);
|
||||||
$output[5] = "Vor";
|
$output[5] = "Vor";
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
@ -801,7 +801,7 @@ final class NodaTimeSplitter {
|
||||||
if ($output = self::attempt_splitting(\substr($datum, 0, $spacePos))) {
|
if ($output = self::attempt_splitting(\substr($datum, 0, $spacePos))) {
|
||||||
|
|
||||||
$output[0] = "?";
|
$output[0] = "?";
|
||||||
if (empty(trim($output[2], "0 .,"))) $output[1] = \strval((\intval($output[1]) - 1));
|
if (empty(trim($output[2], "0 .,"))) $output[1] = \strval(\intval($output[1]) - 1);
|
||||||
$output[5] = "Vor";
|
$output[5] = "Vor";
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,7 +151,7 @@ final class NodaWikidataFetcher {
|
||||||
if (empty($wikipedia_cont = MD_STD::runCurl($linkUrl))) return '';
|
if (empty($wikipedia_cont = MD_STD::runCurl($linkUrl))) return '';
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
if (!($doc->loadHTML($wikipedia_cont))) {
|
if (!$doc->loadHTML($wikipedia_cont)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ final class NodaWikidataFetcher {
|
||||||
if (!empty($cinfo['persinst_kurzinfo']) and substr($cinfo['persinst_kurzinfo'], 0, 3) !== 'GND') {
|
if (!empty($cinfo['persinst_kurzinfo']) and substr($cinfo['persinst_kurzinfo'], 0, 3) !== 'GND') {
|
||||||
|
|
||||||
if (isset($_GET['keep'])) {
|
if (isset($_GET['keep'])) {
|
||||||
if (!($_GET['keep']) || $_GET['keep'] === 'replace') {
|
if (!$_GET['keep'] || $_GET['keep'] === 'replace') {
|
||||||
|
|
||||||
$updatePersinstStmt->bind_param("si", $datafromwiki, $persinst_id);
|
$updatePersinstStmt->bind_param("si", $datafromwiki, $persinst_id);
|
||||||
$updatePersinstStmt->execute();
|
$updatePersinstStmt->execute();
|
||||||
|
@ -1189,7 +1189,7 @@ final class NodaWikidataFetcher {
|
||||||
$updateStmt = $this->_mysqli_noda->do_prepare("UPDATE `orte`
|
$updateStmt = $this->_mysqli_noda->do_prepare("UPDATE `orte`
|
||||||
SET `ort_nord_sued` = ?, `ort_west_ost` = ?, ort_zoom = '9'
|
SET `ort_nord_sued` = ?, `ort_west_ost` = ?, ort_zoom = '9'
|
||||||
WHERE `ort_id` = ?");
|
WHERE `ort_id` = ?");
|
||||||
$updateStmt->bind_param("ssi", $latitude_wd, $longitude_wd, $onum);
|
$updateStmt->bind_param("ddi", $latitude_wd, $longitude_wd, $onum);
|
||||||
$updateStmt->execute();
|
$updateStmt->execute();
|
||||||
$updateStmt->close();
|
$updateStmt->close();
|
||||||
unset($updateStmt);
|
unset($updateStmt);
|
||||||
|
@ -1335,7 +1335,7 @@ final class NodaWikidataFetcher {
|
||||||
if (!empty($cinfo['tag_anmerkung']) and substr($cinfo['tag_anmerkung'], 0, 3) !== 'GND') {
|
if (!empty($cinfo['tag_anmerkung']) and substr($cinfo['tag_anmerkung'], 0, 3) !== 'GND') {
|
||||||
|
|
||||||
if (isset($_GET['keep'])) {
|
if (isset($_GET['keep'])) {
|
||||||
if (!($_GET['keep']) || $_GET['keep'] === 'replace') {
|
if (!$_GET['keep'] || $_GET['keep'] === 'replace') {
|
||||||
|
|
||||||
$updateTagDescStmt->bind_param("si", $datafromwiki, $tag_id);
|
$updateTagDescStmt->bind_param("si", $datafromwiki, $tag_id);
|
||||||
$updateTagDescStmt->execute();
|
$updateTagDescStmt->execute();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user