Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Automatic Template Compiler Details »»
Automatic Template Compiler
Version: 1.00, by Adrian Schneider Adrian Schneider is offline
Developer Last Online: Nov 2022 Show Printable Version Email this Page

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.
2 благодарности(ей) от:
Hoffi, xorex

Comments
  #22  
Old 02-14-2008, 02:49 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #23  
Old 02-14-2008, 10:05 AM
Appletalk Appletalk is offline
 
Join Date: Mar 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The PHP5 restriction is so lame!
Reply With Quote
  #24  
Old 02-14-2008, 10:35 AM
kafi kafi is offline
 
Join Date: Apr 2004
Posts: 379
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #25  
Old 02-14-2008, 11:38 PM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #26  
Old 02-14-2008, 11:56 PM
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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
Reply With Quote
  #27  
Old 02-15-2008, 12:31 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Always wanting more... lol

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

Quote:
The PHP5 restriction is so lame!
Not as lame as having to use PHP 4!
Reply With Quote
  #28  
Old 02-20-2008, 06:53 AM
MrNase MrNase is offline
 
Join Date: May 2003
Location: Germany
Posts: 670
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.
Reply With Quote
  #29  
Old 02-20-2008, 05:05 PM
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #30  
Old 02-20-2008, 06:03 PM
MrNase MrNase is offline
 
Join Date: May 2003
Location: Germany
Posts: 670
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

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->userinfo6) and $_GET['do'] == 'import')
    {
        
$atc->import_from_database(
            
DIR '/templates',
            
'vbulletin'
        
);
    }

    
$config = array(
        
'product' => 'your_product_id',
        
'version' => '1.0'
    
);

    
$atc->process_directory(DIR '/templates'$config); 

What do I have to change to make it work?
Reply With Quote
  #31  
Old 02-20-2008, 06:36 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The current release here has no options, so you just have to edit the plugin data ($config) to change the settings.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 05:30 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05973 seconds
  • Memory Usage 2,322KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete