PDA

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


James Birkett
18 Dec 2009, 18:36
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
21 Dec 2009, 21:02
excelent!!!!! thanks for that bud

cbiweb
15 Jan 2010, 22:22
Very nice indeed! Much appreciated. :up:

kall
30 Jan 2010, 19:52
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
29 Mar 2010, 23:31
If you use Notepad++ then you can use regular expressions in 'Find and Replace' to convert a lot of the variables.