aboutsummaryrefslogtreecommitdiffstats
path: root/include/taxonomy.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-07-02 21:19:12 -0700
committerfriendica <info@friendica.com>2013-07-02 21:19:12 -0700
commitb021c8e31ea3cfffcbb2c66cd3dfa0b37f747b26 (patch)
treedb5c9ebbbea2261351e9859f5ecaa7cd2e06db74 /include/taxonomy.php
parent08023eb0993eb63aac96669afd01beae7e134964 (diff)
downloadvolse-hubzilla-b021c8e31ea3cfffcbb2c66cd3dfa0b37f747b26.tar.gz
volse-hubzilla-b021c8e31ea3cfffcbb2c66cd3dfa0b37f747b26.tar.bz2
volse-hubzilla-b021c8e31ea3cfffcbb2c66cd3dfa0b37f747b26.zip
oops - returned too many items
Diffstat (limited to 'include/taxonomy.php')
-rw-r--r--include/taxonomy.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/include/taxonomy.php b/include/taxonomy.php
index 0ebda2b1c..d4bb97b3e 100644
--- a/include/taxonomy.php
+++ b/include/taxonomy.php
@@ -96,19 +96,22 @@ function format_term_for_display($term) {
// Tag cloud functions - need to be adpated to this database format
-function tagadelic($uid, $count = 0, $type = TERM_HASHTAG) {
-
+function tagadelic($uid, $count = 0, $flags = 0, $type = TERM_HASHTAG) {
+dbg(1);
+ if($flags)
+ $sql_options = " and (item_flags & " . intval($flags) . ") ";
// Fetch tags
- $r = q("select term, count(term) as total from term
- where uid = %d and type = %d
+ $r = q("select term, count(term) as total from term left join item on term.oid = item.id
+ where term.uid = %d and term.type = %d
and otype = %d
+ $sql_options
group by term order by total desc %s",
intval($uid),
intval($type),
intval(TERM_OBJ_POST),
((intval($count)) ? "limit $count" : '')
);
-
+dbg(0);
if(! $r)
return array();
@@ -145,10 +148,10 @@ function tags_sort($a,$b) {
}
-function tagblock($link,$uid,$count = 0,$type = TERM_HASHTAG) {
+function tagblock($link,$uid,$count = 0,$flags = 0,$type = TERM_HASHTAG) {
$o = '';
$tab = 0;
- $r = tagadelic($uid,$count,$type);
+ $r = tagadelic($uid,$count,$flags,$type);
if($r) {
$o = '<div class="tagblock widget"><h3>' . t('Tags') . '</h3><div class="tags" align="center">';