Open imath opened 2 years ago
The REST API to communicate with the server
Are you creating a custom controller specific to this plugin?
Yes it's more convenient, and if you remember well, a while ago it inspired you when you improved the BP Rest API Attachments endpoint.
Something that just came to mind: should the plugin be built to allow other file storage options? Will it be easy for advanced or custom scenarios/use cases where the WordPress uploads folder structure is not used?
I think hooks are already in place to make this possible. For instance private media are not stored into uploads, a guide is explaining the admin how to put the directory in place out of site's root directory.
So there are hooks in place to account, or bypass the default behavior, for CRUD actions like adding and deleting images?
The second part is different compared to your initial question 😄 . Only the destination upload paths are customizable for now. Let's progress about this v1 and we'll see, when features are solid, to fine tune hooks before releasing it 😉 .
Ah, cool!
When I said other file storage options, I meant something like Laravel File Storage, https://laravel.com/docs/9.x/filesystem, where you can hook drivers and your assets can go to S3, for example.
So maybe allowing plugins to extend this feature to put images in places other than the WordPress filesystem.
Awesome work on this. I see in one of the files it says 'Groups support should happen in a future version', do you have a rough idea on when the groups part might be ready?
Hi @markcummins
Thanks for your feedback 😍. It's actually possible to share media into Groups using Activities. These media are owned by the group members who shared the activity. The difficult part about Group Attachments is about "ownership". So we need a bit more time to find the best way to deal with it. Once a stable 1.0.0 release will be published (I hope before the end of the month), we'll be able to have more feedbacks/ideas so it should help us build the feature in the next major version 👍
Perfect, thanks for the update, thats very helpful. We are currently using the RT Media files plugin for Profile and Groups, but it doesn't have the ability to create folders, and it's a bit difficult to navigate. We got some feedback saying that being able to organise their files would be a big help to them.
@renatonascalves maybe something like the Offload Media plugin could help with offloading the files to somewhere other than WordPress.
Thanks for your feedback heart_eyes. It's actually possible to share media into Groups using Activities. These media are owned by the group members who shared the activity. The difficult part about Group Attachments is about "ownership". So we need a bit more time to find the best way to deal with it. Once a stable 1.0.0 release will be published (I hope before the end of the month), we'll be able to have more feedbacks/ideas so it should help us build the feature in the next major version +1
@imath, thanks again for answering my question. We have some members who are interested in using Groups on our site in a few months, and they are asking for a way to upload and organise Group files. Do you think the next major version of this plugin might be ready around March or April, or do you think it will probably be much later?
I know that's probably a very difficult question to answer right now, so no problem if you aren't able to give a more accurate answer.
BP Attachments is a BuddyPress Add-on to manage community members public and private media.
Development choices
Type of objects
inode/directory
mime type).Folders can have different types:
The last 3 types cannot have sub-folders and are not available for private uploads.
Filesystem organization
Public files and folders
/wp-content/uploads/buddypress/public
/wp-content/uploads/buddypress/public/members/{$user_id}
/wp-content/uploads/buddypress/public/groups/{$group_id}
Private files and folders
To have private uploads available, the Site Administrator needs to create the
buddypress-private
dir one level upper the site's document root and make sure this folder is accessible read/write/delete to the Machine Server's user.../buddypress-private
../buddypress-private/members/{$user_id}
../buddypress-private/groups/{$group_id}
../buddypress-private/friends/{$user_id}
User capabilities
If each regular user can upload media to their own directory, there's probably a need to allow Group Admins to moderate files and folders generated to the group.
Site Settings
Administrators will be able to select the allowed mime types from the BP Options settings page tab. Here's 2 preview of these settings panel:
Clicking on one of the accordion element will show the checkboxes to enable/disable mime types for the corresponding media category. Below is a screenshot of the Image panel.
--- To be continued ---