vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   Quick Tip for porting your style to vBulletin 4 (https://vborg.vbsupport.ru/showthread.php?t=230484)

James Birkett 12-17-2009 10:00 PM

Quick Tip for porting your style to vBulletin 4
 
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!

COL NIL SATIS 12-21-2009 07:02 PM

excelent!!!!! thanks for that bud

cbiweb 01-15-2010 08:22 PM

Very nice indeed! Much appreciated. :up:

kall 01-30-2010 05:52 PM

Quote:

Originally Posted by James Birkett (Post 1932998)
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.

bananalive 03-29-2010 09:31 PM

If you use Notepad++ then you can use regular expressions in 'Find and Replace' to convert a lot of the variables.


All times are GMT. The time now is 01:25 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.01108 seconds
  • Memory Usage 1,719KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete