MyBB Community Forums

Full Version: Reference The Same File On Multiple Threads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys, I would like for MyBB to support referencing the same file on more than 1 thread instead of uploading it a few times.

Currently this BBCode: [attachment=NumHere] only works if the thread has the attachment already uploaded to thread. But if you try to use it on other threads where it wasn't originally uploaded to, the post parser won't parse it.

From permissions perspectives, the user who uploaded his file should be able to refrence his files wherever he wants to.

I found this comment on line 49 in functions_upload.php:

Quote:// Check if this attachment is referenced in any other posts. If it isn't, then we are safe to delete the actual file.

So am I missing something? Is it already coded? This is a bug or a new feature?
I don't think this is possible without decreasing the performance of MyBB (as all posts need to be parsed before loading the attachments).
No I think you need to first see if the post has that bbcode, if it is then create an entry in database.
And not create it on the fly. I hope you understood.

I mean on the pre-stage while you create the thread or the post. Not for the post parser to first see then check in the database.
That requires some pretty large changes to the attachment system...
As attachments are usually very small and MyBB does not really support large attachments very well, I don't think this is necessary in 1.8. Attachment system should be refactored in 2.0 anyway I think.