Finding the message with the attachment you want to re-use is one aspect. It might be one of your own previous attachments, or it might have been posted by someone else. But phpBB Search isn't going to help you find messages with attachments, or match against metadata related specifically to the attachment.
And then even once you do find the attachment you want, if it's an image with a thumbnail there is the chore of "mimicking" the phpBB handling of an attachment. i.e. An
[img]tag for the thumbnail URL, and a
[url]tag for the full view link. Less so with other attachment types that aren't images.
So the thoughts that came to mind for me were these:
- Update phpBB Search to help find attachments.
Provide options to search "only messages with attachments." And similar to the "search only subject" and "search subject and body", provide a "search subject and body and attachment data." In order to search the attached file name and/or file name extension (.PNG, .SVG, etc.), and the additional optional description that can be provided for an attachment. These features make sense even on their own for phpBB Search, but the intention is that we will also leverage their existence in the next bullet points, too.
- Update phpBB Attachment interface to allow selecting existing attachments.
In addition to "Add File", there would be a "Use Existing Attachment" which launches a paginated view of existing attachments. By default, perhaps it only shows your own attachments, sorted in descending order of most recent use in a message. But which you could change to find the attachments of a different specific user, or of all users, and matching specific keywords, and sorted by when the attachment was first used instead of most recently used, etc.
- Handle the re-used attachment so that it "looks like a normal attachment" to the user composing their new message.
Meaning, the re-used attachment should be shown in the attachments list at the bottom of the message just like any other attachment the user may have uploaded. And/or will be inserted inline using an
[attachment=filename]code like any other attachment normally would. I believe "looking like a normal attachment in the newly-composed message" is probably the more familiar and intuitive behavior for users, if they then want to "remove the attachment they re-used" later or similar. Regardless of whether it was a new attachment or a re-used existing attachment reference.
- Evaluate whether an attachment reference count can be implemented.
Now that the attachment can be "officially referenced" in more than one message, do we need a reference count against the attachment. So that the attachment does not qualify as "orphaned" unless all of the messages that used it have been deleted.
Sounds like something which might be more important to support staff like phpbb.com/community support staff, where "re-referencing the same examples, configuration files, etc." might be a common task. But maybe normal end-users might have some use cases too; like finding a favorite meme image to re-use again.