diff options
author | friendica <info@friendica.com> | 2012-07-10 19:28:02 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-07-10 19:28:02 -0700 |
commit | e7957e14489ce8eb3b69ebede928dfe441a4924d (patch) | |
tree | e25fde990e36171053364c71471d9b90fd5633ef /include/items.php | |
parent | 94fabe3a2942ca93b436694f180f8eb2a72df918 (diff) | |
download | volse-hubzilla-e7957e14489ce8eb3b69ebede928dfe441a4924d.tar.gz volse-hubzilla-e7957e14489ce8eb3b69ebede928dfe441a4924d.tar.bz2 volse-hubzilla-e7957e14489ce8eb3b69ebede928dfe441a4924d.zip |
create fetch_tags function, make search work again, change logo
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php index 1f90a1d05..d48a04da5 100755 --- a/include/items.php +++ b/include/items.php @@ -3697,3 +3697,32 @@ function store_diaspora_retract_sig($item, $user, $baseurl) { return; } + +function fetch_post_tags($items) { + + $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_str), + intval(TERM_OBJ_POST) + ); + + for($x = 0; $x < count($items); $x ++) { + if(count($tags)) { + foreach($tags as $t) { + if($t['oid'] == $items[$x]['item_id']) { + if(! is_array($items[$x]['term'])) + $items[$x]['term'] = array(); + $items[$x]['term'][] = $t; + } + } + } + } + + return $items; +} |