diff options
author | mrjive <mrjive@mrjive.it> | 2018-01-22 09:34:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-22 09:34:08 +0100 |
commit | 131baa9f4584b74ab76328d776c0bb5ce603da7d (patch) | |
tree | c962a68dbf7874e326f4ca268fe0183ac184ea12 /include/taxonomy.php | |
parent | 8e475810a74f738fe3b23648b904639e5099d995 (diff) | |
parent | 1709dbd376af3171815f25b7055fb41da53924cb (diff) | |
download | volse-hubzilla-131baa9f4584b74ab76328d776c0bb5ce603da7d.tar.gz volse-hubzilla-131baa9f4584b74ab76328d776c0bb5ce603da7d.tar.bz2 volse-hubzilla-131baa9f4584b74ab76328d776c0bb5ce603da7d.zip |
Merge pull request #10 from redmatrix/dev
Dev
Diffstat (limited to 'include/taxonomy.php')
-rw-r--r-- | include/taxonomy.php | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/include/taxonomy.php b/include/taxonomy.php index 278925391..393b8718e 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -313,39 +313,25 @@ function dir_tagadelic($count = 0, $hub = '') { $count = intval($count); - $dirmode = get_config('system','directory_mode'); - - if(($dirmode == DIRECTORY_MODE_STANDALONE) && (! $hub)) { - $hub = \App::get_hostname(); - } - - if($hub) - $hub_query = " and xtag_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') "; - else - $hub_query = ''; - - if($hub_query) { - // Fetch tags + 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 $hub_query + where xtag_flags = 0 and xtag_hash in (select hubloc_hash from hubloc where hubloc_host = '%s' ) group by xtag_term order by total desc %s", + dbesc($hub), ((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(); - + return []; return Zotlabs\Text\Tagadelic::calc($r); - } |