Log in

View Full Version : How can I convert this code for vb4 ?


Bulent Tekcan
03-31-2012, 08:13 AM
Hello

I have this code for rounded image bb code.But not work with vb4, anybody help me ?

<table border="0" cellpadding="0" cellspacing="0" align="center" style="margin-top: 5px; margin-bottom: 5px; width:$stylevar[codeblockwidth];">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="75" valign="bottom">
<table border="0" cellpadding="0" cellspacing="0" width="50">
<tr>
<td width="28" valign="top">
<img src="$stylevar[imgdir_misc]/quotes/quot-top-left.gif" alt /></td>
<td width="100%" style="background-image: url('$stylevar[imgdir_misc]/quotes/quote-bg.gif'); background-position: center;" valign="middle">
<span class="smallfont">$vbphrase[quote]:</span></td>
<td valign="top">
<img src="$stylevar[imgdir_misc]/quotes/quot-top-right.gif" alt /></td>
</tr>
</table>
</td>
<td align="left" style="background-image: url('$stylevar[imgdir_misc]/quotes/quot-lr-bg.gif')" valign="bottom">
</td>
<if condition="$show['username']">
<td width="0" align="left" valign="bottom">
<table border="0" cellpadding="0" cellspacing="0" width="200">
<tr>
<td valign="top">
<img src="$stylevar[imgdir_misc]/quotes/quot-by-left.gif" alt /></td>
<td width="100%" style="background-image: url('$stylevar[imgdir_misc]/quotes/quot-bye-bg.gif')" align="left" valign="middle" nowrap="nowrap">
<span class="smallfont">
<div>
<phrase 1="$username">$vbphrase[originally_posted_by_x]</phrase>
<if condition="$postid"><a href="showthread.php?$session[sessionurl]p=$postid#post$postid" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/viewpost.gif" border="0" alt="$vbphrase[view_post]" /></a></if>
</div>
<td valign="top">
<img src="$stylevar[imgdir_misc]/quotes/quot-by-right.gif" alt /></td>
</tr>
</table>
</td>
<else /></if>
<td width="100%" align="right" valign="bottom">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="background-image: url('$stylevar[imgdir_misc]/quotes/quot-top-bg.gif')" width="100%" valign="middle">
</td>
<td align="left" valign="top">
<img src="$stylevar[imgdir_misc]/quotes/quot-top-right-10.gif" alt /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="10" style="background-image: url('$stylevar[imgdir_misc]/quotes/quoting-left.gif')">
</td>
<td width="100%" valign="top" bgcolor="#ffffff"></td>
<td width="10" style="background-image: url('$stylevar[imgdir_misc]/quotes/quoting-right.gif')">
</td>
</tr>
<tr>
<td width="10" style="background-image: url('$stylevar[imgdir_misc]/quotes/quot-left-bg.gif')">
</td>
<td width="100%" valign="top" bgcolor="#ffffff" class="smallfont">
<if condition="$show['username']"><i>$message</i>
<else />$message</if></td>
<td width="10" style="background-image: url('$stylevar[imgdir_misc]/quotes/quot-right-bg.gif')">
</td>
</tr>
<tr>
<td width="10" valign="bottom">
<img src="$stylevar[imgdir_misc]/quotes/quot-bot-left.gif" alt /></td>
<td width="100%" style="background-image: url('$stylevar[imgdir_misc]/quotes/quot-bot-bg.gif')">
</td>
<td width="10" valign="bottom">
<img src="$stylevar[imgdir_misc]/quotes/quot-bot-right.gif" alt /></td>
</tr>
</table>
</td>
</tr>
</table>

Lynne
03-31-2012, 01:26 PM
You need to change all the conditions to be vb4 conditions, ie <vb:if, not just <if , and also convert all variables not used in conditions to use the vb4 syntax, ie {vb:stylevar imgdir_misc}, not $stylevar[imgdir_misc], and also change the way your phrases are called, ie. {vb:rawphrase quote}, not $vbphrase[quote]. I believe there is an article about this in the articles forums. Or, just look at a template in your Style Manager and you will see how it is now done.

Bulent Tekcan
04-01-2012, 06:01 AM
Thanks Lynne, I'm not a code exper and still I get some error during save style. I changed many things but I thing some wrong code still here
, can you help me for this ? Last code is here, but I'm not sure it is ok or not.

<table border="0" cellpadding="0" cellspacing="0" align="center" style="margin-top: 5px; margin-bottom: 5px; width:{vb:stylevar quote_container};">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="75" valign="bottom">
<table border="0" cellpadding="0" cellspacing="0" width="50">
<tr>
<td width="28" valign="top">
<img src="{vb:stylevar imgdir_misc}/quotes/quot-top-left.gif" alt /></td>
<td width="100%" style="background-image: url('{vb:stylevar imgdir_misc}/quotes/quote-bg.gif'); background-position: center;" valign="middle">
<span class="smallfont">{vb:rawphrase quote}:</span></td>
<td valign="top">
<img src="{vb:stylevar imgdir_misc}/quotes/quot-top-right.gif" alt /></td>
</tr>
</table>
</td>
<td align="left" style="background-image: url('{vb:stylevar imgdir_misc}/quotes/quot-lr-bg.gif')" valign="bottom">
</td>
<vb:if condition="$show['username']">
<td width="0" align="left" valign="bottom">
<table border="0" cellpadding="0" cellspacing="0" width="200">
<tr>
<td valign="top">
<img src="{vb:stylevar imgdir_misc}/quotes/quot-by-left.gif" alt /></td>
<td width="100%" style="background-image: url('{vb:stylevar imgdir_misc}/quotes/quot-bye-bg.gif')" align="left" valign="middle" nowrap="nowrap">
<span class="smallfont">
<div>
<phrase 1="$username">{vb:rawphrase originally_posted_by_x}</phrase>
<vb:if condition="$postid"><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}showthread.php?{vb:raw session.sessionurl}p={vb:raw postid}#post{vb:raw postid}" rel="nofollow"><img class="inlineimg" src="{vb:stylevar imgdir_button}/viewpost-{vb:stylevar right}.png" alt="{vb:rawphrase view_post}" /></a></vb:if>
</div>
<td valign="top">
<img src="{vb:stylevar imgdir_misc}/quotes/quot-by-right.gif" alt /></td>
</tr>
</table>
</td>
<vb:else />
<td width="100%" align="right" valign="bottom">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="background-image: url('{vb:stylevar imgdir_misc}/quotes/quot-top-bg.gif')" width="100%" valign="middle">
</td>
<td align="left" valign="top">
<img src="{vb:stylevar imgdir_misc}/quotes/quot-top-right-10.gif" alt /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="10" style="background-image: url('{vb:stylevar imgdir_misc}/quotes/quoting-left.gif')">
</td>
<td width="100%" valign="top" bgcolor="#ffffff"></td>
<td width="10" style="background-image: url('{vb:stylevar imgdir_misc}/quotes/quoting-right.gif')">
</td>
</tr>
<tr>
<td width="10" style="background-image: url('{vb:stylevar imgdir_misc}/quotes/quot-left-bg.gif')">
</td>
<td width="100%" valign="top" bgcolor="#ffffff" class="smallfont">
<vb:if condition="$show['username']"><i>{vb:raw message}</i>
<vb:else />{vb:raw message}</vb:if></td>
<td width="10" style="background-image: url('{vb:stylevar imgdir_misc}/quotes/quot-right-bg.gif')">
</td>
</tr>
<tr>
<td width="10" valign="bottom">
<img src="{vb:stylevar imgdir_misc}/quotes/quot-bot-left.gif" alt /></td>
<td width="100%" style="background-image: url('{vb:stylevar imgdir_misc}/quotes/quot-bot-bg.gif')">
</td>
<td width="10" valign="bottom">
<img src="{vb:stylevar imgdir_misc}/quotes/quot-bot-right.gif" alt /></td>
</tr>
</table>
</td>
</tr>
</table>

Pandemikk
04-01-2012, 06:17 AM
Wow that's a lot of code to be asking for help with. ;)

You need to read up on some articles. Those tables and tds will need to be rewritten to divs as well.

Bulent Tekcan
04-01-2012, 06:36 AM
Wow that's a lot of code to be asking for help with. ;)

You need to read up on some articles. Those tables and tds will need to be rewritten to divs as well.

Can you help me ? Or please send to me articles link ? And also before I ask 1 code but nobody help me also :) Only said "look at articles" If I know reading articles I never ask about this.

Pandemikk
04-01-2012, 07:23 AM
There's articles to help you learn how to code yourself. Teach a man to code fishes. :D


vB4 Template Conditionals List (https://vborg.vbsupport.ru/showthread.php?t=231525)
https://vborg.vbsupport.ru/showthread.php?t=229194

Lynne
04-01-2012, 01:50 PM
Your phrase here:
<phrase 1="$username">{vb:rawphrase originally_posted_by_x}</phrase>

Should be:
{vb:rawphrase originally_posted_by_x, {vb:raw username}}