X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsearch.php;h=8f73b92448d7630e02fd1fc105612dcf7853fd92;hb=283e91cd6ae06d63fadd6f626a72326d0d39aae2;hp=320ffddcef2fbc0df671e6c58e5c26937372711a;hpb=70c4ab68754941749a5e89434d6db19f6bba1e16;p=friendica.git diff --git a/mod/search.php b/mod/search.php index 320ffddcef..8f73b92448 100644 --- a/mod/search.php +++ b/mod/search.php @@ -128,21 +128,24 @@ function search_content(&$a) { // OR your own posts if you are a logged in member // No items will be shown if the member has a blocked profile wall. - $r = q("SELECT distinct(`item`.`uri`) as `total` - FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid` - WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 - AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0) - OR `item`.`uid` = %d ) - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - $sql_extra group by `item`.`uri` ", - intval(local_user()) - ); - - if(count($r)) - $a->set_pager_total(count($r)); - if(! count($r)) { - info( t('No results.') . EOL); - return $o; + if(! get_pconfig(local_user(),'system','alt_pager')) { + $r = q("SELECT distinct(`item`.`uri`) as `total` + FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid` + WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 + AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0) + OR `item`.`uid` = %d ) + AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 + $sql_extra group by `item`.`uri` ", + intval(local_user()) + ); + + if(count($r)) + $a->set_pager_total(count($r)); + + if(! count($r)) { + info( t('No results.') . EOL); + return $o; + } } $r = q("SELECT distinct(`item`.`uri`), `item`.*, `item`.`id` AS `item_id`, @@ -165,6 +168,12 @@ function search_content(&$a) { ); + if(! count($r)) { + info( t('No results.') . EOL); + return $o; + } + + if($tag) $o .= '

Items tagged with: ' . $search . '

'; else @@ -172,7 +181,12 @@ function search_content(&$a) { $o .= conversation($a,$r,'search',false); - $o .= paginate($a); + if(! get_pconfig(local_user(),'system','alt_pager')) { + $o .= paginate($a); + } + else { + $o .= alt_pager($a,count($r)); + } return $o; }