Log in

View Full Version : Quick Tip for porting your style to vBulletin 4


James Birkett
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!

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
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.

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.