Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin Tips & Tricks
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Quick Tip for porting your style to vBulletin 4
James Birkett
Join Date: Jun 2009
Posts: 633

 

Show Printable Version Email this Page Subscription
James Birkett James Birkett is offline 12-17-2009, 10:00 PM

Just wanted to share a quick tip that has shaved hours off porting my styles to vBulletin 4.

If you get a text editor with search & replace functionality, you can shave hours off your porting. I use Notepad++ as it is a great text editor.

To the point, our template variables must now be in the new syntax format in order to function properly and ensure safety. Some of these variables are recurring so we would change them maybe 40-50 times in a template, using the same code each and every time.

Let's take stylevars for example, we know that the new method is {vb:stylevar variable}, so why not change every cellpadding stylevar with 1 button click?

Search: $stylevar[cellpadding]
Replace: {vb:stylevar cellpadding}

As you can see, that would change every $stylevar[cellpadding] variable into {vb:stylevar cellpadding}, just doing that alone may save you 10-15 minutes?

Now if you do that with other variables... it could accumulate to around 4-5 hours time saved?

Search: <if
Replace: <vb:if

Search: </if>
Replace: </vb:if>

Search: <else
Replace: <vb:else

Search: $stylevar[cellspacing]
Replace: {vb:stylevar cellspacing}

Search: $stylevar[right]
Replace: {vb:stylevar right}

I think you get the picture.

Hope this tip helps you save hours of porting!
Reply With Quote
  #2  
Old 12-21-2009, 07:02 PM
COL NIL SATIS COL NIL SATIS is offline
 
Join Date: Aug 2009
Location: Liverpool UK
Posts: 802
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

excelent!!!!! thanks for that bud
Reply With Quote
  #3  
Old 01-15-2010, 08:22 PM
cbiweb cbiweb is offline
 
Join Date: May 2004
Location: Nova Scotia, Canada
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice indeed! Much appreciated. :up:
Reply With Quote
  #4  
Old 01-30-2010, 05:52 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by James Birkett View Post
Now if you do that with other variables... it could accumulate to around 4-5 hours time saved?
Search: $stylevar[cellspacing]
Replace: {vb:stylevar cellspacing}
Hmm. This one, definitely NOT a time saver. It's not in any of the default templates at all.

Does anyone have any idea what they've called {vb:stylevar cellspacing} , where it is defined, or even if it actually exists?

*edit*

Oh, and.. this is also wrong apparently.

Quote:
Search: $stylevar[cellpadding]
Replace: {vb:stylevar cellpadding}
it is now {vb:stylevar padding} by the looks of things.
Reply With Quote
  #5  
Old 03-29-2010, 09:31 PM
bananalive bananalive is offline
 
Join Date: Oct 2007
Location: UK
Posts: 2,802
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you use Notepad++ then you can use regular expressions in 'Find and Replace' to convert a lot of the variables.
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 01:29 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
  • Page Generation 0.03639 seconds
  • Memory Usage 2,229KB
  • Queries Executed 20 (?)
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
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete