PDA

View Full Version : Custom Field - UserGroup Specific


Stilgar
08-04-2008, 04:27 PM
Hello,

I have added a Custom Field to my Links entries. I would like to allow and disallow this Field on a UserGroup basis.

How would I accomplish this?

Thanks!

Brian
08-05-2008, 05:22 PM
Are you trying to allow/disallow groups from viewing the value for that custom field, or are you trying to only let certain groups enter data for that custom field when submitting links?

Our Sponsors
 

Stilgar
08-05-2008, 06:15 PM
I am trying to only let certain groups enter data for the custom field when submitting links.

Thanks!

Brian
08-06-2008, 01:56 PM
The easiest way would probably be to add a new plugin to the 'vba_links_addlink_start' hook location with code that looks something like this:
if (!is_member_of($vbulletin->userinfo, array(X, Y, Z)))
{
unset(
$vbulletin->adv_links_cfield['1'],
$vbulletin->adv_links_cfield['2'],
$vbulletin->adv_links_cfield['3']
);
}

Replace X, Y, Z on the first line of code there with the usergroupids that you want to allow the custom fields for. Then replace the numbers 1, 2, 3 in the lines below with the customfieldids of the custom fields you want to hide from other groups.

Our Sponsors
 

Stilgar
08-08-2008, 12:56 PM
Thank you, Brian. I'll try it out today.