Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Merge requests
!322
Pagination für Onenewspage implementiert
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Pagination für Onenewspage implementiert
202-onenewspage-zur-pagination-hinzufugen
into
development
Overview
0
Commits
1
Pipelines
0
Changes
3
Merged
Dominik Hebeler
requested to merge
202-onenewspage-zur-pagination-hinzufugen
into
development
8 years ago
Overview
0
Commits
1
Pipelines
0
Changes
3
Expand
Closes
#202 (closed)
0
0
Merge request reports
Compare
development
development (base)
and
latest version
latest version
3b4149d3
1 commit,
8 years ago
3 files
+
101
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
app/Models/parserSkripte/Onenewspage.php
+
34
−
1
Options
@@ -6,8 +6,10 @@ use App\Models\Searchengine;
class
Onenewspage
extends
Searchengine
{
public
$results
=
[];
public
$results
=
[];
public
$resultCount
=
0
;
private
$offset
=
0
;
public
function
__construct
(
\SimpleXMLElement
$engine
,
\App\MetaGer
$metager
)
{
parent
::
__construct
(
$engine
,
$metager
);
@@ -38,6 +40,37 @@ class Onenewspage extends Searchengine
$this
->
counter
);
}
if
(
count
(
$this
->
results
)
>
$this
->
resultCount
)
{
$this
->
resultCount
+=
count
(
$this
->
results
);
}
}
public
function
getLast
(
\App\MetaGer
$metager
,
$result
)
{
if
(
$metager
->
getPage
()
<=
1
)
{
return
;
}
$last
=
new
Onenewspage
(
simplexml_load_string
(
$this
->
engine
),
$metager
);
$last
->
resultCount
=
$this
->
resultCount
;
$last
->
offset
=
$this
->
offset
-
$this
->
resultCount
;
$last
->
getString
.
=
"&o="
.
$last
->
offset
;
$last
->
hash
=
md5
(
$last
->
host
.
$last
->
getString
.
$last
->
port
.
$last
->
name
);
$this
->
last
=
$last
;
}
public
function
getNext
(
\App\MetaGer
$metager
,
$result
)
{
if
(
count
(
$this
->
results
)
<=
0
)
{
return
;
}
$next
=
new
Onenewspage
(
simplexml_load_string
(
$this
->
engine
),
$metager
);
$next
->
resultCount
=
$this
->
resultCount
;
$next
->
offset
=
$this
->
offset
+
$this
->
resultCount
;
$next
->
getString
.
=
"&o="
.
$next
->
offset
;
$next
->
hash
=
md5
(
$next
->
host
.
$next
->
getString
.
$next
->
port
.
$next
->
name
);
$this
->
next
=
$next
;
}
}
Loading