Details Share Print Rate Report
Required fields for particular usergroup
Required fields for particular usergroup
08/10/06 (Edited 02/02/14)

Note: This is an advanced task involving some simple programming.

Sometimes, you may want members in a particular usergroup to be required to fill in different fields than the rest of the members. To do this, create a file named requiredchanges.php and save it to your /modifications/ subdirectory (if /modifications/ doesn't exist yet, create it). Here's sample content you can use for the file:

if (currenturlcontains('register.php') &amp;&amp; $_REQUEST['filled'] &amp;&amp; $_REQUEST['usergroup'] == 4) $settings->requiredmembers = 'name,password,email';
else if (currenturlcontains('suggest.php?action=addlink') &amp;&amp; $thismember->usergroup == 4) $settings->requiredlinks = 'title,description';
else if (currenturlcontains('suggest.php?action=addcat') &amp;&amp; $thismember->usergroup == 4) $settings->requiredcategories = 'name,description';

The first line requires name, password and email for usergroup #4 on the registration page. The second line requires title and description for listing submitters in usergroup #4 on the submit listing page. The third line requires the name and description fields for group #4 on the submit category page. Change the fields as appropriate to your purpose. Note that this overrides (removes) all previous required fields so you need to add everything to your list even if it's already required for everyone else.

Make sure you don't have any spaces or line breaks before the <?php or after the ?> as that will break cookies.

Description Setting different required fields for a particular usergroup compared to others.
Views 572 views. Averaging 0 views per day.

Previous Article | Next Article