vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Export and import templates to individual files! (https://vborg.vbsupport.ru/showthread.php?t=32754)

Admin 11-26-2001 10:00 PM

I'm releasing this as beta because:
  • This has not been tested enough to prove it's working 100%.
  • Your templates aren't something that can be compromised.

In short, what does this hack do:
  • Can write all your templates into files, with any extension you'd like (.html is my favorite), having each template in its own file.
  • Can read from existing template files and save them back to your forum system.
  • Now with option to selectively choose what templates to import / export!

To install:
  • Download the attached ZIP file, extract it and upload do_template.php to your forum admin folder.
  • Go to the file in your browser.
  • If you are not on a Windows server, make sure PHP has permission to write (CHMOD 0777) in the folder you specify.
  • If the folder doesn't exist, PHP will attempt to create it, but you will need write permissions (CHMOD 0777) in the parent folder of it.

Please test this if you can.
If you're trying this out on your real board, it should be safe, but I highly recommend backing up your styles before using it.

This is the place to make suggestions, I expect some! :)

snyx 11-27-2001 06:40 PM

whoa, me likes this concept man!
I will install it on a dummy system asap, and get back to ya!

Parker Clack 11-27-2001 06:47 PM

Chen:

I just installed it on my server and it works like a champ at downloading them. I haven't try to upload any of them though. It would be cool if you could pick out which ones you would like to import instead of importing them all.

Parker

SteveK 11-27-2001 09:39 PM

I've just tried downloading once in text mode and it works great. Will try other file types and importing later.

How about the ability through the interface to delete previously saved directories of templates. Since the directory and files are written by www, you can't easily remove them via ftp.

Another idea would be the ability to save the templates in a user specified directory besides the forum/admin directory. Best would be below root but don't know if this is possible.

And one more idea would be a drop down box that would allow you to select just a few templates to download vs. a complete dump of all templates.

Okay, just one more idea.... how about being able to zip them up and send the downloaded templates out to us via email?? This is handy as many times I'm not on a system that I can FTP from (due to company proxy settings)

This is a great tool and will make template life much easier!

Steve

Parker Clack 11-28-2001 04:38 AM

When you import a template do you have to delete the other template first before importing or does it just write over the top of the old one?

I agree that a file that is created that you could download as one big file would be great. What if you wrote it so that all of the information is written to one file, like the style file is, and then you could just import that one file back in.

This is a great idea and I know it will be utilized a lot around the sites with vB.

Thanks again,
Parker

Admin 11-28-2001 09:37 AM

[QUOTE]Originally posted by Parker Clack
Chen:

I just installed it on my server and it works like a champ at downloading them. I haven't try to upload any of them though. It would be cool if you could pick out which ones you would like to import instead of importing them all.

Parker

Admin 11-28-2001 09:44 AM

[QUOTE]Originally posted by SteveK
I've just tried downloading once in text mode and it works great. Will try other file types and importing later.
To clarify, selecting .zip as the extension won't actually make the files zipped! They will still be in text mode.

How about the ability through the interface to delete previously saved directories of templates. Since the directory and files are written by www, you can't easily remove them via ftp.
That would require either saving all templates folders to the database in a special table, or having a script to go through the server and letting you do stuff with folders.

Another idea would be the ability to save the templates in a user specified directory besides the forum/admin directory. Best would be below root but don't know if this is possible.
AFAIK, you can't CHMOD folders below your public folder. Because of that, PHP won't be able to write to these folders.
TBH I don't really see the need for specifying folders that deep. :stupid:


And one more idea would be a drop down box that would allow you to select just a few templates to download vs. a complete dump of all templates.
Ok, I think I will add some kind of select box you can select templates from. Altough it would be very hard for the user to select all templates he wants, if there are a lot of them.

Okay, just one more idea.... how about being able to zip them up and send the downloaded templates out to us via email?? This is handy as many times I'm not on a system that I can FTP from (due to company proxy settings)
I actually thought of that, and I was sure it's a great idea.
The problem is, not all servers can zip files/folders on the server, because a special module is needed. And most servers don't have this. :(


This is a great tool and will make template life much easier!

Steve [/B]

Admin 11-28-2001 09:47 AM

[QUOTE]Originally posted by Parker Clack
When you import a template do you have to delete the other template first before importing or does it just write over the top of the old one?

I agree that a file that is created that you could download as one big file would be great. What if you wrote it so that all of the information is written to one file, like the style file is, and then you could just import that one file back in.

This is a great idea and I know it will be utilized a lot around the sites with vB.

Thanks again,
Parker

Admin 11-28-2001 09:49 AM

To demonstrate what the main intention of this hack is:
Let's say you upgrade from v2 to v3.
So you download your current (modified) v2 templates, and to another folder you download the original v3 templates.
Then you can use something like Beyond Compare or Araxis Merge to compare the two folders, on a file to file basis.
Then when you're done, you just upload the templates back to a folder, and import them back using this script.

Admin 11-28-2001 12:17 PM

Ok, so I worked this afternoon about this, and now you have an option to selectively choose which templates to import. (see screen shot)

I'm not working on the same thing for the export process. (which is a bit more complicated than I thought!)

Heh, it took me 20 minutes (and a Google search ;)) to realize I need to put [] next to the input name when doing:
<select name="blbla[]" multiple>
:p

Admin 11-28-2001 12:27 PM

Finally. :)

Now you can select which templates to export or import then you run the script (there is a little drop down menu for selecting Yes or No).

Just upload the new file to 'upgrade'. ;)

Parker Clack 11-29-2001 10:43 AM

Chen:

Thanks for the upgrade and the explanation.

Great hack!!

Parker

FWC 12-01-2001 10:11 PM

This is very cool, Chen! :)

Hooper 12-02-2001 02:46 AM

Good Grief Chen,

I don't know which is better. The new hack for including WOL links. Or this. Or the Advertisement hack.

They are all great. I have been backing up my templates into text files by hand since I purchased vBulletin. This is unreal. What took me a half hour now litteraly takes me less than 5 seconds. And the select what templates to import and export....all I can say is WOW. I went ahead and added it to the Admin CP.

---------------------------------------------------------------------------------

Question: When downloading a template set other than the default it always says that it downloaded the default. What might cause this? It seems to be backing up the correct template set, but for some reason it says default no matter what the name of the template set is. Sorry if someone already asked.

Question: I am not seeing a section that says downloading Users Custom Templates. What might be the cause of this? Sorry if someone already asked.

---------------------------------------------------------------------------------

Thanks Chen.

Crinos 12-02-2001 10:10 AM

Installed and working great for downloading the template files :)

Haven't tried the import feature yet though

Admin 12-02-2001 11:53 AM

Why is it saying Default all the time?
When it says "Done exporting default templates!", it doesn't mean it exported the default template set, but it just means it's done exporting templates that weren't changed in the template set you selected.
(these are the templates that are colored green in the template list)

You're not seeing the part where it says downloading Users Custom Templates?
Maybe you have no custom templates in the template set you selected. Are you sure you have some?
Also does it say something like "No custom templates to export"!, or just displays nothing? A screen shot would help. :)

[QUOTE]Originally posted by Hooper
They are all great. I have been backing up my templates into text files by hand since I purchased vBulletin. This is unreal. What took me a half hour now litteraly takes me less than 5 seconds. And the select what templates to import and export....all I can say is WOW. I went ahead and added it to the Admin CP.

Hooper 12-02-2001 04:10 PM

Welcome! :D

Oh yeah. I have a bunch of custom templates in 2 different styles. It says nothing at all about downloading them. Nor are they there when I check the server for them. I've tried both the News Template set and my Main set. I'll work on this today and post some shots. But never does it say anything about the Custom User Template set.

Any chance of having the name of the set you are backing up and importing to have the name on it. With this being the templates, It makes a user quite ..well....let's say "On the edge" with not seeing exactly what is going on. So If I had seen the name of my template set before and after the backup, I will feel much more comfortable with the situation.

Backing up News Templates.....DONE! :D

I have a a bunch of customized and quite a few custom templates.

Thanks Chen

FWC 12-02-2001 04:38 PM

[QUOTE]Originally posted by Hooper
Oh yeah. I have a bunch of custom templates in 2 different styles. It says nothing at all about downloading them. Nor are they there when I check the server for them. I've tried both the News Template set and my Main set. I'll work on this today and post some shots. But never does it say anything about the Custom User Template set.

Hooper 12-02-2001 04:41 PM

Yes it is weird. It didn't back up my Custom User Templates at all.

What I would like to see is


Downloading....Custom User Template Set

Downloading.... News Template Set

and so on.... Only saying default if it is indeed the default template set that is being up or downloaded.

Having 5 sets and always seeing Default is just not going to satisfy my nerves when I am messing with a bunch of highly changed templates and days (scratch days... Try weeks) of hard work.

I need to know what it is doing... :D

Admin 12-02-2001 04:58 PM

Hooper, I really have no idea what could be wrong.

Anyway, I re-did the whole way you are shown templates that are exported / imported - you should be satisfied with this version.
They are now displayed in one big table, with [edit] links next to each template(!!!). :p

Also new, in the select box where you select templates to export / import, original temlpates are colored green, and modified templates are colored blue. How user friendly is that? :D

Just finishing it off and I'll put the new version up in a bit.
Now that I have the [edit] link, please test it and make sure it really links to the right template! :)

Admin 12-02-2001 05:00 PM

Ok new file is up, download and upload! :)

Hooper 12-02-2001 05:51 PM

I downloaded with Opera and am getting a different file. WinXP IE 6 is screwed on my end.


Ah.... Yes. Much better Chen. I now not only can see what templates are what, they are devided, color coded and EDITABLE? :D

Wow..... Better than I asked for. I downloaded and verified manually that it was done correctly. I'll work on the import this after noon and post my finds.

Thanks for the update, this is much better.

FWC 12-02-2001 07:31 PM

Wow!! I thought the first version was great. This new version is incredible!! Awesome work, Chen. :D

Admin 12-03-2001 11:08 AM

Thanks guys. :D

I would like a button that will automatically select all custom templates... problem is my Javascript knowledge is very limited so I have no idea where to begin with it.
If anyone can give me a hand it would great. :)

Maybe add a yes/no button to say "Only export / import custom templates"? Any thoughts?

FWC 12-03-2001 04:08 PM

[QUOTE]Originally posted by FireFly
Maybe add a yes/no button to say "Only export / import custom templates"? Any thoughts?

Hooper 12-03-2001 05:27 PM

I agree,

It would be a whole lot nicer and more functional to be able to select by grouping and individual files. In other words, instead of backing up and overwriting ALL templates, it would be super to go in and grab templates by sets with a way to include only desired templates. Ex. Custom Templates, User Templates, or what have you. With individual selection next to desired templates to back up. I'm picturing a radio button selection with the heirachy set as within the control panel for grouping. Super if we could see the edit/expand full template scheme with individual file selection. (radio)

At the present if you modify a few templates, you will be backing up all of the templates including the templates that are not modified. If this could be set up in such a way that templates were able to be selected individually ...( say by having a selection next to it) we wouldn't have to over write templates within the folder nor would we have to download all the non modified templates every time.

Chen how difficult would it be to have a "selectable by group or file" type system with a "select all" funtion?

This would give the user the overall protect your files and backup plan, while allowing for the person modifying specific templates to keep on top of things also.

Yes. We need this. :) Do you really need javascript for this? Why couldnn't we use the vBulletin file that expands the templates for edit? Iwouldn't mind seeing something like the edit template pages for backup. You could expand the groups and choose the templates you wish. We would however need a "Select All" function as well as a "Clear all selections".

Also, if they are going to tag names with hacks around here I would ask that they find the file attatched to my name and remove it. Whatever the heck Imp is. :p

Thanks

Admin 12-04-2001 12:05 PM

Hooper, I really appreciate all your help and feedback. :)
Do you happen to have ICQ? If so, please contact me when you can. My number is listed in my profile.

Another change I plan to do is separating the custom templates and original templates in the selecting box.
Also in that area, I would like to group templates by their groups as they are listed in the Admin CP temlpates page.
I'll mess around with the idea a bit later and see what I can come up with.

Hooper I would really like to address all your ideas, but it's a bit hard for me to express what I think in English. :) :o
If we can talk in real time (ICQ or IRC) it would be great.

Hooper 12-04-2001 12:25 PM

OkeyDokey.

142002484

I'm live.

DelusionalMind 12-29-2001 06:17 AM

[high]* DelusionalMind rushes to install
[/high]

you rule dude!!! :)

Hooper 12-29-2001 12:55 PM

This has now been released as TBS (template backup system). I would download the hack from that thread. I don't know how updated this thread is.

TheComputerGuy 12-31-2001 02:46 PM

Works for WEb+++++ GREAT!!!

Lucky 01-03-2002 07:14 AM

Isn't this the same one as your other called Template Backup System?


All times are GMT. The time now is 02:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01399 seconds
  • Memory Usage 1,812KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (32)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete