Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
Templates in files (useful for development) Details »»
Templates in files (useful for development)
Version: 1.0.0, by cermi cermi is offline
Developer Last Online: May 2010 Show Printable Version Email this Page

Category: Mini Mods - Version: 3.6.8 Rating:
Released: 02-11-2008 Last Update: Never Installs: 7
Uses Plugins
Re-useable Code Translations  
No support by the author.

Hi devs/designers, did you get tired with modifying templates in vB admincp? I did, so I made this mod, which enables you to store files in [forum_root]/!templates/[tempate_name].html so you can edit them with your favourite HTML editor and you dont have to put them back into admincp after each edit.

Warning:
This mod is for dev purposes only and because the templates are compiled every time you reload the page, it slowes down the forums a bit (nothing significant on dev machine, but significant on production machine with many users).

Enjoy it and gimme feedback

Show Your Support

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

Comments
  #2  
Old 02-12-2008, 06:14 PM
ChurchMedia's Avatar
ChurchMedia ChurchMedia is offline
 
Join Date: Dec 2002
Location: Las Cruces, NM
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool! I've been thinking that a mod that will export/import the individual templates at text files would be great, but this seems like it would be even better!

Just so I understand -- You enable this mod and work on the HTML files -- Then disable it so that VB will use the templates and NOT the HTML files -- Is that right?
Reply With Quote
  #3  
Old 02-12-2008, 06:19 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any way to modify this to store template as files only and not have them re-compiled? Chen did a hack way back in vb 3 something, I think, that stored the template as files just so you had a backup copy of them in case the forum went bye-bye somehow. More for archival purposes.
Reply With Quote
  #4  
Old 02-12-2008, 07:06 PM
cermi's Avatar
cermi cermi is offline
 
Join Date: Jun 2007
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ChurchMedia View Post
Just so I understand -- You enable this mod and work on the HTML files -- Then disable it so that VB will use the templates and NOT the HTML files -- Is that right?
Yes, just don't forget to copy the content of the html files to vB templates in admincp otherwise your vB templates wouldn't be changed.

The idea of the mod is simple:
after loading the templates from database by vB, it reads all the files in the !template folder and rewrite the templates in $vbulletin->templatecache

Quote:
Originally Posted by ChurchMedia View Post
Cool! I've been thinking that a mod that will export/import the individual templates at text files would be great, but this seems like it would be even better!
Yea, I might add this feature too (in future), so you won't have to make the initial database->files and final files->database copy. (But 2 copies are still better than copy after each change )
Reply With Quote
  #5  
Old 02-12-2008, 07:09 PM
cermi's Avatar
cermi cermi is offline
 
Join Date: Jun 2007
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo View Post
Is there any way to modify this to store template as files only and not have them re-compiled? Chen did a hack way back in vb 3 something, I think, that stored the template as files just so you had a backup copy of them in case the forum went bye-bye somehow. More for archival purposes.
Well, you rewrite the template system, which wouldn't too difficult.
But for backup purposes you can use the standard vB export/import style feature, can't you?
Reply With Quote
  #6  
Old 02-12-2008, 07:23 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just want to back up the templates. All of them.
Reply With Quote
  #7  
Old 02-12-2008, 07:37 PM
cermi's Avatar
cermi cermi is offline
 
Join Date: Jun 2007
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo View Post
I just want to back up the templates. All of them.
Or backuping the template table in db?
Reply With Quote
  #8  
Old 02-12-2008, 07:41 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I can see where this is going. A simple "no" would have sufficed.
Reply With Quote
  #9  
Old 12-15-2008, 08:54 PM
Remi Remi is offline
 
Join Date: Nov 2001
Location: London, UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this working on 3.8.0

I have installed it, but I can't see any files or errors

nothing is happening at all
Reply With Quote
  #10  
Old 04-03-2010, 10:21 PM
Sparky McSmith Sparky McSmith is offline
 
Join Date: Dec 2009
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow. This is beautiful!!! Seriously. Great work Cermi - a simple, elegant solution to one of the biggest annoyances when customizing styles.

FYI - this works for vBulletin 4.0 just fine.

Thanks again!
Reply With Quote
Reply

Thread Tools

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 04:37 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.16678 seconds
  • Memory Usage 2,288KB
  • Queries Executed 23 (?)
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
  • (4)bbcode_quote
  • (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
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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