MyBB Community Forums

Full Version: Hard to make modifications to attachments
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to add a functionality that includes a description and a timestamp for each attachment. I've searched over the code, specifically, /inc/functions_upload.php's upload_attachment() and newthread.php. Nowhere do I see hooks that will help me. It's also quite a pain to maneuver myself around the hooks to add this capability.

I want to avoid adding customized hooks and code modifications.

It'd be grateful if someone could point me in the right direction.
http://wiki.mybboard.net/index.php/MyBB_Plugin_Hooks

Maybe you can use this hook?
attachment_start 
Or there is attachment_end too...seems you looked everywhere but the attachment.php. Sad
Well I can't seem to add a timestamp or description for each attachment through those hooks because attachment.php is used for displaying thumbnails and downloading attachments.
Hmm...looking at it your right.

The function is upload_attachment() in the functions_upload.php which has NO HOOKS!

Be aware though that timestamp is easy and you only need to setup the database to have a timestamp field that isn't null. It will insert a timestamp automatically. As for description...hmm...it doesn't look easy without core file changes.

Maybe you can contact Tikitiki about getting some hooks in that page so it's possible.
Don't ask me for plugin hooks. Chris is the one who will decide about that
Yea I would definitely appreciate a hook in the function so I can expand the attachment functionality. Wink
Ryan is adding them in to MyBB 1.4 and the next release of the 1.2 series for you.

Chris
Thank you!