Skip to content
Snippets Groups Projects
Commit 8ad527cf authored by Phil Höfer's avatar Phil Höfer
Browse files

dict.cc nur für Suchen mit weniger als 3 Wörtern

parent f1e9edb3
2 merge requests!697Development,!692dict.cc nur für Suchen mit weniger als 3 Wörtern
...@@ -166,19 +166,21 @@ class MetaGerSearch extends Controller ...@@ -166,19 +166,21 @@ class MetaGerSearch extends Controller
$mquicktips = array_merge($mquicktips, $quicktips); $mquicktips = array_merge($mquicktips, $quicktips);
# Dict.cc Quicktip # Dict.cc Quicktip
$url = "http://www.dict.cc/metager.php?s=" . urlencode($q); if (count(explode(' ', $q)) < 3) {
$decodedResponse = json_decode($this->get($url), true); $url = "http://www.dict.cc/metager.php?s=" . urlencode($q);
if ($decodedResponse["headline"] != "" && $decodedResponse["link"] != "") { $decodedResponse = json_decode($this->get($url), true);
$quicktip = []; if ($decodedResponse["headline"] != "" && $decodedResponse["link"] != "") {
$quicktip["title"] = $decodedResponse["headline"]; $quicktip = [];
$quicktip["URL"] = $decodedResponse["link"]; $quicktip["title"] = $decodedResponse["headline"];
$quicktip["summary"] = implode(", ", $decodedResponse["translations"]); $quicktip["URL"] = $decodedResponse["link"];
$quicktip['gefVon'] = trans('metaGerSearch.quicktips.dictcc.adress'); $quicktip["summary"] = implode(", ", $decodedResponse["translations"]);
$quicktip['gefVon'] = trans('metaGerSearch.quicktips.dictcc.adress');
if (App::isLocale('de')) {
array_unshift($mquicktips, $quicktip); if (App::isLocale('de')) {
} else { array_unshift($mquicktips, $quicktip);
$mquicktips[] = $quicktip; } else {
$mquicktips[] = $quicktip;
}
} }
} }
......
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