![]() |
I need help showing and unshowing profile fields
I want to have an individual usergroup (usergroup 1) that would have a field option like "interests" for the individual's profile. Then I want to have a organization usergroup (usergroup 2), but they would not receive the "interests" field as an option for their profile because it would be irrelevant.
I have pieced together this php code, but i still cant get it to work. <vb:if condition="is_member_of($bbuserinfo) == 9?> {vb:raw userinfo.field6} </vb:if> <vb:else condition="is_member_of($bbuserinfo) != 9?> {unset($userinfo.field6)} </vb:if> I have tried it in two different templates. memberinfo_block_aboutme memberinfo_profilefield Can someone please help me out. All the research I have done seems more geared toward vb version 3 and does not work either. Such as: Restrict some profile fields to specific usergroup https://vborg.vbsupport.ru/showthread.php?t=244946 Any help is greatly appreciated! |
You're not using is_member_of() correctly
is_member_of($bbuserinfo, 9) or for several groups; is_member_of($bbuserinfo, array(4,5,6,7)) I'm not 100% sure you can use that function in a template conditional though Code:
941 // ############################################################################# |
$bbsuserinfo is a global template variable. I am not sure if it is populated with valid data to every template, but it is accessible. Function "is_member_of" is an already declared "safe function". So if you use Nerbert's example of how to use the function is_member_of correctly it should work.
I search my own templates and found I used it in showthread... Code:
<vb:if condition="is_member_of($bbuserinfo, array(2,18))"> OUTPUT: Code:
var_dump: $bbuserinfoarray(213) { ["userid"]=> string(2) "10" ["temp"]=> NULL ["field1"]=> string(0) "" ["field2"]=> string(0) "" ["field3"]=> string(0) "" ... |
Thank you both nerbert and tbworld for responding. I played around with what you gave me but it seems to be a little over my head. I think I am just going to have to post a paid service request.
|
All times are GMT. The time now is 11:53 PM. |
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:
|