Skip to content
Snippets Groups Projects
Commit 3072d67a authored by Aria Givi's avatar Aria Givi
Browse files

sollte subcollection snicht ions nicht vorhanden seien wird stattdessen minism ausgegeben

parent 9a0023d7
No related branches found
No related tags found
1 merge request!1365Resolve "Filter Options for MetaGer"
...@@ -37,6 +37,7 @@ class Minisucher extends Searchengine ...@@ -37,6 +37,7 @@ class Minisucher extends Searchengine
try { try {
$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;
...@@ -55,12 +56,18 @@ class Minisucher extends Searchengine ...@@ -55,12 +56,18 @@ class Minisucher extends Searchengine
$additionalInformation = ['date' => $dateVal]; $additionalInformation = ['date' => $dateVal];
$subcollection = array_map('strtolower', explode(' ', $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString())); $minism = simplexml_load_string($this->engine)["subcollections"];
$minism = array_map('strtolower', explode(', ', simplexml_load_string($this->engine)["subcollections"])); $subcollection = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString();
$result = implode(', ', array_intersect($subcollection, $minism));
$gefVon = "<a href=\"https://metager.de\" target=\"_blank\" rel=\"noopener\">Minisucher: $result </a>";
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