View Full Version : Profile Field Conditionals
Sychev_S
01-29-2007, 11:57 PM
On my board field11 is Gender with three options Male, Female and Undisclosed.
How do I write a conditional so that when field11 equals to certain gender, certain text appears?
Thank you,
Adrian Schneider
01-29-2007, 11:59 PM
Where?
In the postbit: <if condition="$post['field11'] != 'Undisclosed'"><div>$post[field11]</div>
Profile: <if condition="$userinfo['field11'] != 'Undisclosed'">$userinfo[field11]
etc
Sychev_S
01-30-2007, 01:34 AM
sir adrian may be you can help me, what i am trying to code using vbulletin conditionals is female/male/online/offline status icon.
So far i came up with this code, but it doest seem to work. Any ideas?
<if condition="$post['field11'] != 'Male'">
<if condition="$onlinestatus==0">
<img src="http://www.site.com/forums/gender/sex_m.gif" border="0">
</if>
<if condition="$onlinestatus==1">
<img src="http://www..site.com/forums/gender/sex_m_on.gif" border="0">
</if>
</if>
<if condition="$post['field11'] != 'Female'">
<if condition="$onlinestatus==0">
<img src="http://www.site.com/forums/gender/sex_f.gif" border="0">
</if>
<if condition="$onlinestatus==1">
<img src="http://www.site.com/forums/gender/sex_f_on.gif" border="0">
</if>
</if>
Adrian Schneider
01-30-2007, 03:02 AM
Your logic doesn't make any sense to me.
!= means not equal to
Anyway, I would do it this way:
<img src="images/sex_<if condition="$post['field11'] == 'Female'">f<else />m</if><if condition="$onlinestatus == 1">_on</if>.gif" border="0" alt="" />May need to wrap the whole thing in another condition to see if they entered a gender or not... but that is easy.
Sychev_S
01-30-2007, 05:42 AM
nice, the only problem is when I put this into postbit_onlinestatus template it ignores field11 (gender) conditional and shows only one, wrong online/offline gender picture, and if I put it into postibit or posbit_legacy template it ignores onlinestatus conditional, showing the right gender but not showing online/offline.
Sychev_S
02-02-2007, 12:04 AM
anyone?
Sychev_S
02-03-2007, 08:24 PM
...help!
thincom2000
02-03-2007, 10:00 PM
I don't think postbit_onlinestatus knows what field11 is. You may need to do something else in addition to show custom fields in the postbits.
Sychev_S
02-03-2007, 10:08 PM
yeah it doesn't...is there anyway to integrate?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.