1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-22 14:13:03 +02:00

Issue #4024 - Pagination url option added to News preferences. Select between 'record' (legacy format eg. page=20, page=40 etc) or 'page' numbers (page=1, page=2 etc). Experimental - requires more testing.

This commit is contained in:
Cameron
2021-07-06 17:53:55 -07:00
parent 36ff7a88be
commit c941e5b98d
6 changed files with 37 additions and 2 deletions

View File

@@ -403,7 +403,16 @@ class news_front
$this->newsUrlparms['author'] = $tp->filter($_GET['author']);
$this->from = intval(varset($_GET['page'],0));
}
// New in v2.3.1 Pagination with "Page" instead of "Record".
if(!empty($this->pref['news_pagination']) && $this->pref['news_pagination'] === 'page' && !empty($_GET['page']))
{
$this->from = (int) ($_GET['page'] - 1) * ITEMVIEW;
}
}
@@ -1083,7 +1092,6 @@ class news_front
$url = rawurlencode(e107::getUrl()->create($this->route, $this->newsUrlparms));
$parms = 'tmpl_prefix='.deftrue('NEWS_NEXTPREV_TMPL', 'default').'&total='.$news_total.'&amount='.$amount.'&current='.$this->from.$nitems.'&url='.$url;
$this->addDebug('newsUrlParms',$this->newsUrlparms);
$paginationSC = false;