diff options
author | Ian Denhardt <ian@zenhack.net> | 2010-09-05 13:19:15 -0400 |
---|---|---|
committer | Ian Denhardt <ian@zenhack.net> | 2010-09-05 13:19:15 -0400 |
commit | fc131c2fb66997d42527e645ff475f7161165522 (patch) | |
tree | 4c6fdb20c03e491d8abf1d90dc945d2f87c4f090 /plugins/GNUsocialPhotos/actions/photoupload.php | |
parent | cc18dcb82d3d61b512530d252ec78465eefab9d2 (diff) |
Users now post photos to separate albums in the DB (still need to display them separately.)
Diffstat (limited to 'plugins/GNUsocialPhotos/actions/photoupload.php')
-rw-r--r-- | plugins/GNUsocialPhotos/actions/photoupload.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/GNUsocialPhotos/actions/photoupload.php b/plugins/GNUsocialPhotos/actions/photoupload.php index 84caf4747..a0dfd56bb 100644 --- a/plugins/GNUsocialPhotos/actions/photoupload.php +++ b/plugins/GNUsocialPhotos/actions/photoupload.php @@ -113,7 +113,6 @@ class PhotouploadAction extends Action function uploadPhoto() { - common_log(LOG_INFO, 'Is this function even getting called?'); $cur = common_current_user(); if(empty($cur)) { return; @@ -137,8 +136,15 @@ class PhotouploadAction extends Action $uri = 'http://' . common_config('site', 'server') . '/file/' . $filename; $thumb_uri = 'http://' . common_config('site', 'server') . '/file/thumb.' . $filename; $profile_id = $cur->id; - //scorbett: the second arg below should be set to the album ID - GNUsocialPhoto::saveNew($profile_id, 0, $thumb_uri, $uri, 'web'); + + // TODO: proper multiple album support + $album = GNUsocialPhotoAlbum::staticGet('profile_id', $profile_id); + if(!$album) { + $album = GNUsocialPhotoAlbum::newAlbum($profile_id, 'Default'); + GNUsocialPhoto::saveNew($profile_id, $album->album_id, $thumb_uri, $uri, 'web'); + } else { + GNUsocialPhoto::saveNew($profile_id, $album->album_id, $thumb_uri, $uri, 'web'); + } } } |