diff options
author | friendica <info@friendica.com> | 2015-01-29 00:28:23 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-01-29 00:28:23 -0800 |
commit | fd0b6c967fce4d8a82e9dad121ae7d8301d3f342 (patch) | |
tree | 5c37812ef7baeadc17fce088c4394d25f75b593c /mod/search.php | |
parent | c993ddd86ee25832e35e65333fa25b396e7aefdf (diff) | |
parent | 872b165eb2bb5d632a12f2d7e1a28e195c2d5348 (diff) | |
download | volse-hubzilla-fd0b6c967fce4d8a82e9dad121ae7d8301d3f342.tar.gz volse-hubzilla-fd0b6c967fce4d8a82e9dad121ae7d8301d3f342.tar.bz2 volse-hubzilla-fd0b6c967fce4d8a82e9dad121ae7d8301d3f342.zip |
Merge branch 'master' into pocorate
Diffstat (limited to 'mod/search.php')
-rw-r--r-- | mod/search.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mod/search.php b/mod/search.php index 5b15b0593..02b250bbe 100644 --- a/mod/search.php +++ b/mod/search.php @@ -9,7 +9,7 @@ function search_init(&$a) { function search_content(&$a,$update = 0, $load = false) { if((get_config('system','block_public')) || (get_config('system','block_public_search'))) { - if ((! local_user()) && (! remote_user())) { + if ((! local_channel()) && (! remote_channel())) { notice( t('Public access denied.') . EOL); return; } @@ -44,8 +44,8 @@ function search_content(&$a,$update = 0, $load = false) { $search = ((x($_GET,'tag')) ? trim(rawurldecode($_GET['tag'])) : ''); } - if((! local_user()) || (! feature_enabled(local_user(),'savedsearch'))) - $o .= search($search,'search-box','/search',((local_user()) ? true : false)); + if((! local_channel()) || (! feature_enabled(local_channel(),'savedsearch'))) + $o .= search($search,'search-box','/search',((local_channel()) ? true : false)); if(strpos($search,'#') === 0) { $tag = true; @@ -87,7 +87,7 @@ function search_content(&$a,$update = 0, $load = false) { // because browser prefetching might change it on us. We have to deliver it with the page. $o .= '<div id="live-search"></div>' . "\r\n"; - $o .= "<script> var profile_uid = " . ((intval(local_user())) ? local_user() : (-1)) + $o .= "<script> var profile_uid = " . ((intval(local_channel())) ? local_channel() : (-1)) . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; $a->page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array( @@ -128,7 +128,7 @@ function search_content(&$a,$update = 0, $load = false) { $sys = get_sys_channel(); if(($update) && ($load)) { - $itemspage = get_pconfig(local_user(),'system','itemspage'); + $itemspage = get_pconfig(local_channel(),'system','itemspage'); $a->set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval($a->pager['itemspage']), intval($a->pager['start'])); @@ -147,14 +147,14 @@ function search_content(&$a,$update = 0, $load = false) { $prefix = 'distinct'; $suffix = 'group by mid ORDER BY created DESC'; } - if(local_user()) { + if(local_channel()) { $r = q("SELECT $prefix mid, item.id as item_id, item.* from item WHERE item_restrict = 0 AND ((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) OR ( `item`.`uid` = %d )) OR item.owner_xchan = '%s' ) $sql_extra $suffix $pager_sql ", - intval(local_user()), + intval(local_channel()), dbesc($sys['xchan_hash']) ); } |