Log in

View Full Version : Postbit Editting


TurkeySub
08-05-2009, 12:31 PM
Hi Guys,

I am setting up this: https://vborg.vbsupport.ru/showthread.php?t=170238&highlight=postbit*

The trouble I have run into, is I would also like to have it around the ICQ, MSN, etc icons, however not everyone with have them.

So I am looking for a way to only show the div when they actually have one of the above on their account, that way I dont end up with a box with nothing in it.

Current code:
$template_hook[postbit_userinfo_right]
<div class="postinfo">$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
</div>

I assume I am going to need a if statement, however that is the extent of my cosing knowledge, so any ideas?

THANKS!

Marco van Herwaarden
08-05-2009, 12:46 PM
If you have questions/problems with a modification or style, then please post in the thread (or support forum/board) about that modification/style. Best chance to receive a reply from either the author or another member using the same modification/style.

TurkeySub
08-05-2009, 01:12 PM
If you have questions/problems with a modification or style, then please post in the thread (or support forum/board) about that modification/style. Best chance to receive a reply from either the author or another member using the same modification/style.

Its not a problem with a MOD or Style, it is a question on how I would create the if statement. The mod does not address this as they do not involve it.

Thanks!

Lynne
08-05-2009, 02:30 PM
Something like this should work (not tested):
<if condition="$post[icqicon] OR $post[aimicon] OR $post[msnicon] OR $post[yahooicon] OR $post[skypeicon]">
<div class="postinfo">$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
</if>

TurkeySub
08-05-2009, 04:06 PM
Something like this should work (not tested):
<if condition="$post[icqicon] OR $post[aimicon] OR $post[msnicon] OR $post[yahooicon] OR $post[skypeicon]">
<div class="postinfo">$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
</if>

That ended up throwing syntax error, thanks though!

Lynne
08-05-2009, 04:15 PM
You may have to put single quotes around the variables in the condition, ie $post['icqicon'], or if you have a condition above that one, you may have to combine them.

TurkeySub
08-05-2009, 04:34 PM
You may have to put single quotes around the variables in the condition, ie $post['icqicon'], or if you have a condition above that one, you may have to combine them.

Thanks, I ended up with:
<if condition="'$post[icqicon]' OR '$post[aimicon]' OR '$post[msnicon]' OR '$post[yahooicon]' OR '$post[skypeicon]'">
<center><div class="postinfo">$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div></center>
</if>
Only problem is, the div is still being read even when none of the tested variables is present.

Lynne
08-05-2009, 04:53 PM
If the div is still being read, then the condition is not working. Did you try what I suggested?