diff options
author | friendica <info@friendica.com> | 2014-09-07 22:14:28 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-09-07 22:14:28 -0700 |
commit | ed847a91f6f8221bc13523574baf4ab7b3cf430a (patch) | |
tree | a47f8aaad6f4bcbb20dfc751e68003d9580dbbfb /include | |
parent | 9d03f635119b69c9ed1865b77ae397488d1dd599 (diff) | |
download | volse-hubzilla-ed847a91f6f8221bc13523574baf4ab7b3cf430a.tar.gz volse-hubzilla-ed847a91f6f8221bc13523574baf4ab7b3cf430a.tar.bz2 volse-hubzilla-ed847a91f6f8221bc13523574baf4ab7b3cf430a.zip |
add categories to events
Diffstat (limited to 'include')
-rw-r--r-- | include/event.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/event.php b/include/event.php index 0c29d26f6..1fe6e6f7f 100644 --- a/include/event.php +++ b/include/event.php @@ -374,6 +374,26 @@ function event_store_item($arr,$event) { intval($arr['uid']) ); + + $s = q("delete from term where oid = %d and otype = %d", + intval($r[0]['id']), + intval(TERM_OBJ_POST) + ); + + if(($arr['term']) && (is_array($arr['term']))) { + foreach($arr['term'] as $t) { + q("insert into term (uid,oid,otype,type,term,url) + values(%d,%d,%d,%d,'%s','%s') ", + intval($arr['uid']), + intval($r[0]['id']), + intval(TERM_OBJ_POST), + intval($t['type']), + dbesc($t['term']), + dbesc($t['url']) + ); + } + } + $item_id = $r[0]['id']; call_hooks('event_updated', $event['id']); return $item_id; @@ -424,6 +444,10 @@ function event_store_item($arr,$event) { $item_arr['item_private'] = $private; $item_arr['verb'] = ACTIVITY_POST; + + if(array_key_exists('term',$arr)) + $item_arr['term'] = $arr['term']; + $item_arr['resource_type'] = 'event'; $item_arr['resource_id'] = $event['event_hash']; |