MyBB Community Forums

Full Version: Tips for effecting post preview
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey all! First post here and first plugin!

I'm developing a plugin geared specifically towards RP sites where users like to format their posts with HTML. The plugin gives users a place in the CP to save formatting and then they can apply it to their posts/threads and the plugin will apply the formatting to the post without them needing to apply the html to each post manually.

It was requested by a user that the formatting show when someone previews their post as well, but I'm a little unsure how to go about doing that or where the most appropriate hook is. If I change the message input in newreply_start/newthread_start to include the formatting, I get mostly the desired effect but it also places the html values in the input box, meaning that once applied it would apply the formatting twice. In addition, in the preview it shows the full html value instead of applying the format itself. So I feel I am going about it the wrong way.

How would I go about changing the way the preview shows without effecting the actual input variable going to the database?