$o = '';
if ($search) {
+ $pager = new Pager($a->query_string);
if ($discover_user) {
$j = new stdClass();
Model\GContact::update($user_data);
}
} elseif ($local) {
-
- if ($community)
+ if ($community) {
$extra_sql = " AND `community`";
- else
+ } else {
$extra_sql = "";
+ }
- $perpage = 80;
- $startrec = (($pager->getPage()) * $perpage) - $perpage;
+ $pager->setItemsPerPage(80);
if (Config::get('system','diaspora_enabled')) {
$diaspora = Protocol::DIASPORA;
DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
DBA::escape(escape_tags($search2)), DBA::escape(escape_tags($search2)), DBA::escape(escape_tags($search2)),
DBA::escape(escape_tags($search2)), DBA::escape(escape_tags($search2)), DBA::escape(escape_tags($search2)),
- intval($startrec), intval($perpage));
+ $pager->getStart(), $pager->getItemsPerPage());
$j = new stdClass();
$j->total = $count[0]["total"];
- $j->items_page = $perpage;
+ $j->items_page = $pager->getItemsPerPage();
$j->page = $pager->getPage();
foreach ($results AS $result) {
if (PortableContact::alternateOStatusUrl($result["nurl"])) {
// Add found profiles from the global directory to the local directory
Worker::add(PRIORITY_LOW, 'DiscoverPoCo', "dirsearch", urlencode($search));
} else {
-
$p = (($pager->getPage() != 1) ? '&p=' . $pager->getPage() : '');
- if(strlen(Config::get('system','directory')))
- $x = Network::fetchUrl(get_server().'/lsearch?f=' . $p . '&search=' . urlencode($search));
+ if (strlen(Config::get('system','directory'))) {
+ $x = Network::fetchUrl(get_server() . '/lsearch?f=' . $p . '&search=' . urlencode($search));
+ }
$j = json_decode($x);
+
+ $pager->setItemsPerPage($j->items_page);
}
if (!empty($j->results)) {
- $pager = new Pager($a->query_string, $j->items_page);
-
$id = 0;
foreach ($j->results as $jj) {
}
$tpl = get_markup_template('viewcontact_template.tpl');
-
$o .= replace_macros($tpl,[
'title' => $header,
'$contacts' => $entries,
'$paginate' => $pager->renderFull($j->total),
]);
-
} else {
info(L10n::t('No matches') . EOL);
}
$tags = trim($r[0]['pub_keywords'] . ' ' . $r[0]['prv_keywords']);
if ($tags) {
- $pager = new Pager($a->query_string, $j->items_page);
+ $pager = new Pager($a->query_string);
$params['s'] = $tags;
if ($pager->getPage() != 1) {
$j = json_decode($x);
if (count($j->results)) {
+ $pager->setItemsPerPage($j->items_page);
+
$id = 0;
foreach ($j->results as $jj) {