Version: 1.00, by Adrian Schneider
Developer Last Online: Nov 2022
Category: Administrative and Maintenance Tools -
Version: 3.7.0 Beta 4
Rating:
Released: 02-12-2008
Last Update: 02-12-2008
Installs: 82
Uses Plugins
Additional Files Is in Beta Stage
No support by the author.
Development Tool: Automatic Template Compiler
Requirements: PHP 5, vBulletin 3.5+
Summary: Allows you to edit HTML files directly instead of using the AdminCP template editor. ATC will automatically update the database if any changes are detected. This is intended for a development environment only, and will only run while in debug mode.
Why: Template development is a huge PITA because of how templates are stored in the database - they are compiled. This means you cannot simply save a file, or update the database, because vBulletin needs to compile them first, and maybe even update the style cache. This saves TONS of time copy pasting and switching between your editor, your page, and the vBulletin template editor box.
How it works: ATC maintains a checksum (md5 hash) of each template body, and when it finds that one is out of sync with your working copy, it will save that template automatically in a very efficient manner. It updates both the template about to be displayed in memory and also the real copy in the database.
It also includes a very basic import utility so you can copy your existing templates into the filesystem for easy editing.
How to use it: Follow the install instructions, and then whenever you edit a file, the changes will transfer to vBulletin itself.
This was written in PHP 5 (OO) and I have no plans to make it work with PHP 4, but I may eventually build an interface to manage the settings, but for developers, configuring it should be no problem.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Right now it defaults to the MASTER STYLE (-1) which is really what you should be using for any development, but I'm sure some of you are stubborn and will use it for customizing templates too.
I'll have the updated version uploaded within a few hours.
Right now it defaults to the MASTER STYLE (-1) which is really what you should be using for any development, but I'm sure some of you are stubborn and will use it for customizing templates too.
Well, exactly! And why not?
I kinda thought that was the whole point of allowing us to export and import the vbulletin product. As unless we work for Jelsoft, we're unlikely to want to modify the master style for their templates.
BTW, can you add one more teensy feature-ette, and allow us to define the file extension to use? I have added some extra smarts in Komodo to deal with template syntax as well as HTML, but the documents have to be of type .tpl. I stole the XUL from another Komodo extension that adds syntax support for Smarty templates, and tweaked it around a bit.
So, when do we get the APC (Automatic Phrase Compiler)?
In your ATC AdminCP settings, in "Configuration Data" you define what style ID the ATC should compile your templates into. For instance, mine looks like this:
The settings define the directory to use for the templates (which MUST be different for each product you create a config for), the product name, the product version (defaults to currently installed version if set to 0) and the styleID.
So I have two mods I'm actively working on (aboutme and staffid), so I'm using the master style for those. But for vB itself, I'm using the Default Style, so my vB template mods don't get written into the master style.
Oh, and you need to make sure you are running the latest version. The first couple of versions didn't have the styleID stuff.
I have the latest version installed (at least I think so, I downloaded the file just a couple of hours ago) and I can't spot a setting where I could configure this Add-on.
I had a look the the product's xml file and it installs just one plugin:
PHP Code:
if ($vbulletin->debug)
{
require_once(DIR . '/includes/class_auto_template_compiler.php');
$atc = new vB_Auto_Template_Compiler($vbulletin);
if (is_member_of($vbulletin->userinfo, 6) and $_GET['do'] == 'import')
{
$atc->import_from_database(
DIR . '/templates',
'vbulletin'
);
}