PDA

View Full Version : Administrative and Maintenance Tools - Automatic Template Compiler


Adrian Schneider
13 Feb 2008, 03:14
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
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.

-- hughWell, 3 hours well spent I hope!

Let me kiss your ass please!!! :erm:

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.

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

cheesegrits
13 Feb 2008, 15:46
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

cheesegrits
13 Feb 2008, 17:36
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

waza
13 Feb 2008, 21:30
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.

Adrian Schneider
13 Feb 2008, 21:38
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.

cheesegrits
14 Feb 2008, 03:10
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

Adrian Schneider
14 Feb 2008, 03:49
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.

Appletalk
14 Feb 2008, 11:05
The PHP5 restriction is so lame!

kafi
14 Feb 2008, 11:35
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 .-)

Kirk Y
15 Feb 2008, 00:38
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. :D

cheesegrits
15 Feb 2008, 00:56
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

Adrian Schneider
15 Feb 2008, 01:31
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!

MrNase
20 Feb 2008, 07:53
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. :(

cheesegrits
20 Feb 2008, 18:05
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

MrNase
20 Feb 2008, 19:03
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:

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'
);
}

$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? :)

Adrian Schneider
20 Feb 2008, 19:36
The current release here has no options, so you just have to edit the plugin data ($config) to change the settings.

cheesegrits
20 Feb 2008, 19:50
Ooops! I could have sworn you'd released the new version I've been testing / using.

-- hugh

MrNase
21 Feb 2008, 12:55
Ok, I'll wait for the next version then. :)

cheesegrits
21 Feb 2008, 16:03
I'll bully AJ into getting it released ASAP! I'm still in shock at just how darn useful this mod is.

Oh, and I'll donate a "the" to your sig word collection. Copy, paste and use wisely.

-- hugh

ninjamaster
24 Feb 2008, 09:03
thanks nice work

Zachery
24 Feb 2008, 11:20
Nice, Don't really have a need for it as I've never found it a pain unless I was updating multiple styles to new versions or working en mass with lots of styles. Though I'm slightly suprised no one did this sooner seeing how part of this has been in the code for awhile.

Nice work :)

cheesegrits
24 Feb 2008, 18:42
I think you'd be amazed at how useful the ATC is, even if you don't do much template editing. You'll save the time it took you to install the ATC the first time you do need to edit a template. Template editing becomes just like PHP editing - make your changes to a simple HTML file using your IDE / code editor, and hit your page again.

I don't do a huge amount of template editing, but the ATC has already become one of those things I don't know how I lived without.

Even if you don't do template editing, just being able to dump all of vB's templates and include them in your IDE's "Search in Files" path is invaluable when trying to work out how vB does something. Like, what does $show['some_show_thingy'] do, how does it get set and where does it get used? One search in your IDE finds all occurrences in PHP and templates.

-- hugh

Chris-777
24 Feb 2008, 21:03
I sure wish you guys weren't PHP 4 haters. ;)

Me too. :(

/me clicks install anyway

I might actually upgrade to PHP5 just for this mod.

Adrian Schneider
24 Feb 2008, 23:58
Sorry for the huge delay in upgrades.

You can track the real progress of it at my dev. blog (http://refactored.siradrian.com/), and you may also be interested in the other upcoming or existing tools (http://refactored.siradrian.com/tools) if you are serious about developing.

(ATC is being renamed to VDE -- vBulletin Development Environment and will soon work for the other product data aside from just templates).

SVN users will be pleased to see public SVN access.

cheesegrits
25 Feb 2008, 00:57
SVN users will be pleased to see public SVN access.

And if you aren't an SVN user ... you should be. :)

A quick crash course for anyone unfamiliar with it, SVN is a "source control system". It allows developers to share and distribute the latest code. And because AJ's stuff is on a public SVN server with 'anonymous' access, anyone can use SVN to download AJ's latest and greatest, without having to wait till he gets round to updating the ZIP on this page.

For Windows, by far and away the best SVN client is Tortoise SVN:

http://tortoisesvn.net/downloads

Download and install it. Tortoise installs itself on your normal right click folder menu. Create a new folder somewhere called 'vbdevtools'. Right click in the new folder and select "SVN Checkout". In the "URL of Repository", paste this URL:

https://vbdevtools.svn.sourceforge.net/svnroot/vbdevtools

Click OK. Tortoise will now connect to the SVN server and download all the folders and files for AJ's 'vbdevtools' project. In ./vde/unstable you will find the ATC. To install / upgrade to it, do exactly what you would normally do - upload the uploads and install the XML.

From now on, whenever AJ updates his code, Tortoise will change the Green Tick folder icon on your 'vbdevtools' folder to a Red Exclamation Point icon. To download the updates, just right click the folder and select "SVN Update".

-- hugh

Antivirus
25 Feb 2008, 03:01
ah nice, I didnt know you released this publicly yet - i'll refer here from now on :)

Zachery
25 Feb 2008, 10:44
I think you'd be amazed at how useful the ATC is, even if you don't do much template editing. You'll save the time it took you to install the ATC the first time you do need to edit a template. Template editing becomes just like PHP editing - make your changes to a simple HTML file using your IDE / code editor, and hit your page again.

I don't do a huge amount of template editing, but the ATC has already become one of those things I don't know how I lived without.

Even if you don't do template editing, just being able to dump all of vB's templates and include them in your IDE's "Search in Files" path is invaluable when trying to work out how vB does something. Like, what does $show['some_show_thingy'] do, how does it get set and where does it get used? One search in your IDE finds all occurrences in PHP and templates.

-- hugh
Meh, I know my way around the template system fairly well, its never bothered me editing it via admincp :p

cheesegrits
25 Feb 2008, 18:54
Meh, I know my way around the template system fairly well, its never bothered me editing it via admincp :p

I have no doubt you know the template system like the proverbial back of your hand. I just don't see how anyone could possibly want to use the ACP to edit templates, when they could be using an 'intelligent' HTML/CSS editor instead, and never have to touch the ACP.

IDE's or even basic code editors provide all kinds of nifty support for editing HTML/CSS, like attribute completion, syntax checking, pretty printing, complex search / replace, code snippets, macros, etc. If you have a good IDE (or just install WinMerge), it will also handle diff'ing and merging, making vB upgrading a snap - upgrade, use ATC to dump everything in Master and any customized styles in separate directories, do a "directory diff and merge" in your editor / WinMerge, done.

I just don't see why anyone who does anything like any serious template editing wouldn't want to take advantage of all that.

-- hugh

vertigo jones
27 Feb 2008, 18:03
I love you.

jGas
06 Mar 2008, 22:04
i was able to enable ( :D ) debug mode...but now what do i have to do to find the html file?

thanks!

PyroNET
07 Mar 2008, 01:31
I love you.

Couldn't have put it better myself.

Feature suggestions:

Make it able to update css too. One of the things I hate the most is the vBulletin CSS editor.

If I create an html file in the template folder that isn't currently a customized template have it detect such and edit the style to customize that template.

jGas
08 Mar 2008, 08:59
by the way, in the $config, what do you mean for product_id and version?

if i set it on:

$config = array(
'product' => 'vBulletin',
'version' => '3.7.0 Beta 5'
);

it doesn't create any html page on the template folder...

aisais
18 Mar 2008, 00:02
Thank you for such smart idea. It saves a lot of time and efforts.
Tthanks again.

akanevsky
29 Mar 2008, 23:35
Now, this is a very useful modification. Thank you for creating it. Maybe you should suggest jelsoft that they include this into their distribution. Not that I will installing any of the 3.7.0+ versions due to a lot of networking crap in there that I don't think can even be turned off, but still...

furst
30 Mar 2008, 02:34
Let me see if I understand this thing.

Does this mean that with this installed I can open my vBulletin in Dreamweaver, make whatever changes I want, and then it will be updated on my site just like that to reflect the changes I made? If so, that's awesome.

brendanc
30 Mar 2008, 03:32
Does this work for 3.7.0 RC1?

Kiint
30 Mar 2008, 16:10
Any chance of some screenshots?

I like to know what I'm installing before I install it...saves a lot of work later :)

My host has an upgrade to 5.0 button in my website panel but am reluctant to click on it until everything I have on my vbulletin site works with it....is it backwards compatible?

sweede
29 Apr 2008, 22:19
There is nothing to screenshot...

cheesegrits
30 Apr 2008, 01:47
Let me see if I understand this thing.

Does this mean that with this installed I can open my vBulletin in Dreamweaver, make whatever changes I want, and then it will be updated on my site just like that to reflect the changes I made? If so, that's awesome.

Yes. Your templates basically become html files you can edit with your choice of editor. Any changes you make will be automatically compiled back into vB the next time any page is loaded.

-- hugh

Kiint
30 Apr 2008, 14:31
Yes. Your templates basically become html files you can edit with your choice of editor. Any changes you make will be automatically compiled back into vB the next time any page is loaded.

-- hugh

Now that makes sense. Kind of like downloading a html page, editing it, uploading it again and vb converts it back into a template ready for use.

Good idea :)

Lionel
02 May 2008, 00:00
I've got this rather strange issue. Earlier I downloaded 41 templates, formatted them and reuploaded via SSH. ATC found them.

Now, I added phrases to all those templates from my desktop and again reuploaded. ATC can't find them. If I open from server and save (without doing anything) ATC finds them .... Are there any issues with ATC and variables?

brendanc
02 May 2008, 08:58
I've got this rather strange issue. Earlier I downloaded 41 templates, formatted them and reuploaded via SSH. ATC found them.

Now, I added phrases to all those templates from my desktop and again reuploaded. ATC can't find them. If I open from server and save (without doing anything) ATC finds them .... Are there any issues with ATC and variables?

Maybe it is checking the created or modified date on the file?

brendanc
04 May 2008, 02:31
I haven't been able to get this to work. I'm not sure what's going wrong. Would you mind updating the product here?

sweede
05 May 2008, 09:33
So i went and downloaded the code from the SVN, which wasnt entirely working (much like ATC was).

Attached is a few modifications (and screenshots).

Currently it only works for the master style (-1).

It does support wildcards for the product field (example: ./templates/Master/vBulletin, %, 0, -1 )

cheesegrits
05 May 2008, 18:59
I've got this rather strange issue. Earlier I downloaded 41 templates, formatted them and reuploaded via SSH. ATC found them.

Now, I added phrases to all those templates from my desktop and again reuploaded. ATC can't find them. If I open from server and save (without doing anything) ATC finds them .... Are there any issues with ATC and variables?

I've come across a similar issue ... I'll bug AJ about it when I can catch him online. He's getting harder and harder to to pin down as his Daddyhood Date approaches!

-- hugh

jim6763nva
07 May 2008, 22:33
Ok. I downloaded and installed this and now I'm completely clueless as to where to go from here. Is there any kind of "Getting Started" steps, tutorials, or something to kick us Noobs in the right direction? I'd like to use DW CS3. What information do I add to the Plugin... Do I create a "/template" folder on my hosting service or locally? I'm also currently using Wamp locally and would like to replicate my remote vb installation on my home PC.. or is that not the right way to do it?

Any help would be appreciated,
Jim

jim6763nva
09 May 2008, 05:15
** UNINSTALLED **
Too confusing and not enough instruction on how to use it or configure it.

akanevsky
13 May 2008, 02:54
As I said previously, very good hack, another idea is to allow organized plugin / phrase modification from the file system. Maybe we can cooperate in developing this into a multi-purpose system?

Zachery
14 May 2008, 19:21
** UNINSTALLED **
Too confusing and not enough instruction on how to use it or configure it.
this modification is not for the average joe, its for developers and people who know what it does without having to have had it explained.

Adrian Schneider
14 May 2008, 19:25
As I said previously, very good hack, another idea is to allow organized plugin / phrase modification from the file system. Maybe we can cooperate in developing this into a multi-purpose system?
Sorry, I missed this reply.

I have another version in development which has another level of abstraction to handle different 'items' (templates, phrases, etc.)

You can take that over if you'd like - I have it in my SVN repos. somewhere. I usually develop things just enough to suit my needs and then I'm swamped with work and don't progress it until months later.

cheesegrits
14 May 2008, 20:26
this modification is not for the average joe, its for developers and people who know what it does without having to have had it explained.

See my repeated requests in the Private Coders Forum for a Private Coders Mods section. ;)

-- hugh

brendanc
14 May 2008, 22:13
Well, I'm fairly savvy when it comes to these types of things and I find it absolutely confusing. I've followed what little directions there are... and I can't get it to generate the files. I never get errors, but it doesn't work either.

cheesegrits
15 May 2008, 00:06
You can take that over if you'd like - I have it in my SVN repos. somewhere. I usually develop things just enough to suit my needs and then I'm swamped with work and don't progress it until months later.

I'd be more than happy to join in on some joint dev work. I know Adrian is tired of me bugging him to add more features ...

-- hugh

Mosh
15 May 2008, 12:42
How does one go about exporting vbulletin's templates to the filesystem with the CVS version? As it seems to be missing since the name change.

Also, does one set up a watch folder before starting to create a new product? Or after? Or do I have to do some process to output the templates to the filesystem?

Neo_obs
20 May 2008, 10:03
Ummm... where does the folder need to be? in your forum root or includes?

does it import automagically?

jim6763nva
22 May 2008, 21:25
this modification is not for the average joe, its for developers and people who know what it does without having to have had it explained.

I'm not the "average joe" thank you very much. I am a developer, I just don't develop vbulletin addons, etc 24/7. If this is supposed to be some sort of tool for the elite they way make it available to the public? Besides the so-called developers you speak of had to learn about how to use it at some point, right? How about sharing the love and share some info with some part time vbulletin developers?

Please? :D

Jim

Lionel
22 May 2008, 21:47
for the elite? You watch the elections too much LOL

sweede
23 May 2008, 02:24
The mod was pretty easy to use i thought, and i am the average joe coder.

In the SVN sources, i had to add a vbb plugin to the product so that you could export templates to the proper directory. I think i might have spent maybe 30 minutes looking through the source to figure out what and how to do anything i needed.

I do agree though that there is a pretty big importance on documentation, but it's also obvious that the original author posted more of a proof of concept product rather than a complete tool that can be used with little understanding as to why it works. I have thought of taking the SVN code and building upon it to complete his work, but my skill in object languages isnt up to the task at this time.

Danny.VBT
25 May 2008, 02:56
A tool that does this for plugins would be a god send. *drools* just thinking about it, and phrases too! Not having to deal with the phrase manager one at a time...*drools more*

sweede
28 May 2008, 14:00
I've been trying to find resources to teach myself php's object programming ways so i can figure out what the original author has done and apply a similar method to the plugin system but i end up playing world of warcraft or watching Chef Gordon Ramsay on hulu.com or something :|

Although, who ever creates a working system to edit plugins via text file v.s. the plugin editor will hold the mod of the month spot for quite some time :)

cheesegrits
01 Jun 2008, 18:54
Although, who ever creates a working system to edit plugins via text file v.s. the plugin editor will hold the mod of the month spot for quite some time :)

What I do for plugins during development is simply require a file with my actual code in it, like ...


require(DIR . '/cheesegrits/somehack/plugin.global_start.php');

This has two advantages ...

1) I can use my regular PHP editor on the code itself.

2) I can use xdebug (i.e. step through the code, enable breakpoints, etc), which you can't do with directly eval'ed code.

Once the code is ready for release, I just paste it into the plugin and get rid of the require.

-- hugh

Lionel
01 Jun 2008, 19:11
Not having to deal with the phrase manager one at a time...*drools more*

Andreas released an ajax "Add New Phrase" on vbulletin-germany that does just that. Extremely useful.

Adrian Schneider
01 Jun 2008, 19:25
Hugh / Anthony,

You are welcome to take it over and extend it to plugins and phrase. I think phrases is already done though, just kinda slow with this method.

cheesegrits
02 Jun 2008, 20:54
So how do we go about getting access to this mod thread? I'd rather keep it in place than create a new one.

-- hugh

sweede
03 Jun 2008, 00:57
Andreas released an ajax "Add New Phrase" on vbulletin-germany that does just that. Extremely useful.

I just jumped over there and i gotta admit, i'm highly impressed with his work. It takes a bit of work to get things worked out because right now it's all in german, but it's well worth the effort.

Andreas method is to create a folder, /addondev/pluginname/plugins or /addondev/pluginname/template and for the plugins, your filename is simply the hook that it belongs to. the name of the template is just that (with .tpl at the end).

When you refresh/visit your site, it loads up the data thats stored on the disk. When you export your product for distribution it reads all of the data from the disk and adds it to the xml file.

I created a plugin w/the name of my domain that i've placed extra templates such as custom templates for vbadvanced pages and modified style templates and it all works as expected.

Lionel
03 Jun 2008, 01:03
There is a wealth of developer's tools over there

sweede
03 Jun 2008, 01:11
to bad it's such a pain to paste all the text in google cause i cant read german :(

Lionel
03 Jun 2008, 01:23
LOL. Don't think that I do. You just have to figure it out by trial and error. So far, the release builder, the phrase type manager, the add phrase, the product builder which inserts the entire database queries for you in your product are my favorites

cheesegrits
03 Jun 2008, 19:13
Wooo hooooo. New toys.

Thanks for the pointer.

-- hugh

vertigo jones
13 Aug 2008, 17:23
Using what SirAdrian has in his SVN, I wrote a layer to make it work with plugins and (I think) didn't break anything with the template editing, though I'm only using one style so it's difficult to test thoroughly. There are likely a few bugs in it, so I could use some help testing it.

I can post it here if SirAdrian doesn't mind.

sweede
06 Sep 2008, 01:19
What would be awesome for it to do, is work how the release builder / devtools does.

When you export your product (in this case style), it creates the appropriate XML from the templates listed on the file system.

for theme dev, you would have something like..

ForumRoot / ThemeDev / MyThemeName / Templates
ForumRoot / ThemeDev / MyThemeName / CSS
ForumRoot / ThemeDev / MyThemeName / Whatever

and if you wanted to change/update/modify the postbit template, you create in the Templates directory postbit.tpl and add the appropriate template information.

The plugin would then pick this new template file up and use it over the default master postbit.

sweede
06 Sep 2008, 10:22
What would be awesome for it to do, is work how the release builder / devtools does.

When you export your product (in this case style), it creates the appropriate XML from the templates listed on the file system.

for theme dev, you would have something like..

ForumRoot / ThemeDev / MyThemeName / Templates
ForumRoot / ThemeDev / MyThemeName / CSS
ForumRoot / ThemeDev / MyThemeName / Whatever

and if you wanted to change/update/modify the postbit template, you create in the Templates directory postbit.tpl and add the appropriate template information.

The plugin would then pick this new template file up and use it over the default master postbit.

Ok, so i hacked some of this up real quick, for anyone still using this and interested.



Unpack and Upload files in the upload directory
Create the templates directory in the forum root. Make sure that this folder is writable by the webserver.
Install the VDE product file
Open up your config.php file and add $config['Misc']['debug'] = true; near the end of the file. Unsure if products that allow you to turn debug mode on/off work with this product. If you wish to run this on a live server (your own risk!!!) , you should add an if() statement around the debug variable so that only you will see the theme changes, so you dont break your forum.



From here you have two options,

Export an existing template (Requires chmod'ing files / directories)

In the AdminCP go to the vbulletin Options -> VDE and change Watch Templates Config to the style you wish to update. YOu pretty much will always have "./templates, %, 0, x" where x is the style id you're updating. DO NOT USE -1 for the master template, it can do bad things.
AFTER You change the Watch Templates config option, click save to update the config. After updating the config you can export the current modified templates to the file system by checking the box and hitting save (It will automaticly unset).
The files created in the templates directory may or may not be writable. you will have to chmod the created directories / files so that they are writable via FTP for you.


Create New Template style for modifcation.

Create a new directory in the templates directory.
Create a new Style with the same name as the directory, the name must be IDENTICAL, Including Capital letters and spacing. Naming the directory first will help figure out special characters you can and cant use.


Adding new Modifications to your style.

Simple create files in your new template directory that have the exact same name as the template you wish to replace. For example, if you want to make a new postbit for your MyTheme style, you would create templates/MyTheme/postbit.html
When you browse to your forums to check your theme, VDE will read the postbit.html file and update the database with your new file.


The Screenshots attached should show you a little bit of what to look for.

I'm looking through and seeing how i can hack CSS support that it would write out a CSS file that can be imported in some fashion back to the database.

armkbdotcom
26 Feb 2009, 04:24
For off-line template editing and more you can check vBProductManager development environment. One screenshot from program's help file:

https://www.vbulletin.org/forum/external/2009/02/13.png

Cheers

Adrian Schneider
26 Sep 2009, 22:06
Hey Guys,

I have been doing a ton of vBulletin mods lately and not having this stuff fully implemented is killing me, so I will be further developing this ASAP.

The new system I'm working on has two components:

1) Runtime loading of project data (templates, plugins, phrases, etc.)
2) Product XML builder - probably with CLI support and Web support

There will be a ./projects directory, and each project is a directory under it. Project folders will contain a templates, plugins, phrases, etc. dir for the relevant content. A lot of it will be taken from what I had in SVN, and some new.

I am taking a different approach on the runtime component: instead of checking for changes and rebuilding everything, I'm just loading it into memory so nothing ever gets imported into the database. After a lot of thinking, I have concluded that it's not necessary and is going to cause way too much overhead for larger projects.


On a side note, I will not be using SourceForge for the new code - it will be on a public git (github) repo instead.

fxdigi-cash
23 Sep 2014, 00:22
I wish this could work on vb4, tried it, but no luck!