Log in

View Full Version : IF Statement For IM Icons In Postbit


Masked Crusader
03-19-2007, 06:24 PM
Hey guys.

Here is what is going on. I made a template edit in which there is a table around the IM icons on the Postbit.

The problem is, when the user does not have any information in the IM slots in their profile, the table still appears in the postbit.

Look here for an example of what is going on: http://www.roninleague.com/showthread.php?t=1

Look under second post on the thread. See how it is just a table underneath the activity modification.

I need an IF statement so that the table only appears in the user has entered in IM information in their profile.

I do not know what the condition of the IF statement should be.

Any help would be appreciated.

Thanks in advance.

Kungfu
03-19-2007, 08:16 PM
<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>

this goes in postbit and postbit_legacy if you use it.

Masked Crusader
03-19-2007, 09:19 PM
<div class="pbitspacer"><div class="pbit" align="center">$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>

That is the code I have for the IM part of the postbit.

If you would read above, I stated that I had put a table around the icons. If those $post values do not pose true, then the table STILL appears.

I need an IF statement for the table.

HMBeaty
03-19-2007, 09:22 PM
Its not an <if> conditional you should be using. If I understand what you are needing done, you need to use <else />

Masked Crusader
03-19-2007, 09:46 PM
How can I use an <else /> statement without an <if> statement...they are layered programming commands.

Seems like I should just not put a table there...lol

Kungfu
03-20-2007, 12:46 AM
<if condition="$post[aimicon]">table blah blah $post[aimicon] end table</if>

TheMilkCarton
03-20-2007, 02:53 PM
But then the table won't show if there is no AIM info.

You'd have to do <if condition="$post[icqicon] OR $post[aimicon] OR $post[msnicon] OR $post[yahooicon] OR $post[skypeicon]"><div class="pbitspacer"><div class="pbit" align="center">$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div></div></if>

And shane.... that code you posted. Where's the 2nd "</div>"? :)

Raptor
03-08-2013, 07:44 AM
anyway to get this working with vb4.20 ?

I tried the below code and it wont allow to save due to an error

<if condition="{vb:raw post.icqicon} OR {vb:raw post.aimicon} OR {vb:raw post.msnicon} OR {vb:raw post.yahooicon} OR {vb:raw post.skypeicon}">
<div class="imlinks">
<div class="post_field">
{vb:raw post.icqicon} {vb:raw post.aimicon} {vb:raw post.msnicon} {vb:raw post.yahooicon} {vb:raw post.skypeicon}
</div></div></if>

squidsk
03-08-2013, 02:49 PM
In vb4 its now <vb:if>...</vb:if> and you can't use the {vb: . . . } notation in conditions, you'd need to use $post['icqicon'] etc.