aboutsummaryrefslogtreecommitdiffstats
path: root/mod/search.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-07-14 20:39:46 -0700
committerfriendica <info@friendica.com>2012-07-14 20:39:46 -0700
commit03209d2d0dc6b0ceed2325bff598fede2c538301 (patch)
treefb230666b2b79f97ddd744fe155a4b088640ad29 /mod/search.php
parenta20a6377277a985fa596b0ea460d91b97f79b4a5 (diff)
downloadvolse-hubzilla-03209d2d0dc6b0ceed2325bff598fede2c538301.tar.gz
volse-hubzilla-03209d2d0dc6b0ceed2325bff598fede2c538301.tar.bz2
volse-hubzilla-03209d2d0dc6b0ceed2325bff598fede2c538301.zip
updates
Diffstat (limited to 'mod/search.php')
-rw-r--r--mod/search.php46
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;
}