separate the hub query since it changes the logic default and cannot easily be grouped
This commit is contained in:
parent
5bc7c0e798
commit
558246257c
@ -91,6 +91,12 @@ function dirsearch_content(&$a) {
|
|||||||
else
|
else
|
||||||
$sync = false;
|
$sync = false;
|
||||||
|
|
||||||
|
|
||||||
|
if($hub)
|
||||||
|
$hub_query = " and xchan_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') ";
|
||||||
|
else
|
||||||
|
$hub_query = '';
|
||||||
|
|
||||||
$sort_order = ((x($_REQUEST,'order')) ? $_REQUEST['order'] : '');
|
$sort_order = ((x($_REQUEST,'order')) ? $_REQUEST['order'] : '');
|
||||||
|
|
||||||
$joiner = ' OR ';
|
$joiner = ' OR ';
|
||||||
@ -99,8 +105,6 @@ function dirsearch_content(&$a) {
|
|||||||
|
|
||||||
if($name)
|
if($name)
|
||||||
$sql_extra .= dir_query_build($joiner,'xchan_name',$name);
|
$sql_extra .= dir_query_build($joiner,'xchan_name',$name);
|
||||||
if($hub)
|
|
||||||
$sql_extra .= " and xchan_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') ";
|
|
||||||
if($address)
|
if($address)
|
||||||
$sql_extra .= dir_query_build($joiner,'xchan_addr',$address);
|
$sql_extra .= dir_query_build($joiner,'xchan_addr',$address);
|
||||||
if($city)
|
if($city)
|
||||||
@ -248,13 +252,12 @@ function dirsearch_content(&$a) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
$r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where ( $logic $sql_extra ) and xchan_network = 'zot' and not ( xchan_flags & %d )>0 and not ( xchan_flags & %d )>0 and not ( xchan_flags & %d )>0 $safesql $order $qlimit ",
|
$r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where ( $logic $sql_extra ) $hub_query and xchan_network = 'zot' and not ( xchan_flags & %d )>0 and not ( xchan_flags & %d )>0 and not ( xchan_flags & %d )>0 $safesql $order $qlimit ",
|
||||||
intval(XCHAN_FLAGS_HIDDEN),
|
intval(XCHAN_FLAGS_HIDDEN),
|
||||||
intval(XCHAN_FLAGS_ORPHAN),
|
intval(XCHAN_FLAGS_ORPHAN),
|
||||||
intval(XCHAN_FLAGS_DELETED)
|
intval(XCHAN_FLAGS_DELETED)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$ret['page'] = $page + 1;
|
$ret['page'] = $page + 1;
|
||||||
$ret['records'] = count($r);
|
$ret['records'] = count($r);
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
2015-04-06.994
|
2015-04-07.995
|
||||||
|
Reference in New Issue
Block a user