Merge pull request #4541 from rabuzarus/20180303_-_fix_directory_search

fix page counter in directory module
This commit is contained in:
Hypolite Petovan 2018-03-03 14:13:51 -05:00 committed by GitHub
commit 716747cc77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -81,12 +81,12 @@ function directory_content(App $a)
$publish = ((Config::get('system', 'publish_all')) ? '' : " AND `publish` = 1 " );
$total = q("SELECT COUNT(*) AS `total` FROM `profile`
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra "
$cnt = dba::select_first("SELECT COUNT(*) AS `total` FROM `profile`
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra "
);
if (DBM::is_result($total)) {
$a->set_pager_total($total[0]['total']);
if (DBM::is_result($cnt)) {
$a->set_pager_total($cnt['total']);
}
$order = " ORDER BY `name` ASC ";