diff options
author | Greg Froese <greg.froese@gmail.com> | 2009-05-22 15:43:19 +0000 |
---|---|---|
committer | Greg Froese <greg.froese@gmail.com> | 2009-05-22 15:43:19 +0000 |
commit | 620be743083e3c7c53d71c7686175c8ad341c7cb (patch) | |
tree | 4fc410c0fe1696c5c45a506057cd4dd5fbb0ed6c /actions | |
parent | 029ae9fcba086a1cce25e496c9de2593df212bdb (diff) | |
download | elgg-620be743083e3c7c53d71c7686175c8ad341c7cb.tar.gz elgg-620be743083e3c7c53d71c7686175c8ad341c7cb.tar.bz2 |
added river activity for uploaded images
Diffstat (limited to 'actions')
-rw-r--r-- | actions/upload.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/actions/upload.php b/actions/upload.php index 6e21fd7b0..6a941fa66 100644 --- a/actions/upload.php +++ b/actions/upload.php @@ -47,6 +47,9 @@ $uploaded_images = array();
$not_uploaded = array();
$error_msgs = array();
+
+ $river_view = get_plugin_setting('river_view', 'tidypics');
+
foreach($_FILES as $key => $sent_file) {
// skip empty entries
@@ -155,18 +158,24 @@ tp_watermark($thumbs);
+ //keep one file handy so we can add a notice to the river
+ if(!$file_for_river) {
+ $file_for_river = $file;
+ }
+
} // end of image library selector
//get and store the exif data
td_get_exif($file);
array_push($uploaded_images, $file->guid);
+ if($river_view == "all") {
+ add_to_river('river/object/image/create', 'create', $file->getObjectOwnerGUID(), $file->getGUID());
+ }
unset($file); // may not be needed but there seems to be a memory leak
-
} //end of for loop
-
-
+
if (count($not_uploaded) > 0) {
if (count($uploaded_images) > 0)
$error = sprintf(elgg_echo("tidypics:partialuploadfailure"), count($not_uploaded), count($not_uploaded) + count($uploaded_images)) . '<br />';
@@ -195,6 +204,13 @@ add_to_river('river/object/album/create', 'create', $album->owner_guid, $album->guid);
$album->new_album = TP_OLD_ALBUM;
}
+
+ if(count($uploaded_images) && $river_view == "1") {
+ if (function_exists('add_to_river')) {
+ add_to_river('river/object/image/create', 'create', $file_for_river->getObjectOwnerGUID(), $file_for_river->getGUID());
+ }
+ }
+
// plugins can register to be told when a Tidypics album has had images added
trigger_elgg_event('upload', 'tp_album', $album);
|