diff options
author | Thomas Willingham <founder@kakste.com> | 2013-02-02 14:56:17 +0000 |
---|---|---|
committer | Thomas Willingham <founder@kakste.com> | 2013-02-02 14:56:17 +0000 |
commit | 0f13ae0ade10d6d2b0ef185ae6d6cc2d35831433 (patch) | |
tree | 7d6ac98d5f0b4e10ef86ba0f312401830c751250 /include/photos.php | |
parent | 1633f95db8a004055e51d1580fa4394527ca8a91 (diff) | |
parent | 5c6c4395f4ab7924cad619d3a1ca4cee69219769 (diff) | |
download | volse-hubzilla-0f13ae0ade10d6d2b0ef185ae6d6cc2d35831433.tar.gz volse-hubzilla-0f13ae0ade10d6d2b0ef185ae6d6cc2d35831433.tar.bz2 volse-hubzilla-0f13ae0ade10d6d2b0ef185ae6d6cc2d35831433.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/photos.php')
-rw-r--r-- | include/photos.php | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/include/photos.php b/include/photos.php index 0d0750c22..8e07c612f 100644 --- a/include/photos.php +++ b/include/photos.php @@ -181,7 +181,6 @@ function photo_upload($channel, $observer, $args) { $basename = basename($filename); $uri = item_message_id(); - // Create item container $item_flags = ITEM_WALL|ITEM_ORIGIN|ITEM_THREAD_TOP; @@ -319,3 +318,40 @@ function photos_album_get_db_idstr($channel_id,$album,$remote_xchan = '') { return false; } + +function photos_create_item($channel, $creator_hash, $photo, $visible = false) { + + // Create item container + + $item_flags = ITEM_WALL|ITEM_ORIGIN|ITEM_THREAD_TOP; + $item_restrict = (($visible) ? ITEM_HIDDEN : ITEM_VISIBLE); + + $title = ''; + $uri = item_message_id(); + + $arr = array(); + + $arr['aid'] = $channel['channel_account_id']; + $arr['uid'] = $channel['channel_id']; + $arr['uri'] = $uri; + $arr['parent_uri'] = $uri; + $arr['item_flags'] = $item_flags; + $arr['item_restrict'] = $item_restrict; + $arr['resource_type'] = 'photo'; + $arr['resource_id'] = $photo['resource_id']; + $arr['owner_xchan'] = $channel['channel_hash']; + $arr['author_xchan'] = $creator_hash; + + $arr['allow_cid'] = $photo['allow_cid']; + $arr['allow_gid'] = $photo['allow_gid']; + $arr['deny_cid'] = $photo['deny_cid']; + $arr['deny_gid'] = $photo['deny_gid']; + + $arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' + . '[img]' . $a->get_baseurl() . '/photo/' . $photo['resource_id'] . '-' . $photo['scale'] . '[/img]' + . '[/url]'; + + $item_id = item_store($arr); + return $item_id; + +}
\ No newline at end of file |