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
c7303d54
Commit
c7303d54
authored
Apr 25, 2019
by
Dominik Hebeler
Browse files
fixed dublettenfilter and added new optional parameter to sumas.json
parent
ec1a2145
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Models/Result.php
View file @
c7303d54
...
...
@@ -35,6 +35,7 @@ class Result
# Erstellt ein neues Ergebnis
public
function
__construct
(
$provider
,
$titel
,
$link
,
$anzeigeLink
,
$descr
,
$gefVon
,
$gefVonLink
,
$sourceRank
,
$additionalInformation
=
[])
{
$this
->
provider
=
$provider
;
$this
->
titel
=
strip_tags
(
trim
(
$titel
));
$this
->
link
=
trim
(
$link
);
$this
->
anzeigeLink
=
trim
(
$anzeigeLink
);
...
...
@@ -278,7 +279,27 @@ class Result
/* Der Dublettenfilter, der sicher stellt,
* dass wir nach Möglichkeit keinen Link doppelt in der Ergebnisliste haben.
*/
if
(
$metager
->
addLink
(
$this
->
strippedLink
))
{
$dublettenLink
=
$this
->
strippedLink
;
if
(
!
empty
(
$this
->
provider
->
{
"dubletten-include-parameter"
})
&&
sizeof
(
$this
->
provider
->
{
"dubletten-include-parameter"
})
>
0
)
{
$dublettenLink
.
=
"?"
;
$query
=
parse_url
(
$this
->
link
);
if
(
!
empty
(
$query
[
"query"
]))
{
$queryTmp
=
explode
(
"&"
,
$query
[
"query"
]);
$query
=
[];
foreach
(
$queryTmp
as
$getParameter
)
{
$keyVal
=
explode
(
"="
,
$getParameter
);
$query
[
$keyVal
[
0
]]
=
$keyVal
[
1
];
}
foreach
(
$this
->
provider
->
{
"dubletten-include-parameter"
}
as
$param
)
{
if
(
!
empty
(
$query
[
$param
]))
{
$dublettenLink
.
=
$param
.
"="
.
$query
[
$param
]
.
"&"
;
}
}
$dublettenLink
=
rtrim
(
$dublettenLink
,
"&"
);
}
}
if
(
$metager
->
addLink
(
$dublettenLink
))
{
$metager
->
addHostCount
(
$this
->
strippedHost
);
return
true
;
}
else
{
...
...
Write
Preview
Markdown
is supported
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