diff options
author | zotlabs <mike@macgirvin.com> | 2017-12-26 13:19:27 -0800 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2017-12-28 21:00:09 +0100 |
commit | 340d437ab28897ad0e5df8d242240a87823f4f8e (patch) | |
tree | 192c1cace01105624acc8ace62da3564837477c8 /include | |
parent | 34f576f540e36eec70c997a7f29fafea9c0e24e1 (diff) | |
download | volse-hubzilla-340d437ab28897ad0e5df8d242240a87823f4f8e.tar.gz volse-hubzilla-340d437ab28897ad0e5df8d242240a87823f4f8e.tar.bz2 volse-hubzilla-340d437ab28897ad0e5df8d242240a87823f4f8e.zip |
hubzilla issue #945 - directory keywords returned from twkn in standalone mode
Diffstat (limited to 'include')
-rw-r--r-- | include/taxonomy.php | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/include/taxonomy.php b/include/taxonomy.php index a13a9cf77..a646df28c 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -313,12 +313,25 @@ function dir_tagadelic($count = 0) { $count = intval($count); - // Fetch tags - $r = q("select xtag_term as term, count(xtag_term) as total from xtag where xtag_flags = 0 - group by xtag_term order by total desc %s", - ((intval($count)) ? "limit $count" : '') - ); - + $dirmode = get_config('system','directory_mode'); + + if($dirmode == DIRECTORY_MODE_STANDALONE) { + // Fetch tags + $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 hubloc_url = '%s' + group by xtag_term order by total desc %s", + dbesc(z_root()), + ((intval($count)) ? "limit $count" : '') + ); + } + else { + // Fetch tags + $r = q("select xtag_term as term, count(xtag_term) as total from xtag where xtag_flags = 0 + group by xtag_term order by total desc %s", + ((intval($count)) ? "limit $count" : '') + ); + } if(! $r) return array(); |