Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Export and import templates to individual files! Details »
Export and import templates to individual files!
Mod Version: 1.00, by Chen (Member) Chen is offline
Developer Last Online: Mar 2009 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 2.2.x Rating: (0 vote - 0 average) Installs: 0
Released: 27 Nov 2001 Last Update: Never Downloads: 8
Not Supported Is in Beta Stage  

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!

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.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
BB Code Enhancements Import / Export BBCodes as XML files (updated by BOP5) BirdOPrey5 vBulletin 4.x Add-ons 18 10 Mar 2012 04:37
BB Code Enhancements Import / Export BBCodes as XML files (updated by BOP5) BirdOPrey5 vBulletin 3.8 Add-ons 6 25 Sep 2011 19:47
Export Templates to Files (by MySQL conditions) filburt1 vBulletin 2.x Full Releases 13 17 May 2003 08:05

Comments
  #2  
Old 27 Nov 2001, 19:40
snyx's Avatar
snyx snyx is offline
 
Join Date: Oct 2001
whoa, me likes this concept man!
I will install it on a dummy system asap, and get back to ya!
Reply With Quote
  #3  
Old 27 Nov 2001, 19:47
Parker Clack Parker Clack is offline
 
Join Date: Nov 2001
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
Reply With Quote
  #4  
Old 27 Nov 2001, 22:39
SteveK SteveK is offline
 
Join Date: Oct 2001
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
Reply With Quote
  #5  
Old 28 Nov 2001, 05:38
Parker Clack Parker Clack is offline
 
Join Date: Nov 2001
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
Reply With Quote
  #6  
Old 28 Nov 2001, 10:37
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
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
To only import some templates, you can delete all the others you don't want.
Also (not sure if I mentioned this already ), the script only updates templates that have changed.
If you try and only edit one file, and then updating the templates, you'll see only that template is listed as updated, and all the others were skipped.
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com
Reply With Quote
  #7  
Old 28 Nov 2001, 10:44
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
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]
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com
Reply With Quote
  #8  
Old 28 Nov 2001, 10:47
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
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
If you import a template that already exists, the original template is overwritten (if it's a modified template), and if it's a default template a new template is added to the template set. (don't worry, it's exactly how it works with the admin cp )

Doing what you just said, exporting to one file and importing from it, is exactly how it's being done today.
This is a bad way to upgrade, IMO (and others'), and it's why I created this script.
So doing what you suggested will actually be a step back.
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com
Reply With Quote
  #9  
Old 28 Nov 2001, 10:49
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
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.
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com
Reply With Quote
  #10  
Old 28 Nov 2001, 13:17
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
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>
Attached Images
File Type: gif selectbox.gif (6.8 KB, 61 views)
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com
Reply With Quote
  #11  
Old 28 Nov 2001, 13:27
Chen's Avatar
Chen Chen is offline
 
Join Date: Sep 2001
Talking *t00t* *t00t*

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'.
__________________
Chen Avinadav
Formerly vBulletin.org Owner and Founder

chen@avinadav.com
Reply With Quote
  #12  
Old 29 Nov 2001, 11:43
Parker Clack Parker Clack is offline
 
Join Date: Nov 2001
Chen:

Thanks for the upgrade and the explanation.

Great hack!!

Parker
Reply With Quote
  #13  
Old 01 Dec 2001, 23:11
FWC's Avatar
FWC FWC is offline
 
Join Date: Oct 2001
Thumbs up

This is very cool, Chen!
__________________
FWC
F5 Hosting
White Sox Interactive Forums
Reply With Quote
  #14  
Old 02 Dec 2001, 03:46
Hooper's Avatar
Hooper Hooper is offline
 
Join Date: Oct 2001
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.
__________________
Cheers,
Hooper

Last edited by Hooper; 02 Dec 2001 at 04:35.
Reply With Quote
  #15  
Old 02 Dec 2001, 11:10
Crinos's Avatar
Crinos Crinos is offline
 
Join Date: Nov 2001
Real name: Tolitz Rosel
Thumbs up

Installed and working great for downloading the template files

Haven't tried the import feature yet though
__________________
Open Tech Support
http://www.opentechsupport.net
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 09:04.

Layout Options | Width: Wide Color: