diff options
author | Ian Denhardt <ian@zenhack.net> | 2010-08-11 10:54:06 -0400 |
---|---|---|
committer | Ian Denhardt <ian@zenhack.net> | 2010-08-11 10:54:06 -0400 |
commit | 58d98a4c2b58fc69ddef81c2a0f32c079344e0d9 (patch) | |
tree | a46c46185cbe880902ba767641e7245538f53216 /plugins/GNUsocialPhotos/actions | |
parent | 50b12e5820e88682c27a75974143dc61159b327c (diff) |
Photos now show up in feed (locally anywyay.) need cleanup/federation
Diffstat (limited to 'plugins/GNUsocialPhotos/actions')
-rw-r--r-- | plugins/GNUsocialPhotos/actions/photoupload.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/plugins/GNUsocialPhotos/actions/photoupload.php b/plugins/GNUsocialPhotos/actions/photoupload.php index 9a643dbe6..6fdf51531 100644 --- a/plugins/GNUsocialPhotos/actions/photoupload.php +++ b/plugins/GNUsocialPhotos/actions/photoupload.php @@ -103,6 +103,14 @@ class PhotouploadAction extends Action } } + function showForm($msg, $success=false) + { + $this->msg = $msg; + $this->success = $success; + +// $this->showPage(); + } + function uploadPhoto() { common_log(LOG_INFO, 'Is this function even getting called?'); @@ -123,15 +131,13 @@ class PhotouploadAction extends Action common_log(LOG_INFO, 'upload path : ' . $imagefile->filepath); - $filename = $cur->nickname . '-' . common_timestamp() . sha1_file($imagefile->filepath) . '.' . image_type_to_extension($imagefile->type); + $filename = $cur->nickname . '-' . common_timestamp() . sha1_file($imagefile->filepath) . image_type_to_extension($imagefile->type); move_uploaded_file($imagefile->filepath, INSTALLDIR . '/file/' . $filename); photo_make_thumbnail($filename); - $photo = new GNUsocialPhoto(); - $photo->path = '/file/' . $filename; - $photo->thumb_path = '/file/thumb.' . $filename; - $photo->owner_id = $cur->id; - $photo->object_id = 'DEFAULT'; - $photo->insert(); + $path = '/file/' . $filename; + $thumb_path = '/file/thumb.' . $filename; + $profile_id = $cur->id; + GNUsocialPhoto::saveNew($profile_id, $thumb_path, $path, 'web'); } } |