View Full Version : HOW DO I: "hide" a field from all except a certain usergroup?
ataraxia
10-22-2004, 11:45 AM
Is there a way to, say, modify the SHOWLINK or other templates so that only members of a specific user group can see a particular Links or Custom field? If so, how?
I am wondering if you could use some logic something like this: "IF user's usergroup = Moderator OR usergroup = Administrator THEN display the field ELSE do not display the field". How would you code that?
Thanks
Brian
10-22-2004, 05:44 PM
Edit your 'adv_links_showlink_custombits' and change it to something like this:
<if condition="!is_member_of($bbuserinfo, X) AND $field['fieldid'] == Y">
<else />
<tr class="$bgclass">
<td>$field[title]:</td>
<td>$field[value]</td>
</tr>
</if>
(Replace X with the usergroupid, and Y with the fieldid)
Haven't tested that, but it should work. :)
ataraxia
10-22-2004, 06:04 PM
Hey! It works!!!! :)
Note the Brian refers to X and Y as the ID numbers above, not the names.
You can find the ID number for the Usergroup by going to AdminCP-->UserGroups-->UserGroup manager. It is displayed there. The custom field ID# is found by going to AdminCp --> VB Links Directory--> Custom fields --> then rightclicking on the "Edit" link for the custom field in question to load it into a new browser window. You will find the fieldID# in the URL. (There is probably a more direct way to do this!)
This appears to be a fairly simple way to "hide" a custom field!
Thanks, Brian! :-)
Damas
10-27-2004, 08:42 PM
very Good idea
But How i can find field id of this one
in links/showlink.php
View Link Details >> URL: http://xxxxx.com/xxxx.rar
I do not want all usergroup to see orignal links
any help please
ataraxia
10-28-2004, 03:07 PM
You can find the ID #'s for user groups by going to your UserGroup Manager and looking in the little dropdown menu to the right of the group name you want. You'll see it says "Edit usergroup (ID:x)". "x" is the # you want.
Damas
10-28-2004, 04:52 PM
I find usergroup id
But How to find field id ??
Brian
10-28-2004, 06:29 PM
Admin CP => vBa Links Directory => Custom Fields
Hold your mouse over the [Edit] link and you will see the field id for that field at the end of the link in your browser's status bar.
Damas
10-29-2004, 04:11 PM
Tanks for reply
But i mean that field in attchments
Its not in Custom Fields
Brian
10-29-2004, 04:16 PM
Edit your 'ADV_LINKS_SHOWLINK' template and add a condition around that table row.
Damas
10-29-2004, 05:21 PM
I am sorry brian
I try but no chance
Please can you add that condition for template "ADV_LINKS_SHOWLINK" attatched
usergroup ID is 58
Thanks
rascal
12-24-2004, 11:11 AM
Any clues on how to add second custom field which is only viewable by certain usergroup.
Tried adding the code below but came out with an error. Any assistance appreciated.
<if condition="!is_member_of($bbuserinfo, 6) AND $field['fieldid'] == 3">
<if condition="!is_member_of($bbuserinfo, 6) AND $field['fieldid'] == 4">
<else />
<tr class="$bgclass">
<td>$field[title]:</td>
<td>$field[value]</td>
</tr>
</if>
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.