View Full Version : Do you think my random code for adsense/gif-banners will work in a vbulletin template
I want to randomly display my adsense script and a banner or two. Could I insert something like this into my header template:
With those .txt files full of their respective codes...
Or would you do something else?
09-20-2005, 02:56 PM
the content of templates is usually not included and thus php-code won't be parsed. (get_contents is used instead).
So you'll need to put this somewhere else.
09-20-2005, 04:23 PM
The problem with this an the vbulletin scripting (depending on your version), is that vB 3.x will accept limited functions for their templates, due to their 'simplistic' methods. vB templates are called using eval() functions, which will evaluate any php contained within them. 3.x versions will be tricky at best though, I'd personally recommend another routine for this.
Take your global.php file, add what you have, but capture this information into a new variable. You can now use this variable within the actual vBulletin templates. Instead of using include structures, use a file() method instead (file_get_contents, readfile, etc), anything to put it into a string. Name your variable accordingly though, you don't want to overwrite a vbulletin template call.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.