--- /dev/null
+<?php
+/**
+ * A batch is complete so check if this is first upload to album
+ *
+ */
+
+$album_guid = (int) get_input('album_guid');
+
+$album = get_entity($album_guid);
+if (!$album) {
+ exit;
+}
+
+if ($album->new_album == TP_NEW_ALBUM) {
+ $album->new_album = TP_OLD_ALBUM;
+
+ // we throw the notification manually here so users are not told about the new album until there
+ // is at least a few photos in it
+ object_notifications('create', 'object', $album);
+
+ add_to_river('river/object/album/create', 'create', $album->owner_guid, $album->guid);
+}
+
+exit;
\ No newline at end of file
// Register actions
register_action("tidypics/upload", false, $CONFIG->pluginspath . "tidypics/actions/upload.php");
register_action("tidypics/ajax_upload", true, $CONFIG->pluginspath . "tidypics/actions/ajax_upload.php");
+register_action("tidypics/ajax_upload_complete", true, $CONFIG->pluginspath . "tidypics/actions/ajax_upload_complete.php");
register_action("tidypics/addalbum", false, $CONFIG->pluginspath. "tidypics/actions/addalbum.php");
register_action("tidypics/edit", false, $CONFIG->pluginspath. "tidypics/actions/edit.php");
register_action("tidypics/delete", false, $CONFIG->pluginspath. "tidypics/actions/delete.php");
$batch = time();
+$basic_uploader_url = current_page_url() . '/basic';
+
+$upload_endpoint_url = "{$vars['url']}action/tidypics/ajax_upload/";
+$upload_complete_url = "{$vars['url']}action/tidypics/ajax_upload_complete/";
$maxfilesize = (float) get_plugin_setting('maxfilesize','tidypics');
if (!$maxfilesize) {
}
}
-$basic_uploader_url = current_page_url() . '/basic';
-
?>
<div class="contentWrapper">
$("#uploadify").uploadify({
'uploader' : '<?php echo $vars['url']; ?>mod/tidypics/vendors/uploadify/uploadify.swf',
- 'script' : '<?php echo $vars['url']; ?>action/tidypics/ajax_upload/',
+ 'script' : '<?php echo $upload_endpoint_url; ?>',
'scriptData' : {
'album_guid' : '<?php echo $album->guid; ?>',
'__elgg_token' : '<?php echo $token; ?>',
},
'onAllComplete' : function() {
$("#tidypics_describe_button").removeClass('tidypics_disable');
+ $.post(
+ '<?php echo $upload_complete_url; ?>',
+ {
+ album_guid : '<?php echo $album->guid; ?>',
+ __elgg_token : '<?php echo $token; ?>',
+ __elgg_ts : '<?php echo $ts; ?>'
+ }
+ );
},
'onCancel' : function(event, queueID, fileObj, data) {
if (data.fileCount == 0) {