Skip to content
Snippets Groups Projects
Commit af79f679 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch 'development' into 'master'

Development

See merge request !1012
parents 802ba5ac b38ad57d
No related branches found
No related tags found
3 merge requests!1061Development,!1046Patch,!1012Development
...@@ -25,8 +25,10 @@ class Minisucher extends Searchengine ...@@ -25,8 +25,10 @@ class Minisucher extends Searchengine
if (!$content) { if (!$content) {
return; return;
} }
$results = $content->xpath('//response/result/doc'); $results = $content->xpath('//response/result/doc');
$string = ""; $string = "";
$counter = 0; $counter = 0;
...@@ -36,8 +38,8 @@ class Minisucher extends Searchengine ...@@ -36,8 +38,8 @@ class Minisucher extends Searchengine
$counter++; $counter++;
$result = simplexml_load_string($result->saveXML()); $result = simplexml_load_string($result->saveXML());
$title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString(); $title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString();
$link = $result->xpath('//doc/str[@name="url"]')[0]->__toString(); $link = $result->xpath('//doc/str[@name="url"]')[0]->__toString();
$anzeigeLink = $link; $anzeigeLink = $link;
$descr = ""; $descr = "";
$descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str"); $descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str");
...@@ -55,8 +57,17 @@ class Minisucher extends Searchengine ...@@ -55,8 +57,17 @@ class Minisucher extends Searchengine
$additionalInformation = ['date' => $dateVal]; $additionalInformation = ['date' => $dateVal];
$minism = simplexml_load_string($this->engine)["subcollections"]; $minism = simplexml_load_string($this->engine)["subcollections"];
$gefVon = "<a href=\"https://metager.de\" target=\"_blank\" rel=\"noopener\">Minisucher: $minism </a>"; $subcollection = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString();
if(!$subcollection) {
$gefVon = "<a href=\"https://metager.de\" target=\"_blank\" rel=\"noopener\">Minisucher: $minism </a>";
} else {
$minism = array_map('strtolower', explode(', ', $minism));
$subcollection = array_map('strtolower', explode(' ', $subcollection));
$result = implode(', ', array_intersect($subcollection, $minism));
$gefVon = "<a href=\"https://metager.de\" target=\"_blank\" rel=\"noopener\">Minisucher: $result </a>";
}
$this->results[] = new \App\Models\Result( $this->results[] = new \App\Models\Result(
$this->engine, $this->engine,
$title, $title,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment