Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Automatic Template Compiler Details »
Automatic Template Compiler
Mod Version: 1.00, by Adrian Schneider (Coder) Adrian Schneider is offline
Developer Last Online: Aug 2021 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.7.0 Beta 4 Rating: (14 votes - 4.93 average) Installs: 82
Released: 13 Feb 2008 Last Update: 13 Feb 2008 Downloads: 628
Supported Uses Plugins Additional Files Is in Beta Stage  

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.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #16  
Old 13 Feb 2008, 15:46
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
Originally Posted by Boofo View Post
I sure wish you guys weren't PHP 4 haters.
Someone has to be, otherwise we'll still be having this discussion when PHP20 comes out. PHP4 is a dead language. It has been officially "end of lifed" since the end of last year.

It's time we started exerting pressure as a community on all those hosting companies who refuse to upgrade, by voting with our feet. There are plenty of good hosts who do provide PHP5, and would be more than happy to take your business.

However, in this case the usual excuse that "my host doesn't support it" doesn't fly, as this tool is purely for use on local development machines, where it is up to you what version you run. Even if you still need to code to PHP4 standards, there's no reason you can't run PHP5. Just don't use any of the new features in your code.

If you have to have PHP4 available for testing, just run XAMPP, which has a neat little button that lets you switch between 4 and 5.

-- hugh
__________________
Hugh Messenger
Itinerant PHP Mechanic and vB Therapist
Will Work for Food or PayPal
Reply With Quote
  #17  
Old 13 Feb 2008, 17:36
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
AJ,

Can you do me a favor and move the config out of the plugin? Even if it's just a simple ACP option with stuff like:

myprojectid;1.0.2
anotherproduct;2.1.1

... and modify the plugin to grab that data and import / export any listed products.

At the moment, whenever we update your product, we lose any config data in the plugin. And lets face it, you do so like to rewrite and update your code.

Speaking of updating, how about also adding the help and version URL's in the product?

-- hugh
__________________
Hugh Messenger
Itinerant PHP Mechanic and vB Therapist
Will Work for Food or PayPal
Reply With Quote
  #18  
Old 13 Feb 2008, 21:30
waza waza is offline
 
Join Date: Apr 2005
hmm, if i edit a template (file) and save it and refresh my page it shows the changes.
But if I refresh my page again, they are gone...

Edit: i found the problem: he saved it in another style than the style i was working in.
__________________
Now available: SAPR, it's like god send an angel

Last edited by waza; 13 Feb 2008 at 21:47.
Reply With Quote
  #19  
Old 13 Feb 2008, 21:38
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Originally Posted by waza View Post
hmm, if i edit a template (file) and save it and refresh my page it shows the changes.
But if I refresh my page again, they are gone...
You'll have to PM me login details to try and debug that one. Try rebuilding your styles to see if that fixes it (does you no good, but narrows it down for me).

I'm about to upload an updated version where the config is moved into options.
__________________
Sr Software Developer / Tech Lead
Reply With Quote
  #20  
Old 14 Feb 2008, 03:10
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
Originally Posted by waza View Post
Edit: i found the problem: he saved it in another style than the style i was working in.
I'm testing the new version Aj mentioned. As well as moving the config into an ACP option, I also bullied him adding configurable style-ids per product for import and export. So that will solve your problem.

-- hugh
__________________
Hugh Messenger
Itinerant PHP Mechanic and vB Therapist
Will Work for Food or PayPal
Reply With Quote
  #21  
Old 14 Feb 2008, 03:49
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
What he said.

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.
__________________
Sr Software Developer / Tech Lead
Reply With Quote
  #22  
Old 14 Feb 2008, 11:05
Appletalk Appletalk is offline
 
Join Date: Mar 2007
The PHP5 restriction is so lame!
Reply With Quote
  #23  
Old 14 Feb 2008, 11:35
kafi kafi is offline
 
Join Date: Apr 2004
This sounds like a great tool, I am mad when I edit templates and play with css - copy and pass circle

THANK YOU SIR!!! Will test it with next template changes .-)
Reply With Quote
  #24  
Old 15 Feb 2008, 00:38
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
You're my hero Adrian! I was just ranting to a buddy how at annoying it was to have to copy and paste between my editor and the template manager.
__________________
Former vBulletin.org Staff Member

Please feel free to re-use any of the code in any of my projects submitted to vB.org, so long as original attribution is retained.
Reply With Quote
  #25  
Old 15 Feb 2008, 00:56
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
Originally Posted by SirAdrian View Post
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)?

-- hugh
__________________
Hugh Messenger
Itinerant PHP Mechanic and vB Therapist
Will Work for Food or PayPal
Reply With Quote
  #26  
Old 15 Feb 2008, 01:31
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Always wanting more... lol

.html, sure. I'll upload the new copy I guess tomorrow, or maybe tonight.

The PHP5 restriction is so lame!
Not as lame as having to use PHP 4!
__________________
Sr Software Developer / Tech Lead
Reply With Quote
  #27  
Old 20 Feb 2008, 07:53
MrNase's Avatar
MrNase MrNase is offline
 
Join Date: May 2003
Real name: Dominik
Originally Posted by waza View Post
hmm, if i edit a template (file) and save it and refresh my page it shows the changes.
But if I refresh my page again, they are gone...

Edit: i found the problem: he saved it in another style than the style i was working in.
How did you fix it? I have the same problems.

Last edited by MrNase; 20 Feb 2008 at 08:04.
Reply With Quote
  #28  
Old 20 Feb 2008, 18:05
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
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:

./templates, vbulletin, 0, 1
./cheesegrits/staffid/templates, staffid,0,-1
./cheesegrits/aboutme/templates,aboutme,0,-1

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.

-- hugh
__________________
Hugh Messenger
Itinerant PHP Mechanic and vB Therapist
Will Work for Food or PayPal
Reply With Quote
  #29  
Old 20 Feb 2008, 19:03
MrNase's Avatar
MrNase MrNase is offline
 
Join Date: May 2003
Real name: Dominik
Thanks for helping me!

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


What do I have to change to make it work?
Reply With Quote
  #30  
Old 20 Feb 2008, 19:36
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
The current release here has no options, so you just have to edit the plugin data ($config) to change the settings.
__________________
Sr Software Developer / Tech Lead
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

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

Layout Options | Width: Wide Color: