diff options
Diffstat (limited to 'include/photos.php')
-rw-r--r-- | include/photos.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/include/photos.php b/include/photos.php index 060a0671d..06a99457a 100644 --- a/include/photos.php +++ b/include/photos.php @@ -5,7 +5,7 @@ require_once('include/items.php'); require_once('include/photo/photo_driver.php'); -function photo_upload($channel, $observer, $args, $local = null) { +function photo_upload($channel, $observer, $args) { $ret = array('success' => false); $channel_id = $channel['channel_id']; @@ -62,17 +62,17 @@ function photo_upload($channel, $observer, $args, $local = null) { $str_contact_deny = perms2str(((is_array($args['contact_deny'])) ? $args['contact_deny'] : explode(',',$args['contact_deny']))); - if($local) { + if($args['data']) { // allow an import from a binary string representing the image. // This bypasses the upload step and max size limit checking - $imagedata = $local; + $imagedata = $args['data']; $filename = $args['filename']; $filesize = strlen($imagedata); // this is going to be deleted if it exists $src = '/tmp/deletemenow'; - $filetype = $args['filetype']; + $type = $args['type']; } else { $f = array('src' => '', 'filename' => '', 'filesize' => 0, 'type' => ''); @@ -158,7 +158,7 @@ function photo_upload($channel, $observer, $args, $local = null) { $smallest = 0; - $photo_hash = photo_new_resource(); + $photo_hash = (($args['resource_id']) ? $args['resource_id'] : photo_new_resource()); $visitor = ''; if($channel['channel_hash'] !== $observer['xchan_hash']) @@ -171,6 +171,15 @@ function photo_upload($channel, $observer, $args, $local = null) { 'allow_cid' => $str_contact_allow, 'allow_gid' => $str_group_allow, 'deny_cid' => $str_contact_deny, 'deny_gid' => $str_group_deny ); + if($args['created']) + $p['created'] = $args['created']; + if($args['edited']) + $p['edited'] = $args['edited']; + if($args['title']) + $p['title'] = $args['title']; + if($args['description']) + $p['desciprion'] = $args['description']; + $r1 = $ph->save($p); if(! $r1) |