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
  #102  
Old 05-30-2002, 05:48 PM
Wolf42's Avatar
Wolf42 Wolf42 is offline
 
Join Date: Nov 2001
Location: Vienna, Austria, Europe
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks FireFly!
Reply With Quote
  #103  
Old 05-31-2002, 02:35 PM
www.tourc.ca www.tourc.ca is offline
 
Join Date: Mar 2002
Location: Greater Toronto Area
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just switched servers and the template backup system doesn't work the same on the new server....

if there are no files in the templates directory, the backup system work fine.

but if there are existing files with the same name and I try to do a backup to overwrite the files I get the following messages!

Warning: SAFE MODE Restriction in effect. The script whose uid is 503 is not allowed to access ./templates/alinks.html owned by uid 0 in /home/virtual/site1/fst/var/www/html/forums/admin/adminfunctions.php on line 150

Warning: SAFE MODE Restriction in effect. The script whose uid is 503 is not allowed to access ./templates/alinks.html owned by uid 0 in /home/virtual/site1/fst/var/www/html/forums/admin/adminfunctions.php on line 158

Warning: fopen("./templates/alinks.html","w") - Success in /home/virtual/site1/fst/var/www/html/forums/admin/adminfunctions.php on line 158

Warning: Supplied argument is not a valid File-Handle resource in /home/virtual/site1/fst/var/www/html/forums/admin/adminfunctions.php on line 160

Warning: Supplied argument is not a valid File-Handle resource in /home/virtual/site1/fst/var/www/html/forums/admin/adminfunctions.php on line 162

this repeats over and over for each file it seems!

any ideas would be appreciated. for now I just ftp and delete all previous files before doing backup

-dave
Reply With Quote
  #104  
Old 05-31-2002, 02:41 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems to be caused by running in safe mode, ask your host to turn it off.
Reply With Quote
  #105  
Old 05-31-2002, 02:49 PM
www.tourc.ca www.tourc.ca is offline
 
Join Date: Mar 2002
Location: Greater Toronto Area
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what happens if I am my host... is it easy to turn off or do I start searchin the net..

BTW great hack (like all of your hacks) and talk about support! I was barley done the post

thanks
Reply With Quote
  #106  
Old 05-31-2002, 02:55 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is the part that controls Safe Mode in php.ini:
Code:
;
; Safe Mode
;
safe_mode = Off

; By default, Safe Mode does a UID compare check when
; opening files. If you want to relax this to a GID compare,
; then turn on safe_mode_gid.
safe_mode_gid = Off

; When safe_mode is on, UID/GID checks are bypassed when
; including files from this directory and its subdirectories.
; (directory must also be in include_path or full path must
; be used when including)
safe_mode_include_dir =								

; When safe_mode is on, only executables located in the safe_mode_exec_dir
; will be allowed to be executed via the exec family of functions.
safe_mode_exec_dir =

; open_basedir, if set, limits all file operations to the defined directory
; and below.  This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file.
;
;open_basedir =

; Setting certain environment variables may be a potential security breach.
; This directive contains a comma-delimited list of prefixes.  In Safe Mode,
; the user may only alter environment variables whose names begin with the
; prefixes supplied here.  By default, users will only be able to set
; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).
;
; Note:  If this directive is empty, PHP will let the user modify ANY
; environment variable!
safe_mode_allowed_env_vars = PHP_

; This directive contains a comma-delimited list of environment variables that
; the end user won't be able to change using putenv().  These variables will be
; protected even if safe_mode_allowed_env_vars is set to allow to change them.
safe_mode_protected_env_vars = LD_LIBRARY_PATH
You can either turn it completely off by setting safe_mode to Off:
Code:
safe_mode = Off
Or leave it on, but turn this setting off:
Code:
safe_mode_gid = Off
This should fix the errors you are getting.
Reply With Quote
  #107  
Old 06-03-2002, 01:13 AM
Henry-RS's Avatar
Henry-RS Henry-RS is offline
 
Join Date: Mar 2002
Location: Chicago
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

VERY USEFUL! Just installed lesane's hack with it.
Reply With Quote
  #108  
Old 06-03-2002, 08:17 AM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, Chen.
A (simple) request: could it be possible to export - export only (not needed import...) - ALL TEMPLATES including default ones, for example with a differend prefix, suffix or directory ?
I mean, if a template exists with more templatesetids (tipically 1 and -1), could it be possible to export both to different targets ?

Obviously, this feature should be very very useful when upgrading VB, to perform an easier check of changes in the '-1' set, otherwise not exported...

Thanks a lot.
LMK

Bye
Reply With Quote
  #109  
Old 06-03-2002, 02:57 PM
kippesp kippesp is offline
 
Join Date: Jan 2002
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by Jawelin
[B]Hi, Chen.
A (simple) request: could it be possible to export - export only (not needed import...) - ALL TEMPLATES including default ones, for example with a differend prefix, suffix or directory ?
I mean, if a template exists with more templatesetids (tipically 1 and -1), could it be possible to export both to different targets ?
Reply With Quote
  #110  
Old 06-03-2002, 03:07 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by kippesp
Default templates can already be exported. After you've upgraded your PHP files, add a new template set. Then export the new set.
Reply With Quote
  #111  
Old 06-03-2002, 09:44 PM
Darren Lewis Darren Lewis is offline
 
Join Date: Mar 2002
Location: England
Posts: 144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just reinstalled this hack (with the new tbs.php) and all works fine on V2.2.6 with PHP4.1.2.

Darren.
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 09:06 AM.


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.04584 seconds
  • Memory Usage 2,319KB
  • 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
  • (9)bbcode_code
  • (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