View Full Version : Conditional Profile Field Status and Notices
richardevans123
02-06-2013, 07:10 PM
Hey Guys,
I have got a Custom Profile Field and it acts like a status. Similar to Online and Offline, but Active or Non-Active.
What I'd like to do is when a User Selects the "Non-Active" option, a Notice appears saying that the status is "Non-Active" please change to Active.
What coding do I need to do this?
Thanks
LifesGreatestGift
02-07-2013, 03:25 PM
depends what template you want to put it in. But I would imagine something like this
OPTIONS FOR DROPDOWN
Non-Active [has an id of 0]
Active [has an id of 1]
<vb:if condition="$bbuserinfo['field#'] == 0">
<p style="margin:15px 0;padding:8px;background:#ff0000;color:#333;">Please change to active!</p>
</vb:if>
Where # is your field id, and 0 is the id of the non-active selection.
richardevans123
02-07-2013, 03:53 PM
Okay, the coding is right, but changing the "0" and "1" isn't actually changing anything. I'm working on 4.2.0 PL3 if that helps
LifesGreatestGift
02-07-2013, 04:01 PM
i see no custom dropdown profile field on your site.
--------------- Added 1360256533 at 1360256533 ---------------
try == '1' instead of == 1
--------------- Added 1360257340 at 1360257340 ---------------
<vb:if condition="$bbuserinfo['field11'] == 'Off Active Duty'">
<p style="margin:15px 0;padding:8px;background:#ff0000;color:#333;">Please change to active!</p>
</vb:if>
Try that.
--------------- Added 1360257519 at 1360257519 ---------------
If that doesnt work then try
"Second Option Selected"
<vb:if condition="$bbuserinfo[field11] & 2"><p>STUFF</p></vb:if>
dont remember exactly but it could be either [field11] or ['field11'] try both. :)
richardevans123
02-07-2013, 04:23 PM
It's done via radio buttons. And neither of those codes work. :/
LifesGreatestGift
02-07-2013, 04:27 PM
What template are you posting these in? header/navbar?
richardevans123
02-07-2013, 04:31 PM
I'm doing it via a notice
LifesGreatestGift
02-07-2013, 04:43 PM
May be a bug as
<vb:if condition="$bbuserinfo['field11'] == 'Off Active Duty'">STUFF</vb:if>
should work.
richardevans123
02-07-2013, 04:47 PM
Got it to work! :D
LifesGreatestGift
02-07-2013, 04:48 PM
try using a dropdown single-selection and these conditionals. may just be with radio button.
--------------- Added 1360259313 at 1360259313 ---------------
What was the code that worked? I am curious.
richardevans123
02-07-2013, 04:56 PM
<vb:if condition="$bbuserinfo['field11'] == 'Off Active Duty'">STUFF</vb:if>
That one!
Thanks for your help
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.