![]() |
Replacing Attachment Inside Post - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: Extensions (https://community.mybb.com/forum-201.html) +--- Forum: Plugins (https://community.mybb.com/forum-73.html) +---- Forum: Plugin Support (https://community.mybb.com/forum-72.html) +---- Thread: Replacing Attachment Inside Post (/thread-113402.html) |
Replacing Attachment Inside Post - BleepyEvans - 2012-02-13 Ive been working on a plugin that hides attachments to specific users. ( I know there are plugins out there, but non that do what I require specifically ) Basically what I have at the moment is this line of code that replaces the the attachment with a custom template:
The problem is when the attachment is inserted into the post using the 'Insert into Post' button the plugin no longer works. What can I do to replace the attachment if its placed into the post? Thanks RE: Replacing Attachment Inside Post - Yaldaram - 2012-02-13 Can you please paste the entire function of your plugin's hook ? RE: Replacing Attachment Inside Post - BleepyEvans - 2012-02-13
Still needs some tidying up. RE: Replacing Attachment Inside Post - Yaldaram - 2012-02-13 What hook you've used ? Try attachment_end hook with function code something like this;
RE: Replacing Attachment Inside Post - BleepyEvans - 2012-02-13 Oh sorry, i used the postbit hook, ill try your code thanks Also please excuse the inapproriate variable names xD And unfortunatly that code didnt work :/ inline attachments were still accessible RE: Replacing Attachment Inside Post - Yaldaram - 2012-02-13 If you're using postbit hook then use something like this;
RE: Replacing Attachment Inside Post - BleepyEvans - 2012-02-13 The code above provides the same outcome as my original code. I see the hidden attachment message, but the inline attachment is still visible and it is still possible to download. I can setup a test account on my test forum if you would like? I asked Pirata for support and he told me I need to remove the inline attachments tags before they're parsed. I have no idea what that means, so if anyone can shed any light of this I will be greatful. |