Commit b2bf8e10 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

included Yahoo on metager.org

parent 52adeff1
......@@ -556,9 +556,10 @@ class MetaGer
# Check if this engine should only be active when filter is used
if ($suma->{"filter-opt-in"}) {
# This search engine should only be used when a parameter filter of it is used
# and no other search engine can provide this filter
$validTmp = false;
foreach ($this->parameterFilter as $filterName => $filter) {
if (!empty($filter->sumas->{$sumaName})) {
if (count((array)$filter->sumas) === 1 && !empty($filter->sumas->{$sumaName})) {
$validTmp = true;
break;
}
......
......@@ -3,6 +3,7 @@
namespace app\Models\parserSkripte;
use App\Models\Searchengine;
use LaravelLocalization;
use Log;
class Overture extends Searchengine
......@@ -12,11 +13,33 @@ class Overture extends Searchengine
public function __construct($name, \stdClass $engine, \App\MetaGer $metager)
{
parent::__construct($name, $engine, $metager);
$this->checkLanguage();
# We need some Affil-Data for the advertisements
$this->getString = $this->generateGetString($this->query);
$this->getString .= $this->getOvertureAffilData($metager->getUrl());
$this->updateHash();
}
private function checkLanguage()
{
if (LaravelLocalization::getCurrentLocale() === 'en') {
$supported_default_languages = [
"en_US" => "us",
"en_GB" => "gb",
"en_IE" => "ie",
"en_AU" => "au",
"en_NZ" => "nz",
];
$preferred_language = request()->getPreferredLanguage(\array_keys($supported_default_languages));
if (\array_key_exists($preferred_language, $supported_default_languages)) {
$this->engine->{"get-parameter"}->mkt = $supported_default_languages[$preferred_language];
}
}
}
public function loadResults($result)
{
$result = preg_replace("/\r\n/si", "", $result);
......
......@@ -94,6 +94,7 @@ return [
"filter.market.ea" => "Englisch (Australien)",
"filter.market.ec" => "Englisch (Kanada)",
"filter.market.ei" => "Englisch (Indien)",
"filter.market.eir" => "Englisch (Irland)",
"filter.market.ein" => "Englisch (Indonesien)",
"filter.market.em" => "Englisch (Malaysia)",
"filter.market.enz" => "Englisch (Neuseeland)",
......
......@@ -94,6 +94,7 @@ return [
"filter.market.ea" => "English (Australia)",
"filter.market.ec" => "English (Canada)",
"filter.market.ei" => "English (India)",
"filter.market.eir" => "English (Ireland)",
"filter.market.ein" => "English (Indonesia)",
"filter.market.em" => "English (Malaysia)",
"filter.market.enz" => "English (New Zealand)",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment