1- In your AdminCP, select
User Profile Fields >> Add New User Profile Field. Choose
Single Selection Radio Buttons as the profile field type and hit Continue
2- Use these values in the following fields:
User Profile Field
Title: Display Subforums?
Description: Changing this option will show/hide the subforums on the main page.
Options: Yes, No (each option is on a different line!)
Set Default: Yes
Field Required: No
Field Editable By User: Yes
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No
Optional Input
Allow user to input their own value for this option: No
Display Page
Which page displays this option: Options: Thread Viewing
3- Hit Save, and youll be taken to the User Profile Field Manager. Take note of what the field ID for your new option is
In my case, its field7
4- Go to
Styles & Templates >> Style Manager and choose
Edit Templates on whatever forum style you want this to apply to.
5- In the Style Manager for your template, choose
PHP Include Code Templates >> phpinclude_start
6- At the very top of your template, paste the following code:
PHP Code:
if ($bbuserinfo['field7'] == 'No')
{
$vboptions['subforumdepth'] = 0;
}
Note that field7 needs to be replaced with whatever number your new User Profile Field Option is!
7- Click save, and youre done!
============================================
This template modification assumes that your subforum depth is set to 1 by default. If your subforums are set to 0, do the following:
1- Instead of:
in your User Profile Field Options, make it:
2- Use this bit of code in your phpinclude_start template instead of the one used above:
PHP Code:
if ($bbuserinfo['field7'] == 'Yes')
{
$vboptions['subforumdepth'] = 1;
}
Remember to replace field7 with whatever yours is!