vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Template Backup System! (https://vborg.vbsupport.ru/showthread.php?t=33072)

Admin 12-08-2001 10:00 PM

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");
and replace it with this:
Code:

[high]makenavoption("Add Template Set","template.php?action=addset","<br>");
makenavoption("Template Backup System","tbs.php?action=modify");[/high]

Save admin/index.php and upload back to your server.

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 */
        COLOR: darkblue;
}

and add this right after it:
Code:

[high].rc { /* custom color */
        COLOR: darkred;
} [/high]

Save cp.css and upload back to your server.

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';
$groups['emailsubject']='Email Subject';

and much more. To add your own group, simply add this:
Code:

$groups['[high]template_identifier[/high]']='[high]Group Name[/high]';
[high]template_identifier[/high] is the beginning of each template in this group, and [high]Group Name[/high] is the name of this group.

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

Admin 12-09-2001 12:32 PM

Selecting templates to export...

Admin 12-09-2001 12:32 PM

And selecting templates to import...

Admin 12-09-2001 12:32 PM

And of course the main intro screen...

Syphin 12-09-2001 01:07 PM

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

Syphin 12-09-2001 01:16 PM

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

FWC 12-09-2001 05:18 PM

Wow, Chen!! I thought the beta release was great. This is very cool! :D

holev 12-09-2001 05:18 PM

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?

Mike Gaidin 12-09-2001 05:25 PM

Very sweet FireFly!! Nice hack indeed. :D

squawell 12-09-2001 05:27 PM

nice hack u do FireFly~~~

it's a pretty good and useful hack


All times are GMT. The time now is 09:57 PM.

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.01069 seconds
  • Memory Usage 1,736KB
  • 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
  • (6)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete