diff options
Diffstat (limited to 'mod/search.php')
-rw-r--r-- | mod/search.php | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/mod/search.php b/mod/search.php index e9e20b227..5ba35d2b3 100644 --- a/mod/search.php +++ b/mod/search.php @@ -130,21 +130,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`, @@ -170,6 +173,12 @@ function search_content(&$a) { $a = fetch_post_tags($a); + if(! count($r)) { + info( t('No results.') . EOL); + return $o; + } + + if($tag) $o .= '<h2>Items tagged with: ' . htmlspecialchars($search) . '</h2>'; else @@ -177,7 +186,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; } |