The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hi,
I am running Smarty on my site, which has caused me some headaches integrating with vBulletin. My solution is that I've automated the publishing of these header/footer Smarty-coded files and parse them through Smarty into HTML files (w/ a few vBulletin variables) that vBulletin should be able to import. Obviously I don't want to copy and paste this resulting file into the header/footer DB templates because these will change, and I only want to make header/footer edits in one place. I've seen the threads with adding a new template for sidebar and the like, but these don't really address my problem of needing to replace the header/footer via the filesystem. What is the best way to do a PHP-style include for these headers/footers that contain vBulletin variables which themselves need parsing? Thanks! So a crude start is the "parse_templates" hook. This example is for replacing the template "headinclude" with an external file that gets eval'ed by vBulletin. Code:
$fd = @fopen( $file_to_include, 'rb' ); $contents = ( $size = filesize( $file_to_include ) ) ? fread( $fd, $size ) : ''; $vbulletin->templatecache[ "headinclude" ] = addslashes( $contents ); fclose( $fd ); LMK if there are any obvious perils to doing it this way, or if there is a better way. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|