![]() |
Hi everyone. :)
Here's my newest hack, called Template Backup System (TBS). :D This is a very powerful tool for backing up and restoring your templates, especially good for upgrades. I know you can do this using vBulletin's buil in style manager, but the beauty in this hack is that it exports only templates, and further more - they are saved to individual files in a folder you choose. Why you ask? This could help a lot when upgrading to a new version of vBulletin. Just like you can compare files using programs such as Araxis Merge or Beyone Compare, you can now also compare templates, and easily keep track of changes that were done between versions. After you save all changes to the template files, you use this script again only this time in the opposite directions - restoring the templates back into the system. [hr=white][/hr] This hack was in testing process for quite some time now, over a week and a half actually. It has been tested extensively by the magnificent Hooper, and I truly believe it's 99% bug-free. Most of the features in the hack are actually his ideas, so thanks a lot Rick! :) [hr=white][/hr] Before I continue, I need to say the expanding / collapsing feature will only work on Internet Explorer. It was only tested on it really, but I think the style.display thing is only supported by it. Anyway, let's install this baby. ;) First of all, we need to edit admin/index.php a little bit. Find this: Code:
makenavoption("Add Template Set","template.php?action=addset"); Code:
[high]makenavoption("Add Template Set","template.php?action=addset","<br>"); Now edit cp.css (in the main forums folder). Now here's a file you don't edit often, huh? :) Find this: Code:
.cc { /* custom color */ Code:
[high].rc { /* custom color */ And last but not least, download tbs.php (attached to this post) and upload to your admin folder on your server. That's it, installation is done. :D [hr=white][/hr] A few notes. You can add new groups for template listing by editing tbs.php. At the top, you will see something like this: Code:
$groups['calendar']='Calendar'; Code:
$groups['[high]template_identifier[/high]']='[high]Group Name[/high]'; When saying "Using this requires a minimum amount of RAM." I am not kidding. If you don't have enough memory your browser will simply crash when clicking the Check All box. Trust me. Make sure the folder you are saving templates into is CHMODed 0777, or PHP will not be able to create files in it. Also, the folder is a relative path to the admin folder, not the forums folder! [hr=white][/hr] That's all I have to say. Feedback and feature requests are welcomed as always! :) Have fun! :D |
Selecting templates to export...
|
And selecting templates to import...
|
And of course the main intro screen...
|
ooo... bootyfull. . . O_O lol
This will be alot of help on my boards... Im ganna go install it now.. Thnx, and good job guys... :) -Syphin |
I get this when i go to the admin index page... =/
Parse error: parse error in /***/***/admin/index.php on line 338 hmm Edit: Nevermind.. works perfectly... ^^ *note to self: Dont code php when havnt slept in over 24 hours* Great work.. :p -Syphin |
Wow, Chen!! I thought the beta release was great. This is very cool! :D
|
great hack!
but one question.. why save it as .html's on the server? visitors can go around stealing your templates. why not export as a .zip to your pc? |
Very sweet FireFly!! Nice hack indeed. :D
|
nice hack u do FireFly~~~
it's a pretty good and useful hack |
nice work nice work, FireFly deserves title "Hacker That Makes Life Easier"
All in favor use the hack like me :) |
[QUOTE]Originally posted by holev
great hack! but one question.. why save it as .html's on the server? visitors can go around stealing your templates. why not export as a .zip to your pc? |
or you can just rename the folder where you store your templates into something else only "you" know ... it doesn't have to be /templates for the hack to work ;)
|
Chen, in tbs.php line 569 there is:
PHP Code:
PHP Code:
And I also wanted to ask you a question. If I set NO to "Choose templates to import selectively?" will it import ALL the templates or will it import only modified templates? Could you explain a little bit what Initially Check means? Thanks for the great hack! It saves LOTS of time...;) |
finally:)
Great job FireFly! |
Hmmm. I didn't catch that Import /Export line :( . You may have just mentioned that one word needed changing. At least it's Not a bug. ;)
I believe on import if select all is checked it will import all templates that you exported as such. So if you check all the default as well as Custom templates but not changed templates, It will import as such. |
I nominate this for hack of the year. This is such a timesaver. It imports as well as exports without a hitch.
Great job Chen and Hooper! |
[QUOTE]Originally posted by Hooper
Hmmm. I didn't catch that Import /Export line :( . You may have just mentioned that one word needed changing. At least it's Not a bug. ;) I believe on import if select all is checked it will import all templates that you exported as such. So if you check all the default as well as Custom templates but not changed templates, It will import as such. |
[QUOTE]Originally posted by Axel Foley
You haven't read my post carefully. Where have you read the word BUG? Look at the subject of my post, it says TYPO. ;) Regarding your explanation, it's not very clear what you mean, I think you didn't catch what I'm asking. And since this hack deals with templates (a delicate matter ;)) I think it's better if Chen (or Hooper which is the betatester) replies to my post. C'ya... |
That's what happens when you don't sleep for 24hrs...;)
Sorry Hooper... :rolleyes: Anyway...I didn't understand the explanation...;) |
[QUOTE]Originally posted by Axel Foley
That's what happens when you don't sleep for 24hrs...;) Sorry Hooper... :rolleyes: Anyway...I didn't understand the explanation...;) |
Obviously Hooper is trying to give me a head ache with his long explanations, so I'll answer. LOL j/k Hooper you're da man! :)
Anyhow, if "Choose templates to import selectively" is set to NO, the script will import all templates that are in the folder. If "Choose templates to export selectively" is set to NO, it will export ALL your templates, including created template, changed templates and even default templates. The "Initially check..." selections means what check boxes will be selected by default if you set "Choose templates to xxx selectively" to YES. This is done for ease of use. EXAMPLE: Let's say you only want to export ALL created templates and ONE changed template. So you set the "Initially check..." to NO except for the Create Templates controller. Then when you proceed, only created templates will be checked, and all you'd need to do is check the one modified template you wanna export. Clear? :) |
:rolleyes:
|
just awesome :D
|
wow, how did I miss this one!
Bloody amazing and useful, Thanks FireFly! |
ok, I just tried it out and I must say I am thoroughly impressed. I even dared and selected ALL and the backup took a few seconds!
One trivial thing (and I mean it when I say it's completely trivial): .htt is actually the best extension (HyperText Template). Especially if you have .html parsed as PHP on your server, in which case it would be more secore. .htt is also a recognized Windows extension, so for all intent and purposes it's just like HTML (eg if you dbl-click on a file it will open in your browser) but, as I said, more secure and designated for exactly what we're using it: as an html template :) Chen ata gever :D |
Thanks George and bira. :)
[QUOTE]Originally posted by bira Chen ata gever :D |
I see everything in my admin cp and all looks good, until I try to export.
I get hundreds of the different errors. Here is one of them. Warning: fopen("./templates/chatloggedin.html","w") - Permission denied in D:\Inetpub\users\mysite\forums\admin\adminfunction s.php on line 158 Any ideas? TIA |
Folders must be chmodded writable 777 or you'll get a bunch of errors. Either that or a path problem. Check both.
Rick |
I have a folder in the forum/admin called templates.
I have the path to go to templates. I have contacted the server and he said that chmod777 is linux but has done this for me on nt. I still have problems, any ideas? |
There is nothing wrong with having the folder in the Admin. Then when you try to backup be sure not to put /admin/templates for the path. Try just /templates. See if that works.
I have 2 backup folders in my admin and it works flawlessly. Rick |
Well I still can not get this going.
I have a folder in forums called templates. I also have a folder in forums/admin called templates. I had the server change to 777 on nt. I am running 2.2.1 I am lost as to why it will not write to one of those folders. I have it setup to go to templates in admincp. Any more ideas as to how to correct the problem I am having? |
Okay,
I got it. It was the server at fault as the permissions had to be changed. Great Hack Firefly old buddy old pal! |
You're welcome lucky. Glad it's working for you.
|
Oh my god!
This is fantastic! Can it be hacked to create a new dir with 777 permissions in a templates folder? So then we can just specify templates/newfoldername and if it doesn't exist and 'templates' is 777, it will create it Failing that, how about being able to prefix the export like 07012001_filename.html Nice tho :) --James |
[QUOTE]Originally posted by WildWayz
Can it be hacked to create a new dir with 777 permissions in a templates folder? So then we can just specify templates/newfoldername and if it doesn't exist and 'templates' is 777, it will create it Failing that, how about being able to prefix the export like 07012001_filename.html |
oh my!
You are a star :) --James |
BTW this is not tested, which is why I attached it to the last post.
Let me know if it works, will ya? Thanks. :) |
Excuse for a silly question but how to use this hack? Admit I has made upgrade vB. How to me to compare former and present templates? Or I have not understood something?
|
Am I understanding this correctly? Would this hack let me export templates to individual files, download the files for editing, upload the edited templates to an import directory, and then import the edited templates without having to go through the dreaded copy-paste routine?
If so, I may shoot myself. |
All times are GMT. The time now is 01:18 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|