Forum Activity for @dobmat

alt=
@dobmat
05/18/14 10:15:32AM
93 posts

Invalid item array received after deleting a single uploaded file


Jamroom Developers

Hi

In my module I have a delete button to delete individual files uploaded in an item of module. But after delete the redirect shows item detail page with error "Invalid Item Array Received".

The $_items array is set to false which is why it is showing the error. I'm following the example of jrGallery for my module. Below is the delete function in my module index.php,

jrUser_session_require_login();
jrCore_validate_location_url();

if (!isset($_post['id']) || !jrCore_checktype($_post['id'], 'number_nz')) {
jrCore_set_form_notice('error', 14);
jrCore_form_result('referrer');
}
$_rt = jrCore_db_get_item('gsVenue', $_post['id']);
if (!jrUser_can_edit_item($_rt)) {
jrUser_not_authorized();
}
jrCore_db_delete_item('gsVenue', $_post['id']);
//jrProfile_reset_cache();
jrCore_form_result("{$_conf['jrCore_base_url']}/{$_user['profile_url']}/{$_post['module_url']}/{$_post['id']}/{$_rt['venues_title_url']}");

Note that the item representing the file in the database is deleted. Please suggest what I can do about this.

Thanks.
updated by @dobmat: 06/25/14 02:11:58PM
alt=
@dobmat
05/15/14 07:50:16AM
93 posts

Display uploaded files and download them


Jamroom Developers

I'm trying to use jrGallery module as example to put a downlaod button on uploaded images. I have a view_jrGallery_download_image function in my jrGallery index.php and I've put the following in the gallery_update.tpl I've put the following line to get a download button. But I don't see the extra button on images in the gallery. Please give some suggestions.

Thanks.
gallery.JPG.jpg gallery.JPG.jpg - 41KB

updated by @dobmat: 05/15/14 07:50:34AM
alt=
@dobmat
05/14/14 08:00:14AM
93 posts

Display uploaded files and download them


Jamroom Developers

Hi

I want to upload files to a module and display them in the item detail page. Fro jrGallery I can see how that can be done for images. Is there something similar for say text files.

Thanks.
updated by @dobmat: 06/25/14 01:41:52PM
alt=
@dobmat
05/14/14 07:31:01AM
93 posts

Requesting files from other modules items


Jamroom Developers

Hi

Is there a way to request for files to be shared by modules. Like user-1 has some files in an entry of module A. User-2 wants to see under module B certain files from module A entry that user-1 has created. Please give some suggestions as to how to go about it.

Thanks.
updated by @dobmat: 06/14/14 09:24:34PM
alt=
@dobmat
05/14/14 07:01:46AM
93 posts

Custom button not getting any data on post


Jamroom Developers

Thanks a lot. It is working for me now.
alt=
@dobmat
05/13/14 09:11:25AM
93 posts

Custom button not getting any data on post


Jamroom Developers

Thanks for the guidance. I've tried as you suggested. I'm getting an error "You forgot to select a file to upload". My code is as below,

$_files = jrCore_get_uploaded_media_files('gsVenue', 'venue_files', $_user['user_active_profile_id']);
if (isset($_files) && is_array($_files)) {

$_up['venue_order'] = $ord;
foreach ($_files as $file_name) {
$_up['venue_order']++;
$aid = jrCore_db_create_item('gsVenue', $_up);
if (!$aid) {
jrCore_set_form_notice('error', 7);
jrCore_form_result();
}

jrCore_save_media_file('gsVenue', $file_name, $_user['user_active_profile_id'], $aid);

if (!isset($action_saved)) {
jrCore_run_module_function('jrAction_save', 'upload', 'gsVenue', $aid);
$action_saved = true;
}
}
}

Thanks.
alt=
@dobmat
05/13/14 07:43:39AM
93 posts

Custom button not getting any data on post


Jamroom Developers

Hi

I have created a ccustom upload button to upload files. In the upload form I have only files filed. When I try this in my upload_save funtion,

jrCore_form_get_save_data('gsVenue', 'upload', $_post);

I'm getting an empty array. I'm not sure why this is happening.

Thanks.
updated by @dobmat: 07/09/14 01:49:25AM
alt=
@dobmat
05/09/14 07:13:32AM
93 posts

Upload files on item detail page for module


Jamroom Developers

I went through the gallery module, and I see it is creating different item id for every image that I upload. From my previous functionality I can upload multiple files but what it is doing is if my field is venue_files, it is creating entries as venue_file_name, venue_files_2_name, venue_files_3_name etc. But every time I update the field it starts from venue_file_name and all the previously uploaded files are not available on post. Is there any way I can have all the files under single item id and still add more entries on update.

Thanks.
updated by @dobmat: 05/09/14 07:14:27AM
alt=
@dobmat
05/08/14 06:50:34AM
93 posts

Upload files on item detail page for module


Jamroom Developers

Yeah, I have a call to jrCore_save_all_media_files function. Does this function jrCore_db_update_item checks to see if for an item id all the values previously existing is modified. This is because most of the content is same except for the new uploaded files.

Thanks.
updated by @dobmat: 05/08/14 06:57:32AM
alt=
@dobmat
05/08/14 04:14:42AM
93 posts

Upload files on item detail page for module


Jamroom Developers

I got it working now. In the upload function I mentioned above, what I want is when I upload new docs the old ones should not be replaced. Instead it should add to existing entries in the datastore. I'm using the following code in my upload function in index.php,

$_rt = jrCore_db_get_item('gsVenue', $_post['id']);
$_sv = jrCore_form_get_save_data('gsVenue', 'upload', $_post);
$_new = array_merge($_rt, $_sv);
jrCore_db_update_item('gsVenue', $_post['id'], $_new);

But, it seems the newly uploaded files are not there. I'm getting error "you forgot to select a file to upload".

Thanks.
  4