mirror of
https://github.com/friendica/friendica
synced 2025-04-26 06:30:11 +00:00
Endless scrolling for searches and contact comments
This commit is contained in:
parent
0b37f1d56c
commit
88a0e976da
10 changed files with 77 additions and 23 deletions
|
@ -155,15 +155,17 @@ class Index extends BaseSearch
|
|||
DI::config()->get('system', 'itemspage_network'));
|
||||
}
|
||||
|
||||
$last_uriid = isset($_GET['last_uriid']) ? intval($_GET['last_uriid']) : 0;
|
||||
Logger::info('Blubb', ['uri' => $last_uriid]);
|
||||
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), $itemsPerPage);
|
||||
|
||||
if ($tag) {
|
||||
Logger::info('Start tag search.', ['q' => $search]);
|
||||
$uriids = Tag::getURIIdListByTag($search, local_user(), $pager->getStart(), $pager->getItemsPerPage());
|
||||
$uriids = Tag::getURIIdListByTag($search, local_user(), $pager->getStart(), $pager->getItemsPerPage(), $last_uriid);
|
||||
$count = Tag::countByTag($search, local_user());
|
||||
} else {
|
||||
Logger::info('Start fulltext search.', ['q' => $search]);
|
||||
$uriids = ItemContent::getURIIdListBySearch($search, local_user(), $pager->getStart(), $pager->getItemsPerPage());
|
||||
$uriids = ItemContent::getURIIdListBySearch($search, local_user(), $pager->getStart(), $pager->getItemsPerPage(), $last_uriid);
|
||||
$count = ItemContent::countBySearch($search, local_user());
|
||||
}
|
||||
|
||||
|
@ -177,6 +179,11 @@ class Index extends BaseSearch
|
|||
return $o;
|
||||
}
|
||||
|
||||
if (DI::pConfig()->get(local_user(), 'system', 'infinite_scroll')) {
|
||||
$tpl = Renderer::getMarkupTemplate('infinite_scroll_head.tpl');
|
||||
$o .= Renderer::replaceMacros($tpl, ['$reload_uri' => DI::args()->getQueryString()]);
|
||||
}
|
||||
|
||||
if ($tag) {
|
||||
$title = DI::l10n()->t('Items tagged with: %s', $search);
|
||||
} else {
|
||||
|
@ -191,7 +198,12 @@ class Index extends BaseSearch
|
|||
|
||||
$o .= conversation(DI::app(), $items, 'search', false, false, 'commented', local_user());
|
||||
|
||||
$o .= $pager->renderMinimal($count);
|
||||
if (DI::pConfig()->get(local_user(), 'system', 'infinite_scroll')) {
|
||||
$o .= HTML::scrollLoader();
|
||||
} else {
|
||||
$o .= $pager->renderMinimal($count);
|
||||
}
|
||||
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue