![]() |
OR condition in VB
I did a postbit_legacy change this morning to recreate member social networking and related hobby site accounts to their profile on my site.
In this, I added "Find me on:" which will then show all of the social accounts However, I don't want the "Find me on:" to appear if they choose to not provide anything. SO, I did add the following, and tied it to one of the profile fields used for this Code:
<vb:if condition="$post['field32']"> https://www.sportscardforum.com/atta...0&d=1518271792 The problem is if they dont link their Twitter account (Field32 on my site), the verbiage does not appear Thus, my thinking on using an OR condition with the fields, but I am not 100% sure if I can array this in the following manner Code:
<vb:if condition="in_array($post['field'], array(32,X,Y))"> |
So you want to check if field32 is filled in or not?
Simply use <vb:if condition="!empty($post['field32'])">not empty</vb:if> |
I have at this point 10 fields that I would want to do this same check for... though in thinking about this, it might be best to only tie this to a single field or 2.
|
You'd have to use the !empty check for each one of those individually in order to do what you want. The in_array function you showed in your example checks if $post['field'][32] exists which makes no sense so that cannot be used.
|
Thanks Dave - i figured the array was not the correct method for this.
|
All times are GMT. The time now is 09:21 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|