07-14-2012, 07:54 AM
XThreads itself already have a permission to view its attachments (files or images). And XThreads has a global settings to change the attachments URL based on IP and/or time.
This is only my ugly and a very simple "trick" to add a permission to download XThreads attachments. I use MyBB's attachment.php file for this (using attachment_start hook). I use this for file attachments (not image attachments).
In this example, it will look at the XThreads Viewable by Usergroups settings permission to download the attachment.
We can use something like this in the Display Format:
This is only my ugly and a very simple "trick" to add a permission to download XThreads attachments. I use MyBB's attachment.php file for this (using attachment_start hook). I use this for file attachments (not image attachments).
In this example, it will look at the XThreads Viewable by Usergroups settings permission to download the attachment.
We can use something like this in the Display Format:
HTML Code
|
I don't know what I should use for the aid in the Display Format, so I use the {$GLOBALS['threadfields']['key']['aid']}. We can design it as our needs (using button, form and etc).
Because I'm not a coder, please tell me if there is something wrong with the code.