MyBB Community Forums

Full Version: How to disable quoting by plugin?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
I need to disable possibility of quoting by a plugin. It concerns some posts with a special mycode. E.g. there are posts with a content what normal user can't see but if he use the reply button he will read the content. I suppose I could do it in newreply page, but I just prefer to remove the quote reply buttons.
What about preg_replace?

$post['message'] = preg_replace("/\[quote\](.*?)\[\/quote\]/is", "", $post['message']);

I think that's the correct regex.
Well, I'll do so as a last resort. But I asked about a way of removing [Image: postbit_quote.gif]. I think this method would be better but rather there isn't any hook Sad
Just remove the code for it from the postbit and postbit_classic template:

{$post['button_quote']}{$post['button_multiquote']}
I don't want to do it for all posts. Maybe I described it bad Toungue
I want that some posts (with a special content - e.g. [download] tag) won't be quoted, because if a user clicks the reply button, he will see unparsed text (with something available only for premium accounts).
Yes i made in my plugin something like that.

Use the hook

parse_quoted_message

Then in the function assigned try this.

$quoted_post['message'] = preg_replace('#\[dowload\](.*?)\[/download\]#is', "This content may not quoted in this forum", $quoted_post['message']);


On this form you put the code to replace and oly take the values for forums id where apply this task, thats all.

I do this for my plugin hidden content until reply. I hide the content of the hide tag, urls, attachments until reply a post xD. If you wanna try quote message or multiquote the displays the message you want or nothing xD.

I hope help you. Cheers.
I found this hook already Smile This is what I meant.