disable directory keywords when forums or collections selected

This commit is contained in:
zotlabs 2019-04-02 19:20:40 -07:00
parent 2baf27c761
commit d22285c888
3 changed files with 11 additions and 3 deletions

View file

@ -312,7 +312,7 @@ class Dirsearch extends \Zotlabs\Web\Controller {
$ret['results'] = $entries;
if($kw) {
$k = dir_tagadelic($kw, $hub);
$k = dir_tagadelic($kw, $hub, $type);
if($k) {
$ret['keywords'] = array();
foreach($k as $kv) {

View file

@ -376,14 +376,21 @@ function pub_tagadelic($net,$site,$limit,$recent,$safemode,$type) {
}
function dir_tagadelic($count = 0, $hub = '') {
function dir_tagadelic($count = 0, $hub = '', $type = 0) {
$count = intval($count);
$sql_extra = EMPTY_STR;
if($type) {
return [];
}
if($hub) {
$r = q("select xtag_term as term, count(xtag_term) as total from xtag
left join hubloc on xtag_hash = hubloc_hash
where xtag_flags = 0 and xtag_hash in (select hubloc_hash from hubloc where hubloc_host = '%s' )
$sql_extra
group by xtag_term order by total desc %s",
dbesc($hub),
((intval($count)) ? "limit $count" : '')
@ -391,6 +398,7 @@ function dir_tagadelic($count = 0, $hub = '') {
}
else {
$r = q("select xtag_term as term, count(xtag_term) as total from xtag where xtag_flags = 0
$sql_extra
group by xtag_term order by total desc %s",
((intval($count)) ? "limit $count" : '')
);

View file

@ -13,7 +13,7 @@ A reference implementation (a social media app) is provided at https://framagit.
### Differences from earlier Zot versions
1. Streamlined communications using direct (push) transfer. Earlier versions used a 'notify/pickup' delivery model.
2. The authentication component (Magic-Auth) has been spun off into a separate and independent specification ['OpenWebAuth'](spec/OpenWebAuth/Home).
2. The authentication component (Magic-Auth) has been spun off into a separate and independent specification ['OpenWebAuth'](spec/OpenWebAuth/Home.md).
3. Inclusion of ActivityStreams (JSON-LD) as a supported (primary) serialisation.
4. Dropping the requirements for implementations to support secondary serialisations.
5. Moving service discovery to "Accept-header" based service endpoints; where different representations can be selected by modification of the HTTPS request Accept: header.