aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2010-10-25 00:22:20 +0000
committerCash Costello <cash.costello@gmail.com>2010-10-25 00:22:20 +0000
commit893364a28955358ad259bfb75798560616ab3d49 (patch)
tree8b2ac2fb618596fed82b12c221eb7c485cbb9590 /actions
parentda1493b95a2f0b5000a487ae373c9318c58d0b2d (diff)
downloadelgg-893364a28955358ad259bfb75798560616ab3d49.tar.gz
elgg-893364a28955358ad259bfb75798560616ab3d49.tar.bz2
supporting both basic and flash uploader
Diffstat (limited to 'actions')
-rw-r--r--actions/addalbum.php2
-rw-r--r--actions/ajax_upload.php5
-rw-r--r--actions/upload.php6
3 files changed, 9 insertions, 4 deletions
diff --git a/actions/addalbum.php b/actions/addalbum.php
index bdac9bfbf..8ddcca131 100644
--- a/actions/addalbum.php
+++ b/actions/addalbum.php
@@ -42,6 +42,8 @@ if (!$album->save()) {
forward(get_input('forward_url', $_SERVER['HTTP_REFERER']));
}
+mkdir(tp_get_img_dir() . $album->guid, 0755, true);
+
system_message(elgg_echo("album:created"));
// Remove the album post cache
diff --git a/actions/ajax_upload.php b/actions/ajax_upload.php
index 3d44df199..973e4220a 100644
--- a/actions/ajax_upload.php
+++ b/actions/ajax_upload.php
@@ -33,7 +33,8 @@ $image->setMimeType(tp_upload_get_mimetype($name));
$image->simpletype = "image";
$image->access_id = $album->access_id;
$image->title = substr($name, 0, strrpos($name, '.'));
-$image_guid = $image->save();
+$image->batch = get_input('batch');
+$result = $image->save();
$image->setOriginalFilename($name);
$image->saveImageFile($temp_file, $file_size);
@@ -43,5 +44,7 @@ $image->saveThumbnails($image_lib);
$album->prependImageList(array($image->guid));
+error_log('complete');
+
echo "1";
exit; \ No newline at end of file
diff --git a/actions/upload.php b/actions/upload.php
index 8dae85277..b3ad9ebc3 100644
--- a/actions/upload.php
+++ b/actions/upload.php
@@ -9,8 +9,8 @@ include_once dirname(dirname(__FILE__)) . "/lib/upload.php";
// Get common variables
$access_id = (int) get_input("access_id");
-$container_guid = (int) get_input('container_guid', 0);
-$album = get_entity($container_guid);
+$album_guid = (int) get_input('album_guid', 0);
+$album = get_entity($album_guid);
if (!$album) {
register_error(elgg_echo('tidypics:baduploadform'));
forward($_SERVER['HTTP_REFERER']);
@@ -101,7 +101,7 @@ foreach($_FILES as $key => $sent_file) {
//this will save to users folder in /image/ and organize by photo album
$file = new TidypicsImage();
- $file->container_guid = $container_guid;
+ $file->container_guid = $album_guid;
$file->setMimeType($mime);
$file->simpletype="image";
$file->access_id = $access_id;