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
75a08edc
Commit
75a08edc
authored
Sep 01, 2016
by
Dominik Hebeler
Browse files
Pagination für Onenewspage implementiert
parent
3c6d646f
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Models/parserSkripte/Onenewspage.php
View file @
75a08edc
...
...
@@ -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
;
}
}
app/Models/parserSkripte/Onenewspagegermany.php
View file @
75a08edc
...
...
@@ -7,8 +7,10 @@ use App\Models\Searchengine;
class
Onenewspagegermany
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 Onenewspagegermany extends Searchengine
}
}
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
Onenewspagegermany
(
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
Onenewspagegermany
(
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
;
}
}
app/Models/parserSkripte/Onenewspagevideo.php
View file @
75a08edc
...
...
@@ -6,8 +6,10 @@ use App\Models\Searchengine;
class
Onenewspagevideo
extends
Searchengine
{
public
$results
=
[];
public
$results
=
[];
public
$resultCount
=
0
;
private
$offset
=
0
;
public
function
__construct
(
\
SimpleXMLElement
$engine
,
\
App\MetaGer
$metager
)
{
parent
::
__construct
(
$engine
,
$metager
);
...
...
@@ -37,6 +39,36 @@ class Onenewspagevideo 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
Onenewspagevideo
(
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
Onenewspagevideo
(
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
;
}
}
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