From 4b066e04f619c2c6f8d383daee9ceab49f39acdc Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 9 Jul 2012 22:08:25 -0700 Subject: making tags work --- mod/profile.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 24e03d6ea..b53639c35 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -279,8 +279,20 @@ function profile_content(&$a, $update = 0) { intval($a->profile['profile_uid']), dbesc($parents_str) ); - - $items = conv_sort($items,'created'); + + $tag_finder = array(); + if(count($items)) + foreach($items as $item) + if(! in_array($item['item_id'],$tag_finder)) + $tag_finder[] = $item['item_id']; + $tag_finder_str = implode(', ', $tag_finder); + $tags = q("select * from term where oid in ( '%s' ) and otype = %d", + dbesc($tag_finder), + intval(TERM_OBJ_POST) + ); + + $items = conv_sort($items,$tags,'created'); + } else { $items = array(); } -- cgit v1.2.3