MyBB Community Forums

Full Version: Modifying Postbit Head
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Trying to insert some JavaScript into the head of the Postbit pages, but can't find the section in the templates.
Would you be able to provide a screenshot of where you want to put it? I'm not sure where you want it exactly..
in the <head>
Admin CP > Templates And Style > Templates > (Your Template) > Ungrouped Templates > headerinclude.

I don't think you can give showthread.php its own headerinclude. Will your JS work if it's on all pages?
(2010-11-17, 07:59 AM)CAwesome Wrote: [ -> ]Admin CP > Templates And Style > Templates > (Your Template) > Ungrouped Templates > headerinclude.

I don't think you can give showthread.php its own headerinclude. Will your JS work if it's on all pages?

Actually you can. If you look at the showthread template you'll see that you can actually enter your own custom declarations after headerinclude and before </head>.

Thats true for pretty much all major pages in MyBB
Well I've applied my own JS to the index and portal, but I need it for the the post pages, so I'll try this and hopefully it'll work Smile
So you guys pointed me to the Ungrouped > headerinclude, which is awesome! it saves me from having to go to each template page to modify the head (for global js injections).

However, something weird is going on with ShowThread; it appears as though other JS sources are included after the headerinclude:
{$headerinclude}
<!-- other JS files here, but no variable here -->
<script type="text/javascript" src="jscripts/thread.js?ver=1400"></script>

I recognize that some of the JS files are for plugins, but it's weird that I don't see any variables that would enable the files to hook in right there. Any thoughts on other header update locations? Perhaps in a PHP file somewhere?

Update:

I was using a plugin for Steam (online multiplayer game account). In the /inc/plugins/steamprofile.php the headerinclude was appended with javascript strings.

I know this is a special case, but I hope this helps someone else find something similar, where code is not in the template, but is in the resultant html.