]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of git://140.232.178.237/home/ian/public_html/gnu-social
authorSean Corbett <sean@gnu.org>
Sun, 5 Sep 2010 17:20:46 +0000 (13:20 -0400)
committerSean Corbett <sean@gnu.org>
Sun, 5 Sep 2010 17:20:46 +0000 (13:20 -0400)
1  2 
plugins/GNUsocialPhotos/actions/photoupload.php

index b1b3ec705e95deca972a843f3933913a41d75e8f,a0dfd56bb439ec3784055e845f8a3a8b58caeb63..a37c8d1ab4034d5a25f1f3afae15096ba2c524ae
@@@ -22,7 -22,6 +22,7 @@@
   * @category  Widget
   * @package   GNU Social
   * @author    Ian Denhardt <ian@zenhack.net>
 + * @author    Sean Corbett <sean@gnu.org>
   * @copyright 2010 Free Software Foundation, Inc.
   * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
   */
@@@ -114,7 -113,6 +114,6 @@@ class PhotouploadAction extends Actio
  
      function uploadPhoto()
      {
-         common_log(LOG_INFO, 'Is this function even getting called?');
          $cur = common_current_user();
          if(empty($cur)) {
              return;
          $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');
+         }
      }
  
  }