vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=170361

Automatic Template Compiler
by Adrian Schneider
13 Feb 2008 03:14

1 Attachment(s)
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. :cool:

cheesegrits 13 Feb 2008 03:27

Works like a charm. No more template editor, yay!

Don't know what took you so long though. You told me about the idea around 7pm, and it was gone 10pm before you were done. You're getting slow in your old age.

-- hugh

TECK 13 Feb 2008 03:39

Nice one, AJ. Will use it for sure.

Michael Biddle 13 Feb 2008 04:05

Installed :D.

Great Mod Aj

Basboss 13 Feb 2008 05:54

Installed.

Thanks dude.

testebr 13 Feb 2008 07:06

Let me kiss your ass please!!!

nix 13 Feb 2008 07:25

Nice :)

Now if you can learn to cook a can of soup as well as you code... ;)

Magnumutz 13 Feb 2008 07:41

Let me get this straight... this makes a HTML copy of the template so you can edit it, without using the AdminCP or what?

Adrian Schneider 13 Feb 2008 08:50

Quote:

Originally Posted by cheesegrits (Post 1441915)
Works like a charm. No more template editor, yay!

Don't know what took you so long though. You told me about the idea around 7pm, and it was gone 10pm before you were done. You're getting slow in your old age.

-- hugh

Well, 3 hours well spent I hope!

Quote:

Originally Posted by testebr (Post 1441987)
Let me kiss your ass please!!!

:erm:

Quote:

Originally Posted by nix (Post 1441988)
Nice :)

Now if you can learn to cook a can of soup as well as you code... ;)

Hey, lay off on the soup thing. I managed to cook alphagetti today without any incidents.

Quote:

Originally Posted by Magnumutz (Post 1441997)
Let me get this straight... this makes a HTML copy of the template so you can edit it, without using the AdminCP or what?

Right. Imports from DB to filesystem, and then watches the files for any changes, compiling and saving when they are found.

Cybertims 13 Feb 2008 09:13

I dont quite get this, I have installed it, now what do I do?

Cheers

projectego 13 Feb 2008 09:27

/me clicks install. Thanks!

Magnumutz 13 Feb 2008 11:11

That's awesome... i might try it on the future.
Good job Adrian !

Boofo 13 Feb 2008 11:49

I sure wish you guys weren't PHP 4 haters. ;)

Magnumutz 13 Feb 2008 12:33

Ah crap... hope my host upgrades to PHP5... actually i'll make it upgrade :D

waza 13 Feb 2008 14:17

you say you need to put ?do=atc_import as a variable on a page to import existing templates, but don't you mean ?do=import ?
however, thanks for this good time-saver


All times are GMT. The time now is 23:02.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.