fix page counter in directory module

This commit is contained in:
rabuzarus 2018-03-03 19:31:15 +01:00
parent c78572bf47
commit e18f3844da

View file

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