PDA

View Full Version : Help with conditionals


iow_bg
11-18-2009, 10:34 PM
I am trying to make weather page based upon members profile information... This is the coding I have for VB3.... What do my conditionals need to be? I've read the articles on the new vb:raw and vb:if but I cannot get the information to display right.

Any help would be appreciated!!

My current vb3 coding:
<if condition="!$bbuserinfo['userid']">
<span class="weather">Registered members can see their local weather forecast here.<phrase
1="$vboptions[bburl]">$vbphrase[not_a_member_yet_register_now]</phrase></span>
<else />
<if condition="$bbuserinfo[field12] !=''">

<div>
<div style='width: 630px; height: 440px; background-image: url( http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/silver_630x440_bg.jpg ); background-repeat: no-repeat; background-color: #86888B;' ><div style='height: 420px;' ><script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2.asp?partner=netweather&tStyle=whteYell&logo=0&zipcode=$bbuserinfo[field12]&lang=eng&size=14&theme=silver&metric=0&target=_self'></script></div>
</div>

<else />Add your <A HREF="$vboptions[bburl]/profile.php?do=editprofile">Zip Code</A> to show weather forecast.
</if>
</if>

ForumsMods
11-18-2009, 10:47 PM
<vb:if condition="!$bbuserinfo['userid']">
<span class="weather">Registered members can see their local weather forecast here.{vb:rawphrase not_a_member_yet_register_now, vboptions.bburl}</span>
<vb:elseif condition="$bbuserinfo['field12'] != ''" />
<div>
<div style="width: 630px; height: 440px; background-image: url(http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/silver_630x440_bg.jpg); background-repeat: no-repeat; background-color: #86888B;">
<div style="height: 420px;">
<script src="http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2.asp?partner=netweather&amp;tStyle=whteYel l&amp;logo=0&amp;zipcode={vb:raw bbuserinfo.field12}&amp;lang=eng&amp;size=14&amp;theme=silver&amp; metric=0&amp;target=_self"></script>
</div>
</div>
<vb:else />
Add your <a href="{vb:raw vboptions.bburl}/profile.php?{vb:raw session.sessionurl}do=editprofile">Zip Code</a> to show weather forecast.
</vb:if>

Paul M
11-18-2009, 10:48 PM
Conditionals are pretty much unchanged, you just need to add the vb: to the <if>, </if> and </else> (e.g. <vb:if>)

Edit: As shown in the example above. :)

iow_bg
11-18-2009, 10:52 PM
Thanks guys!! I really appreciate the help.

kall
11-20-2009, 07:04 AM
Thanks guys!! I really appreciate the help.
Ditto.

Conditionals are pretty much unchanged, you just need to add the vb: to the <if>, </if> and </else> (e.g. <vb:if>)
That statement right there, saved me a lot of time. :D