diff options
author | friendica <info@friendica.com> | 2013-12-23 17:24:25 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-12-23 17:24:25 -0800 |
commit | b08d4cc1fe2b8dd45de7546f05cf9a9601aeca03 (patch) | |
tree | 6833e203577682e909bccd4ca92dc0b5e652fd9d /mod/dirsearch.php | |
parent | 49d2ada4f893e4de17567b40873b31e5a63ec01e (diff) | |
download | volse-hubzilla-b08d4cc1fe2b8dd45de7546f05cf9a9601aeca03.tar.gz volse-hubzilla-b08d4cc1fe2b8dd45de7546f05cf9a9601aeca03.tar.bz2 volse-hubzilla-b08d4cc1fe2b8dd45de7546f05cf9a9601aeca03.zip |
first cut at a directory popup. It's a bit annoying at the moment, so we'll have to make it less so. Also had second thoughts about the project homepage changes made yesterday. Just because a bunch of Reddit trolls can't get social networking out of their brain long enough to explore other technologies or even read the project page doesn't mean we should pander to them and explain how or why we either are or aren't a social network.
Diffstat (limited to 'mod/dirsearch.php')
-rw-r--r-- | mod/dirsearch.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php index 6315cae31..6490d59df 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -27,9 +27,10 @@ function dirsearch_content(&$a) { json_return_and_die($ret); } + $hash = ((x($_REQUEST['hash'])) ? $_REQUEST['hash'] : ''); $name = ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''); - $hub = ((x($_REQUEST,'hub')) ? $_REQUEST['hub'] : ''); + $hub = ((x($_REQUEST,'hub')) ? $_REQUEST['hub'] : ''); $address = ((x($_REQUEST,'address')) ? $_REQUEST['address'] : ''); $locale = ((x($_REQUEST,'locale')) ? $_REQUEST['locale'] : ''); $region = ((x($_REQUEST,'region')) ? $_REQUEST['region'] : ''); @@ -91,6 +92,13 @@ function dirsearch_content(&$a) { $sql_extra .= " AND xprof_age >= " . intval($agege) . ") "; } + + if($hash) { + $sql_extra = " AND xchan_hash = '" . dbesc($hash) . "' "; + } + + + $perpage = (($_REQUEST['n']) ? $_REQUEST['n'] : 80); $page = (($_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0); $startrec = (($page+1) * $perpage) - $perpage; @@ -112,6 +120,9 @@ function dirsearch_content(&$a) { $logic = ((strlen($sql_extra)) ? 0 : 1); + if($hash) + $logic = 1; + $safesql = (($safe > 0) ? " and not ( xchan_flags & " . intval(XCHAN_FLAGS_CENSORED|XCHAN_FLAGS_SELFCENSORED) . " ) " : ''); if($safe < 0) $safesql = " and ( xchan_flags & " . intval(XCHAN_FLAGS_CENSORED|XCHAN_FLAGS_SELFCENSORED) . " ) "; @@ -161,13 +172,13 @@ function dirsearch_content(&$a) { json_return_and_die($spkt); } else { - +dbg(1); $r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where ( $logic $sql_extra ) and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $safesql $order $qlimit ", intval(XCHAN_FLAGS_HIDDEN), intval(XCHAN_FLAGS_ORPHAN), intval(XCHAN_FLAGS_DELETED) ); - +dbg(0); } $ret['page'] = $page + 1; @@ -187,6 +198,7 @@ function dirsearch_content(&$a) { // $entry['updated'] = (($rr['ud_date']) ? $rr['ud_date'] : '0000-00-00 00:00:00'); // $entry['update_guid'] = (($rr['ud_guid']) ? $rr['ud_guid'] : ''); $entry['url'] = $rr['xchan_url']; + $entry['photo_l'] = $rr['xchan_photo_l']; $entry['photo'] = $rr['xchan_photo_m']; $entry['address'] = $rr['xchan_addr']; $entry['description'] = $rr['xprof_desc']; |