From a1b3a72f9ee893f648daffa818fc61706da0842f Mon Sep 17 00:00:00 2001 From: Michael Johnston Date: Sun, 8 Sep 2013 13:55:37 -0400 Subject: only show categories this channel has used --- include/contact_widgets.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/contact_widgets.php b/include/contact_widgets.php index e5f778e49..6bebf96e3 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -76,9 +76,16 @@ function categories_widget($baseurl,$selected = '') { return ''; $terms = array(); - $r = q("select distinct(term) from term where uid = %d and type = %d order by term asc", + $r = q("select distinct(term.term) + from term join item on term.oid = item.id + where item.uid = %d + and term.uid = item.uid + and term.type = %d + and item.author_xchan = '%s' + order by term.term asc", intval($a->profile['profile_uid']), - intval(TERM_CATEGORY) + intval(TERM_CATEGORY), + $a->profile['channel_hash'] ); if($r && count($r)) { foreach($r as $rr) -- cgit v1.2.3 From a36abb764d04a92d97507b368b1b622a9483348a Mon Sep 17 00:00:00 2001 From: Michael Johnston Date: Sun, 8 Sep 2013 14:53:14 -0400 Subject: added dbesc --- include/contact_widgets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 6bebf96e3..18c9d6510 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -85,7 +85,7 @@ function categories_widget($baseurl,$selected = '') { order by term.term asc", intval($a->profile['profile_uid']), intval(TERM_CATEGORY), - $a->profile['channel_hash'] + dbesc($a->profile['channel_hash']) ); if($r && count($r)) { foreach($r as $rr) -- cgit v1.2.3