Version: 1.00, by Brent H
Developer Last Online: Feb 2008
Version: 3.0.7
Rating:
Released: 07-23-2005
Last Update: Never
Installs: 1
Template Edits
No support by the author.
I help run a forum that has a lot of sub forums, and since they're displayed on the main page they take up quite a bit of screen space. In order to save me a bit of scrolling, I popped this little option in to the User CP and everyone seems to think it's great.
What this does is allow users to choose whether or not sub forums get displayed on the main page of the forum. Pretty useful if you have people who like having everything on one page, and people who think less is more and prefer a cleaner main page.
Here's how to do it:
Quote:
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:
Quote:
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 you?ll be taken to the User Profile Field Manager. Take note of what the field ID for your new option is? In my case, it?s ?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 you?re 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:
Quote:
Yes
No
in your User Profile Field Options, make it:
Quote:
No
Yes
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!
Not hard at all Enjoy!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.