MyBB Community Forums

Full Version: Adding equiv of PHP includes file to template?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'd like to add a randomized banner ad after the first post in each thread. I was hoping to just add an includes file (e.g banners.php) to my template, but I obviously can't use PHP in the template.

- Is there a file I can edit somewhere to add a php includes?
- Or is there some other way I can include a file in the template editor (JS maybe?)?

I don't want to use a mod/plugin.
If your banners.php outputs valid Javascript (i.e., it MUST output document.write('the ad code'); , not just plain HTML ) you can include it in Javascript by entering
<script type="text/javascript" src="banners.php"></script>

However, you can only place it above or below the posts (or between each and every post). The easiest way to do "ads after the first post ONLY" is with the plugin: http://mods.mybboard.net/view/ads-after-first-post-2.0
Thanks DennisTT, I was just about to post that I'd solved it Smile
I don't think I need to use php, I should be able to put some ugly JavaScript together to do what I want.

Thanks for the link to the plugin, I'll check it out.
You're welcome Smile