mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 04:15:12 +00:00
directory search by hub
This commit is contained in:
parent
2971ee9a4c
commit
c4c80a2e47
1 changed files with 3 additions and 1 deletions
|
@ -23,6 +23,7 @@ function dirsearch_content(&$a) {
|
|||
}
|
||||
|
||||
$name = ((x($_REQUEST,'name')) ? $_REQUEST['name'] : '');
|
||||
$hub = ((x($_REQUEST,'hub')) ? $_REQUEST['hub'] : '');
|
||||
$address = ((x($_REQUEST,'address')) ? $_REQUEST['address'] : '');
|
||||
$locale = ((x($_REQUEST,'locale')) ? $_REQUEST['locale'] : '');
|
||||
$region = ((x($_REQUEST,'region')) ? $_REQUEST['region'] : '');
|
||||
|
@ -38,6 +39,8 @@ function dirsearch_content(&$a) {
|
|||
|
||||
if($name)
|
||||
$sql_extra .= " OR xchan_name like '" . protect_sprintf( '%' . dbesc($name) . '%' ) . "' ";
|
||||
if($hub)
|
||||
$sql_extra .= " OR xchan_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') ";
|
||||
if($address)
|
||||
$sql_extra .= " OR xchan_addr like '" . protect_sprintf( '%' . dbesc($address) . '%' ) . "' ";
|
||||
if($city)
|
||||
|
@ -96,7 +99,6 @@ function dirsearch_content(&$a) {
|
|||
|
||||
$order = " ORDER BY `xchan_name` ASC ";
|
||||
|
||||
|
||||
$r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and not ( xchan_flags & %d ) $order $qlimit ",
|
||||
intval(XCHAN_FLAGS_HIDDEN)
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue