The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Where to implement a JavaScript pop-up code
Hi everybody,
I got the following code, which I need to have on "forumhome" as well as "showthread", I simply added the code to the according templates on vBulletin 3.8.x - but now I've upgraded to v4 and when I just add the code it seems to generate longer loading times/general errors. So I'd like to ask, where's the right place to add such code. Thanks in advance. Here's the code in question: Code:
<script type="text/javascript" id="adcreative_script"> (function(){ var adcr = document.createElement('script'); adcr.type = 'text/javascript'; adcr.async = true; adcr.src = '//static.adclickx.com/adcreative.js'; (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(adcr); })(); </script> |
#2
|
||||
|
||||
You would just add them to the FORUMHOME and SHOWTHREAD templates. Or, you could put it in the headinclude and put a condition around it to only show it on those two pages.
|
#3
|
|||
|
|||
Ah ok, so I simply copy the code to the bottom of the template and that's it? That's what I did before, but like I said, I had the feeling the code was causing weird loading errors this time around. But I have to say I was using a different code back on the v3 version of vBulletin, so maybe it's not the position within the v4 version, but the code itself, or rather the file on the ad-server.
But as long as it's ok to just copy the code into the template I'm relieved. And thanks for the super-quick response. Much appreciated! Just one more thing, as you said, if I put it into the head-include, it will be loading on all pages? Because that's actually better than just on forum-home and showthread... |
#4
|
||||
|
||||
If you put it in the headinclude template, then that will be on all pages.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|