PDA

View Full Version : Template Importer


Xenon
08-07-2002, 10:00 PM
Version: 1.0

This miniaddon i've coded last night, for another hack i'm currently working on, but then i thought it might be usefull for quite more users so i release it seperatly.

What it does?
It's a small script you have to run from your Admin-CP. You can enter a filename of a *.tpl-file (Template file formate by me ;)) and it'll add the Template to the global template set.
As you can see this can be very usefull if you have a lot of template sets and want to add a new hack which comes a long with much templates....

If the template already exists, it'll ask you if the new one should overwrite the old.

Because the Addon adds templates to the global set, you have to rerun it with every template file again after you've done an upgrade.

Personally i made it just for installing new templates that comes within a new hack, it has nothing to do with a backupsystem. If you want to export templates and import them again later you should use this (https://vborg.vbsupport.ru/showthread.php?s=&threadid=33072) hack by FireFly.

I don't think i would add something to the hack, but feel free to make suggestions ;)

Zipfile contains:
tplimporter.php - the script (upload it to your admin folder)
tplimporter.txt - installation textfile and *.tpl file description
test.tpl - a *.tpl file so you can see how they should look ;)

Enjoy

Velocd
08-09-2002, 12:07 AM
Where is everyone today? Xenon makes a hack hours ago, and nobody has replied yet? What is the world coming to!?!?!? =falls over=

Anyway, this hack looks really neat Xenon, although I don't think I'll ever be using anytime soon. *clicks install anyway* ;)

[D]Vincent
08-09-2002, 06:12 AM
Great hack ^^ but I'm not installing it lol.

Neo
08-09-2002, 06:19 AM
LOL guess not many people see a need for it.. if I used templates (coder joke) I would more so already have this installed. :)

Xenon
08-09-2002, 03:08 PM
hey i know this i doable by just set debugmode to on and add templates manually to the global set, but there are always some ppl out there who don't want to change the debug value ;)

solent
04-25-2003, 07:43 AM
me clicks install. some good hacks have a lot of templates to add and this hack will simply make your life easier on installing the hacks.

cool Xenon thanks

Dean C
04-25-2003, 09:13 AM
Just remove the code from the index.php the stefan ;)

- miSt

Xenon
04-25-2003, 11:21 AM
erm, i have absolutley no idea what you want to say?

as this is the second post of you like that today, i have to ask:
Are you drunk dean? :p

Dean C
04-25-2003, 12:30 PM
No i have a piece of metal in my mouth which is hurting greatly lol ;)

You could change this code in admin/index.php:


if ($debug==1) {
makenavoption("Download Set","template.php?action=downloadset","<br>");
makenavoption("Upload Set","template.php?action=uploadset","<br>");
makenavoption("Do <img> Tags","template.php?action=imgtags");
}


:)

- miSt

Xenon
04-26-2003, 04:00 PM
it's not the same :)

i know that section, because it's the functionality which gave me the idea ^^

debug mode is always enabled on my testboard ;)

Chris M
04-26-2003, 04:59 PM
Wow...

This looks great Stefan!:)

Everyone should use this;)

Satan

Fargo
01-27-2004, 02:39 PM
Thank you Xenon - Ive got 6 template sets on my site and several hacks to install (each with several new templates to add) - this is gonna save me a LOT of time. You are a GOD! lol

[edit]

after reading up on this..
The .tpl scheme is fairly easy to work with, but is it possible to use the "new template" style system, where one can simply type in the template name in one box, then the contents of the template into the 2nd box & finally hit a submit button?

The way you have it setup right now will still save quite a bit of time, however, it still takes the time to create a new .tpl file, then read it into the page. Having the 2 box and submit button would save even more time if you install hacks that come with the template data in text files (example: copy & paste title then copy and paste body, then save, etc etc) (like shoutbox, quick reply, tutorial hack).

Just an idea :)

Xenon
01-27-2004, 05:05 PM
well, sorry, but i don't work on any vb2 hacks anymore, as i have switched over to vb3 totally ;)

Fargo
01-27-2004, 10:01 PM
np Xenon, thanks for the reply :)