PDA

View Full Version : if/else not working properly in templates


foler
12-07-2008, 10:43 PM
I'm using vB 3.7.3 PL1. The template in question is "bbcode_code".

I want to block guest from viewing text inside CODE tags. This is what I've done:


<if condition="$show['member']">
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">$vbphrase[code]:</div>
<pre class="alt2" dir="ltr" style="
margin: 0px;
padding: $stylevar[cellpadding]px;
border: 1px inset;
width: $stylevar[codeblockwidth];
height: {$blockheight}px;
text-align: left;
overflow: auto">$code</pre>
</div>
<else />
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">$vbphrase[code]:</div>
<pre class="alt2" dir="ltr" style="
margin: 0px;
padding: $stylevar[cellpadding]px;
border: 1px inset;
width: $stylevar[codeblockwidth];
height: {$blockheight}px;
text-align: left;
overflow: auto">You must be logged in to view this content.</pre>
</div>
</if>



I open the post in Google Chrome where I'm logged in, and another instance in IE where I'm not and I'm able to see code in both browsers :mad:

What am I doing wrong?

Thanks in advance.

SEOvB
12-07-2008, 10:51 PM
bbCode templates don't parse if conditions.

foler
12-07-2008, 11:06 PM
bbCode templates don't parse if conditions.

Is there any other way to achieve what I need?

SEOvB
12-08-2008, 10:50 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=105160" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=105160</a>