mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 10:35:15 +00:00
directory search for pubforums using hubzilla directory servers using redmatrix flag value
This commit is contained in:
parent
350519d429
commit
5805a54097
1 changed files with 9 additions and 3 deletions
|
@ -124,8 +124,6 @@ function dirsearch_content(&$a) {
|
|||
if($keywords)
|
||||
$sql_extra .= dir_query_build($joiner,'xprof_keywords',$keywords);
|
||||
|
||||
if($forums)
|
||||
$safesql .= dir_flag_build(' AND ','xchan_flags',XCHAN_FLAGS_PUBFORUM, $forums);
|
||||
|
||||
// we only support an age range currently. You must set both agege
|
||||
// (greater than or equal) and agele (less than or equal)
|
||||
|
@ -173,6 +171,9 @@ function dirsearch_content(&$a) {
|
|||
if($safe < 0)
|
||||
$safesql = " and ( xchan_censored = 1 OR xchan_selfcensored = 1 ) ";
|
||||
|
||||
if($forums)
|
||||
$safesql .= " and xchan_pubforum = " . ((intval($forums)) ? '1 ' : '0 ');
|
||||
|
||||
if($limit)
|
||||
$qlimit = " LIMIT $limit ";
|
||||
else {
|
||||
|
@ -185,7 +186,6 @@ function dirsearch_content(&$a) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if($sort_order == 'normal') {
|
||||
$order = " order by xchan_name asc ";
|
||||
|
||||
|
@ -202,6 +202,7 @@ function dirsearch_content(&$a) {
|
|||
else
|
||||
$order = " order by xchan_name_date desc ";
|
||||
|
||||
|
||||
if($sync) {
|
||||
$spkt = array('transactions' => array());
|
||||
$r = q("select * from updates where ud_date >= '%s' and ud_guid != '' order by ud_date desc",
|
||||
|
@ -245,15 +246,20 @@ function dirsearch_content(&$a) {
|
|||
json_return_and_die($spkt);
|
||||
}
|
||||
else {
|
||||
|
||||
$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 xchan_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0
|
||||
$safesql $order $qlimit "
|
||||
);
|
||||
|
||||
|
||||
|
||||
$ret['page'] = $page + 1;
|
||||
$ret['records'] = count($r);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($r) {
|
||||
|
||||
$entries = array();
|
||||
|
|
Loading…
Reference in a new issue