MyBB Community Forums

Full Version: How would I put javascript like this into a post?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm curious to know how would it be possible for me add a JavaScript code like this http://torrentleechinvites.blogspot.com/ into a post?

I don't wanna have it it every post in my forum, just in a designated part of my forum.

For example: If I were to have a forum on my message board called "VIP Downloads" and have that script show for only the posts in the "VIP Downloads" section. Any suggestions on doing this?

PS. Sorry if this question has asked a million times over
You would either have to put it in the post templates (where it would be for all posts). Or you would need to post it in the post itself (html code).
What be be the proper way to get HTML/JavaScript to show in a post? Would i need to install a plug-in? Because if I just paste the code in, it just shows the code like it would text.
You could install the "PHP and Template Conditionals" plug-in. Enter the forum ID number of your "VIP Downloads" forum into the conditional below, insert your code within the tags, and then place the code into the postbit template you are using:
<if $post['fid#'] then>INSERT YOUR CODE HERE.</if>
Ok. I installed the plug-in, but how do I know what is the right place to add the code? I clicked admin> Templates & Style> Expand Templates> Post Bit Templates> postbit.

^^^Is that the right place to add the code because there are other places in that sub-directory that say "postbit_edit" and so on?

Sorry, If I'm missing the obviously here, but I just install Mybb 3 days ago. So, I'm a complete noob.
Just add it to the top of the printthread thread template, that should do the trick. You can also use JavaScript to only run your code depending on what the fid value is.