diff --git a/app/Models/Result.php b/app/Models/Result.php index 6ff2db9601dc82f020b19867602e5e602f0fe627..c5433f4f4c15e4c676f9cd7850127959834af764 100644 --- a/app/Models/Result.php +++ b/app/Models/Result.php @@ -11,7 +11,8 @@ class Result public $titel; # Der Groß Angezeigte Name für das Suchergebnis public $link; # Der Link auf die Ergebnisseite public $anzeigeLink; # Der tatsächlich angezeigte Link (rein optisch) - public $descr; # Die Beschreibung des Suchergebnisses + public $descr; # Die eventuell gekürzte Beschreibung des Suchergebnisses + public $longDescr; # Die ungekürzte Beschreibung des Suchergebnisses public $gefVon; # Das bei Suchergebnissen angezeigte von ... mitsamt Verlinkung public $sourceRank; # Das Ranking für dieses Suchergebnis von der Seite, die es geliefert hat (implizit durch Ergebnisreihenfolge: 20 - Position in Ergebnisliste) public $partnershop; # Ist das Ergebnis von einem Partnershop? (bool) @@ -35,6 +36,7 @@ class Result $this->anzeigeLink = trim($anzeigeLink); $this->descr = strip_tags(trim($descr), '<p>'); $this->descr = preg_replace("/\n+/si", " ", $this->descr); + $this->longDescr = $this->descr; if (strlen($this->descr) > 250) { $this->descr = wordwrap($this->descr, 250); $this->descr = substr($this->descr, 0, strpos($this->descr, "\n")); @@ -226,7 +228,7 @@ class Result # Eventueller Sprachfilter if ($metager->getLang() !== "all") { - if (!isset($this->langCode) || $this->langCode === NULL || $metager->getLang() !== $this->langCode) { + if (!isset($this->langCode) || $this->langCode === null || $metager->getLang() !== $this->langCode) { return false; } @@ -244,11 +246,11 @@ class Result # Phrasensuche: $text = strtolower($this->titel) . " " . strtolower($this->descr); foreach ($metager->getPhrases() as $phrase) { - if (strpos($text, $phrase) === false) { - return false; - } + if (strpos($text, $phrase) === false) { + return false; } - */ + } + */ /* Der Host-Filter der sicherstellt, * dass von jedem Host maximal 3 Links angezeigt werden. * Diese Überprüfung führen wir unter bestimmten Bedingungen nicht durch. @@ -315,26 +317,26 @@ class Result if (!$link) { return ""; } - + # Link to our new Proxy software: $pw = md5(env('PROXY_PASSWORD') . $link); $proxyUrl = base64_encode(str_rot13($link)); $proxyUrl = urlencode(str_replace("/", "<<SLASH>>", $proxyUrl)); - + return "https://proxy.suma-ev.de/" . $pw . "/" . $proxyUrl; /* - $tmp = $link; - $tmp = preg_replace("/\r?\n$/s", "", $tmp); - $tmp = str_replace("=", "=3d", $tmp); - $tmp = str_replace("?", "=3f", $tmp); - $tmp = str_replace("%", "=25", $tmp); - $tmp = str_replace("&", "=26", $tmp); - $tmp = str_replace(";", "=3b", $tmp); - $tmp = preg_replace("#^([\w+.-]+)://#s", "$1/", $tmp); - $tmp = str_replace("//", "/=2f", $tmp); - return "https://proxy.suma-ev.de/mger/nph-proxy.cgi/en/w0/" . $tmp; -*/ +$tmp = $link; +$tmp = preg_replace("/\r?\n$/s", "", $tmp); +$tmp = str_replace("=", "=3d", $tmp); +$tmp = str_replace("?", "=3f", $tmp); +$tmp = str_replace("%", "=25", $tmp); +$tmp = str_replace("&", "=26", $tmp); +$tmp = str_replace(";", "=3b", $tmp); +$tmp = preg_replace("#^([\w+.-]+)://#s", "$1/", $tmp); +$tmp = str_replace("//", "/=2f", $tmp); +return "https://proxy.suma-ev.de/mger/nph-proxy.cgi/en/w0/" . $tmp; + */ } /* Liest aus einer URL alle Informationen aus diff --git a/resources/views/metager3resultsrss20.blade.php b/resources/views/metager3resultsrss20.blade.php index 71b145b26133d66660e84bd96417d5fdde33f4d0..f8fb9ac93226ddc4019c46706291643d55bb802c 100644 --- a/resources/views/metager3resultsrss20.blade.php +++ b/resources/views/metager3resultsrss20.blade.php @@ -14,7 +14,7 @@ <link>{!! htmlspecialchars($result->link, ENT_XML1, 'UTF-8'); !!}</link> <mg:anzeigeLink>{!! htmlspecialchars($result->anzeigeLink, ENT_XML1, 'UTF-8'); !!}</mg:anzeigeLink> <description> - {!! htmlspecialchars($result->descr, ENT_XML1, 'UTF-8'); !!} + {!! htmlspecialchars($result->longDescr, ENT_XML1, 'UTF-8'); !!} </description> </item> @endforeach