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