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
93fab7e7
Commit
93fab7e7
authored
Aug 04, 2016
by
Phil Höfer
Browse files
boost wieder eingebaut
parent
e5ee2849
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/MetaGer.php
View file @
93fab7e7
...
...
@@ -259,7 +259,10 @@ class MetaGer
//Slice the collection to get the items to display in current page
$currentPageSearchResults
=
$collection
->
slice
(
$offset
*
$perPage
,
$perPage
)
->
all
();
# Für diese 20 Links folgt nun unsere Adgoal Implementation.
# Für diese 20 Links folgt nun unsere Boost-Implementation.
$currentPageSearchResults
=
$this
->
parseBoost
(
$currentPageSearchResults
);
# Für diese 20 Links folgt nun unsere Adgoal- Implementation.
$currentPageSearchResults
=
$this
->
parseAdgoal
(
$currentPageSearchResults
);
//Create our paginator and pass it to the view
...
...
@@ -290,6 +293,25 @@ class MetaGer
}
}
public
function
parseBoost
(
$results
)
{
foreach
(
$results
as
$result
)
{
if
(
preg_match
(
'/^(http[s]?\:\/\/)?(www.)?amazon\.de/'
,
$result
->
anzeigeLink
))
{
if
(
preg_match
(
'/\?/'
,
$result
->
anzeigeLink
))
{
$result
->
link
.
=
'&tag=boostmg01-21'
;
}
else
{
$result
->
link
.
=
'?tag=boostmg01-21'
;
}
$result
->
partnershop
=
true
;
}
}
return
$results
;
}
public
function
parseAdgoal
(
$results
)
{
$publicKey
=
getenv
(
'adgoal_public'
);
...
...
@@ -1053,4 +1075,4 @@ class MetaGer
{
return
$this
->
quicktips
;
}
}
\ No newline at end of file
}
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