Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 12-08-2001 Last Update: Never Installs: 248
 
No support by the author.

Hi everyone.

Here's my newest hack, called Template Backup System (TBS).
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.

[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!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #52  
Old 01-09-2002, 08:46 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure... keep in mind it won't work on all servers though, which is why I didn't put it in in the first place.
Reply With Quote
  #53  
Old 01-09-2002, 08:51 AM
WildWayz WildWayz is offline
 
Join Date: Oct 2001
Location: United Kingdom
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Might leave it then - save on the confusion

--James
Reply With Quote
  #54  
Old 01-09-2002, 09:16 AM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default



Original (I forgot it, after +30 hacks... ) admin/index.php file.
Lines 330...334 ....
What's it ?

Thanks a lot and many compliments for your hard and complete work...
(p.s.: on a linux server, it doesn't manage to create the template directory... )
Reply With Quote
  #55  
Old 01-09-2002, 08:33 PM
Stretchr's Avatar
Stretchr Stretchr is offline
 
Join Date: Dec 2001
Location: Georgia, USA
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a must for the next vB edition. Thanks, Chen!
Reply With Quote
  #56  
Old 01-09-2002, 08:40 PM
Dade's Avatar
Dade Dade is offline
 
Join Date: Jan 2002
Location: California
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome Chen, thanks for this!
Reply With Quote
  #57  
Old 01-11-2002, 10:29 AM
Aaow AnD wHiTe's Avatar
Aaow AnD wHiTe Aaow AnD wHiTe is offline
 
Join Date: Dec 2001
Location: Barcelona, Spain
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack is just AMAZING O_O

Thank you so much, Chen!!
Reply With Quote
  #58  
Old 01-29-2002, 03:46 PM
kippesp kippesp is offline
 
Join Date: Jan 2002
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My Linux server prevents the export function from working. I also don't own the server. So I made modifications to email the templates. I won't post my entire modification since it is so system specific. Once the zip file is created on a particular system, this code will ship it out.

PHP Code:
// Prepare email
echo "Preparing email and attaching file $zipfile...";

$mail_boundary "----=" md5(uniqid(time()));
$mail_headers "";
$subject "vBulletin templates file for $bbtitle";
$mail_headers .= "From: \"vBulletin Mailer\" <$webmasteremail>\r\n";
$mail_headers .= "MIME-Version: 1.0\r\n";
$mail_headers .= "Content-type: multipart/mixed; boundary=\"$mail_boundary\"\r\n\r\n";
$mail_headers .= "This is a multi-part message in MIME format.\r\n\r\n";
$fp fopen("$tmppath/$zipfile""r");
$file fread($fpfilesize("$tmppath/$zipfile"));
$file chunk_split(base64_encode($file));
$mail_body "--$mail_boundary\r\n";

$mail_body .= "Content-type:text/plain; charset=ISO-8859-1\r\n\r\n";
$mail_body .= "The attached file '$zipfile' contains the vBulletin templates\r\n";
$mail_body .= "from the '$setinfo[title]' set of $bbtitle.\r\n\r\n";
$mail_body .= "--$mail_boundary\r\n";

$mail_body .= "Content-type:unknown/unknown; name=$zipfile\r\n";
$mail_body .= "Content-transfer-encoding: base64\r\n\r\n";
$mail_body .= $file "\r\n\r\n";
$mail_body .= "--$mail_boundary--";

mail("$email",$subject,$mail_body,$mail_headers); 
Reply With Quote
  #59  
Old 01-29-2002, 10:15 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by FireFly
[...]
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.
[...]
Reply With Quote
  #60  
Old 01-30-2002, 04:40 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure.
  • Add a new Template Set, that will use the default templates from vBulletin. Call it Before Upgrade.
  • Complete the upgrade (this includes the step where you install all the new templates - don't worry, your customized templates will not be damaged!).
  • Add a new Template Set, that will use the default templates from vBulletin. Call it After Upgrade.
  • Use this hack to import both template sets (Before and After) to different folders.
  • Use a comparing program (such as Araxis Merge) to compare the two folders, and then commit every change you find to your live template set (the one you are really using).

That should be it I think, don't forget to backup everything before you do this.
Reply With Quote
  #61  
Old 01-30-2002, 08:28 AM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much...
Sorry, but didn't understand.
Now I have only the 'default' template set: how could I assign all the templates simply adding a new set 'before upgrade' ?

Much probably I lack some basic information about templates and sets (and styles ... see here), but where could I read some FAQ or introduction about the VB concept of this matter ?

[QUOTE]and then commit every change you find to your live template set (the one you are really using).
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 07:54 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05590 seconds
  • Memory Usage 2,329KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete