Merge pull request #8293 from MrPetovan/task/5562-community-pagination

Improve community pagination
This commit is contained in:
Philipp 2020-02-16 19:38:49 +01:00 committed by GitHub
commit da124af6ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 710 additions and 499 deletions

View file

@ -85,7 +85,7 @@ class Contacts extends BaseProfile
$total = DBA::count('contact', $condition);
$pager = new Pager(DI::args()->getQueryString());
$pager = new Pager(DI::l10n(), DI::args()->getQueryString());
$params = ['order' => ['name' => false], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];

View file

@ -166,12 +166,12 @@ class Status extends BaseProfile
$sql_extra3 = "";
}
// check if we serve a mobile device and get the user settings
// accordingly
if (DI::mode()->isMobile()) {
$itemspage_network = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network', 10);
$itemspage_network = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
$itemspage_network = DI::pConfig()->get(local_user(), 'system', 'itemspage_network', 20);
$itemspage_network = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
// now that we have the user settings, see if the theme forces
@ -180,7 +180,7 @@ class Status extends BaseProfile
$itemspage_network = $a->force_max_items;
}
$pager = new Pager($args->getQueryString(), $itemspage_network);
$pager = new Pager(DI::l10n(), $args->getQueryString(), $itemspage_network);
$pager_sql = sprintf(" LIMIT %d, %d ", $pager->getStart(), $pager->getItemsPerPage());
@ -231,7 +231,7 @@ class Status extends BaseProfile
$items = array_merge($items, $pinned);
}
$o .= conversation($a, $items, $pager, 'profile', false, false, 'pinned_received', $a->profile['uid']);
$o .= conversation($a, $items, 'profile', false, false, 'pinned_received', $a->profile['uid']);
$o .= $pager->renderMinimal(count($items));