Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
open-source
MetaGer
Commits
1654c8d1
Commit
1654c8d1
authored
Apr 11, 2017
by
Phil Höfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nachrichten werden nach Datum sortiert
parent
e98a55d3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
23 deletions
+55
-23
app/MetaGer.php
app/MetaGer.php
+14
-6
app/Models/Result.php
app/Models/Result.php
+11
-2
app/Models/parserSkripte/Onenewspage.php
app/Models/parserSkripte/Onenewspage.php
+7
-5
app/Models/parserSkripte/Onenewspagegermany.php
app/Models/parserSkripte/Onenewspagegermany.php
+12
-5
app/Models/parserSkripte/Onenewspagevideo.php
app/Models/parserSkripte/Onenewspagevideo.php
+7
-5
resources/views/layouts/result.blade.php
resources/views/layouts/result.blade.php
+4
-0
No files found.
app/MetaGer.php
View file @
1654c8d1
...
...
@@ -180,13 +180,21 @@ class MetaGer
// augment (boost&adgoal)
// authorize
// misc (WiP)
uasort
(
$this
->
results
,
function
(
$a
,
$b
)
{
if
(
$a
->
getRank
()
==
$b
->
getRank
())
{
return
0
;
}
if
(
$this
->
fokus
==
"nachrichten"
)
{
uasort
(
$this
->
results
,
function
(
$a
,
$b
)
{
$datea
=
$a
->
getDate
();
$dateb
=
$b
->
getDate
();
return
$dateb
-
$datea
;
});
}
else
{
uasort
(
$this
->
results
,
function
(
$a
,
$b
)
{
if
(
$a
->
getRank
()
==
$b
->
getRank
())
{
return
0
;
}
return
(
$a
->
getRank
()
<
$b
->
getRank
())
?
1
:
-
1
;
});
return
(
$a
->
getRank
()
<
$b
->
getRank
())
?
1
:
-
1
;
});
}
# Validate Results
$newResults
=
[];
...
...
app/Models/Result.php
View file @
1654c8d1
...
...
@@ -62,8 +62,8 @@ class Result
$this
->
strippedLink
=
$this
->
getStrippedLink
(
$this
->
anzeigeLink
);
$this
->
rank
=
0
;
$this
->
partnershop
=
isset
(
$additionalInformation
[
"partnershop"
])
?
$additionalInformation
[
"partnershop"
]
:
false
;
$this
->
image
=
isset
(
$additionalInformation
[
"image"
])
?
$additionalInformation
[
"image"
]
:
""
;
$this
->
price
=
isset
(
$additionalInformation
[
"price"
])
?
$additionalInformation
[
"price"
]
:
0
;
$this
->
image
=
isset
(
$additionalInformation
[
"image"
])
?
$additionalInformation
[
"image"
]
:
""
;
$this
->
price
=
isset
(
$additionalInformation
[
"price"
])
?
$additionalInformation
[
"price"
]
:
0
;
$this
->
additionalInformation
=
$additionalInformation
;
}
...
...
@@ -386,6 +386,15 @@ return "https://proxy.suma-ev.de/mger/nph-proxy.cgi/en/w0/" . $tmp;
return
$this
->
rank
;
}
public
function
getDate
()
{
if
(
isset
(
$this
->
additionalInformation
[
"date"
]))
{
return
$this
->
additionalInformation
[
"date"
];
}
else
{
return
null
;
}
}
public
function
getLangString
()
{
$string
=
""
;
...
...
app/Models/parserSkripte/Onenewspage.php
View file @
1654c8d1
...
...
@@ -24,10 +24,11 @@ class Onenewspage extends Searchengine
if
(
sizeof
(
$res
)
<
3
)
{
continue
;
}
$title
=
$res
[
0
];
$link
=
$res
[
2
];
$anzeigeLink
=
$link
;
$descr
=
$res
[
1
];
$title
=
$res
[
0
];
$link
=
$res
[
2
];
$anzeigeLink
=
$link
;
$descr
=
$res
[
1
];
$additionalInformation
=
sizeof
(
$res
)
>
3
?
[
'date'
=>
intval
(
$res
[
3
])]
:
[];
$this
->
counter
++
;
$this
->
results
[]
=
new
\
App\Models\Result
(
...
...
@@ -37,7 +38,8 @@ class Onenewspage extends Searchengine
$anzeigeLink
,
$descr
,
$this
->
gefVon
,
$this
->
counter
$this
->
counter
,
$additionalInformation
);
}
if
(
count
(
$this
->
results
)
>
$this
->
resultCount
)
{
...
...
app/Models/parserSkripte/Onenewspagegermany.php
View file @
1654c8d1
...
...
@@ -27,15 +27,22 @@ class Onenewspagegermany extends Searchengine
if
(
sizeof
(
$result
)
<
3
)
{
continue
;
}
$title
=
$result
[
0
];
$link
=
$result
[
2
];
$anzeigeLink
=
$link
;
$descr
=
$result
[
1
];
$additionalInformation
=
sizeof
(
$result
)
>
3
?
[
'date'
=>
intval
(
$result
[
3
])]
:
[];
$counter
++
;
$this
->
results
[]
=
new
Result
(
$this
->
engine
,
trim
(
strip_tags
(
$result
[
0
]))
,
$
result
[
2
]
,
$
result
[
2
]
,
$
r
es
ult
[
1
]
,
$title
,
$
link
,
$
anzeigeLink
,
$
d
es
cr
,
$this
->
gefVon
,
$counter
$this
->
counter
,
$additionalInformation
);
}
...
...
app/Models/parserSkripte/Onenewspagevideo.php
View file @
1654c8d1
...
...
@@ -23,10 +23,11 @@ class Onenewspagevideo extends Searchengine
if
(
sizeof
(
$res
)
<
3
)
{
continue
;
}
$title
=
$res
[
0
];
$link
=
$res
[
2
];
$anzeigeLink
=
$link
;
$descr
=
$res
[
1
];
$title
=
$res
[
0
];
$link
=
$res
[
2
];
$anzeigeLink
=
$link
;
$descr
=
$res
[
1
];
$additionalInformation
=
sizeof
(
$res
)
>
3
?
[
'date'
=>
intval
(
$res
[
3
])]
:
[];
$this
->
counter
++
;
$this
->
results
[]
=
new
\
App\Models\Result
(
...
...
@@ -36,7 +37,8 @@ class Onenewspagevideo extends Searchengine
$anzeigeLink
,
$descr
,
$this
->
gefVon
,
$this
->
counter
$this
->
counter
,
$additionalInformation
);
}
if
(
count
(
$this
->
results
)
>
$this
->
resultCount
)
{
...
...
resources/views/layouts/result.blade.php
View file @
1654c8d1
...
...
@@ -75,7 +75,11 @@
{!! $result->descr !!}
</div>
@else
@if( $metager->getFokus() == "nachrichten" )
<div
class=
"description"
>
{{ date("Y-m-d H:i:s", $result->additionalInformation["date"]) }} {{ $result->descr }}
</div>
@else
<div
class=
"description"
>
{{ $result->descr }}
</div>
@endif
@endif
</div>
</div>
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