The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Note: my last outstanding question is at the bottom. Thanks!
I've implemented a versioning system throughout my global templates (outside of vbulletin). Basically, it's a combination of a php snippet that adds a unique value to the filename based on the last-modified time and an .htaccess rewrite to ignore the extra characters. This guarantees that the browser will always load the latest version of css and javascript files. You can read about this really creative and easy-to-implement process here. I've created (and activated) the following plugin in global_start. Can anyone tell why it's not outputting anything? Code:
function autoVer($url){ $path = pathinfo($url); $ver = '.'.filemtime('/home/yadayada/public_html/'.$url).'.'; echo $path['dirname'].'/'.str_replace('.', $ver, $path['basename']); } $bannercss = autoVer('/css/banner.css'); Edit: I'm getting the 'Cannot redeclare autover() in /home/yadayada/public_html/scripts/autoVer.php' error which makes no sense. Another Update: apparently vB uses a function called autover(). So I changed it to myAutoVer and that error went away. Still, nothing is outputting. Any ideas? Yet Another Update: The problem may be with my hook. I was using global_start and putting the $bannercss variable in the headinclude template. This outputs nothing. If I select the init hook, then it outputs the correct text but right at the top of the page rather than where the variable is employed. What hook should I be using? |
#2
|
||||
|
||||
![]()
You may as well just turn on the No-Cache header option in vBulletin Options. If you do insist on using your method, you need to return the value and not print it.
PHP Code:
|
#3
|
|||
|
|||
![]()
Thank you, Dismounted! That was a simple enough mistake on my part.
In regards to the no-cache headers, these are not effective for my purposes. I use three different types of content management systems and some global templates go above all of them. I need to ensure that when I update the template, each client will download a fresh copy. The rest of the time, I want clients to use the cached copy. The board slows down dramatically with no-cache headers on and it's a waste of a lot of bandwidth. I highly recommend reading about this really clever and easy-to-implement versioning system. For those of us with environments that don't readily lend themselves to versioning, it makes it easy and automatic. What more could you ask for? |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|