Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
99043fc4
Commit
99043fc4
authored
Jan 12, 2017
by
Phil Höfer
Browse files
dict.cc nur für Suchen mit weniger als 3 Wörtern
parent
38af0127
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/MetaGerSearch.php
View file @
99043fc4
...
...
@@ -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
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment