return ' LIMIT 100';
}
- // 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');
- $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 20);
+ $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');
- $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 40);
+ $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
$condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT,
'contact-id'=> $a->contact['id']];
- $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 40);
+ if (DI::mode()->isMobile()) {
+ $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
+ DI::config()->get('system', 'itemspage_network_mobile'));
+ } else {
+ $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
+ DI::config()->get('system', 'itemspage_network'));
+ }
+
+ $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), $itemsPerPage);
$params = ['order' => ['created' => true],
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
}
}
- $itemspage_network = !empty($_POST['itemspage_network']) ? intval($_POST['itemspage_network']) : 40;
+ $itemspage_network = !empty($_POST['itemspage_network']) ?
+ intval($_POST['itemspage_network']) :
+ DI::config()->get('system', 'itemspage_network');
if ($itemspage_network > 100) {
$itemspage_network = 100;
}
- $itemspage_mobile_network = !empty($_POST['itemspage_mobile_network']) ? intval($_POST['itemspage_mobile_network']) : 20;
+ $itemspage_mobile_network = !empty($_POST['itemspage_mobile_network']) ?
+ intval($_POST['itemspage_mobile_network']) :
+ DI::config()->get('system', 'itemspage_network_mobile');
if ($itemspage_mobile_network > 100) {
$itemspage_mobile_network = 100;
}
}
$itemspage_network = intval(DI::pConfig()->get(local_user(), 'system', 'itemspage_network'));
- $itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : 40); // default if not set: 40 items
+ $itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : DI::config()->get('system', 'itemspage_network'));
$itemspage_mobile_network = intval(DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network'));
- $itemspage_mobile_network = (($itemspage_mobile_network > 0 && $itemspage_mobile_network < 101) ? $itemspage_mobile_network : 20); // default if not set: 20 items
+ $itemspage_mobile_network = (($itemspage_mobile_network > 0 && $itemspage_mobile_network < 101) ? $itemspage_mobile_network : DI::config()->get('system', 'itemspage_network_mobile'));
$nosmile = DI::pConfig()->get(local_user(), 'system', 'no_smilies', 0);
$first_day_of_week = DI::pConfig()->get(local_user(), 'system', 'first_day_of_week', 0);
$cid, GRAVITY_PARENT, GRAVITY_COMMENT, local_user()];
}
- $pager = new Pager(DI::l10n(), DI::args()->getQueryString());
+ if (DI::mode()->isMobile()) {
+ $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
+ DI::config()->get('system', 'itemspage_network_mobile'));
+ } else {
+ $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
+ DI::config()->get('system', 'itemspage_network'));
+ }
+
+ $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), $itemsPerPage);
$params = ['order' => ['received' => true],
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
$header = DI::l10n()->t('Forum Search - %s', $search);
}
- $pager = new Pager(DI::l10n(), DI::args()->getQueryString());
+ if (DI::mode()->isMobile()) {
+ $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
+ DI::config()->get('system', 'itemspage_network_mobile'));
+ } else {
+ $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
+ DI::config()->get('system', 'itemspage_network'));
+ }
+
+ $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), $itemsPerPage);
if ($localSearch && empty($results)) {
$pager->setItemsPerPage(80);
}
}
- // check if we serve a mobile device and get the user settings accordingly
if (DI::mode()->isMobile()) {
- self::$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network', 20);
+ self::$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
+ DI::config()->get('system', 'itemspage_network_mobile'));
} else {
- self::$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_network', 40);
+ self::$itemsPerPage = 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
* @param $itemspage
* @return array
* @throws \Exception
+ * @TODO Move to repository/factory
*/
private static function selectItems($since_id, $max_id, $itemspage)
{
$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
// OR your own posts if you are a logged in member
// No items will be shown if the member has a blocked profile wall.
- $pager = new Pager(DI::l10n(), DI::args()->getQueryString());
+ if (DI::mode()->isMobile()) {
+ $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
+ DI::config()->get('system', 'itemspage_network_mobile'));
+ } else {
+ $itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
+ DI::config()->get('system', 'itemspage_network'));
+ }
+
+ $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), $itemsPerPage);
if ($tag) {
Logger::info('Start tag search.', ['q' => $search]);
// If set true registration is only possible after a current member of the node has send an invitation.
'invitation_only' => false,
+ // itemspage_network (Integer)
+ // default number of items per page in stream pages (network, community, profile/contact statuses, search)
+ 'itemspage_network' => 40,
+
+ // itemspage_network_mobile (Integer)
+ // default number of items per page in stream pages (network, community, profile/contact statuses, search)
+ // on detected mobile devices
+ 'itemspage_network_mobile' => 20,
+
// like_no_comment (Boolean)
// Don't update the "commented" value of an item when it is liked.
'like_no_comment' => false,