PDA

View Full Version : Profile Fields Privacy chosen by User on a per field basis.


GHC Webmaster
08-13-2008, 11:57 AM
Hello,

I know I can set custom profile fields to be hidden. But how would I go about allowing my users to set this for each field? For example a checkbox for each field which can set it to be a hidden field.

My own ideas about this (but if anyone has a totally different idea, let me know):

For each field I could add a second field, for example of the single selection radiobutton type. This allows users to select wheter the field should be hidden or not.

Then I would have to edit the memberinfo_profilefield template with a lot of conditionals (for each relevant field).

I don't have a lot of experience with conditionals, but what I created (which of course doesn't work) is this (field 4 is the field with info, field 32 the single selection radiobutton):
<if condition="$show['profilefield_edit']">
<dt class="shade" id="profilefield_title_$profilefield[profilefieldid]">$profilefield[title]</dt>
<dd id="profilefield_value_$profilefield[profilefieldid]">
$profilefield[value]
<script type="text/javascript">
<!--
vBulletin.register_control("vB_ProfilefieldEditor", "$profilefield[profilefieldid]");
//-->
</script>
</dd>
<else />
<if condition="$bbuserinfo['usergroupid'] == 6">
<dt class="shade">$profilefield[title]</dt>
<dd>$profilefield[value]</dd>
<else />
<if condition="$profilefield[profilefieldid] == 4 AND $profilefield32[value] == 1">&nbsp;
<else />
<dt class="shade">$profilefield[title]</dt>
<dd>$profilefield[value]</dd>
</if>
</if>
</if>

By the way: in the usergroup permission there is a setting (under general permissions): "Can View Private Custom Fields" How would I go about calling this in a conditonal? In other words how can I check whether the current user has this permission set to yes in one of his usergroups? I can't find anything in the memberinfo templates which checks this.

Thanks for any help.

Regards,

Walrick