Back to vBulletin 3.7 Template Modifications

Hide VBA Columns in UserCP
Mod Version: .5, by Crimm

This modification is in the archives.
vB Version: 3.7.0 RC 3 Rating: (2 votes - 5.00 average) Installs: 5
Released: 05 Nov 2008 Last Update: Never Downloads: 0
Not Supported Template Edits Re-usable Code  

Description: Do you have users on your VBA site that don't like the left/right columns? I recently setup a site for some friends that did. Playing around I figured out how to add an option in the UserCP to allow the users to Hide the Columns from their view. I thought I would share with everyone. If this is done somewhere else ... I apologize. I did some searching, but I didn't see anything like this

Difficulty: 3/10 This is pretty easy, but you will be making template changes, so make sure you backup your site or do it on a test site. I won't be held responsible for any damage that occurs.

Support: I'm around the boards, but really busy. I'll support the best I can

Required:
- http://www.vbadvanced.com/products.php?do=productinfo&productid=4
- vBulltin

Installation Instructions:
This is more of a set of Template Modifications. I tried to make it a product, but I'm having trouble figuring out the Product system. I'm still reading all those documents.

NOTE: I'm writing this as if you have both columns enabled. If you do not have both columns enabled then you can skip that column's steps.

Step 1: You need to create your user options field by going to your Admin CP -> Dropping down User Profile Field and Click User Profile Field Manager as seen here:



Or you can do this:

http://www.yoursite.com/forum/admincp/profilefield.php?do=modify

Step 2: We need to add the User Profile field. Click the Add User Profile Field on the left hand side in the User Profile Field Menu.

Step 3: For the Profile Field Type Choose Single Selection Radio Buttons.

Step 4: Click Continue

Step 5: Fill out the boxes like this:

- Title: Hide Left Column
- Description: Hiding the Left Column of vBadvanced
- Category is up to you.
- Items per line: 0
- Options:
No
Yes
- Set Default: Yes
- Field Required: No
- Private: No
- Searchable: No
- Show on Member's List: No
- Allow User Input: No
- Display Page: Options: Other

Step 6: Click Save

Step 7: Let's do it again for the Right Column if you have one. Click Add again on the left hand side.

Step 8: For the Profile Field Type Choose Single Selection Radio Buttons.

Step 9: Click Continue

Step 10: Fill out the boxes like this:

- Title: Hide Right Column
- Description: Hiding the Left Column of vBadvanced
- Category is up to you.
- Items per line: 0
- Options:
No
Yes
- Set Default: Yes
- Field Required: No
- Private: No
- Searchable: No
- Show on Member's List: No
- Allow User Input: No
- Display Page: Options: Other

Step 11: Click Save

Now both our options are created for our users to select.

Let's look back at or fields that we created. Click User Profile Field Manager on the left hand side again to see this:



You can see our two newly created fields. See the numbers in the Name Column?

They say: field6 and field13. These will differ on your site from mine, so write them down... you will need them. 6 for the left in this example, and 13 for the right in this example.

Now we can move into the template modification.

Step 12: Go into your Style Manager by entering the Admin CP and clicking the Styles and Templates Menu.

Step 13: Edit the Templates of your style you want to this for by click Edit Templates in the drop down like this:



Step 14: Under the "vBadvanced CMPS Templates" you will see "adv_portal" - Customize it.

Step 15:
Find:

Code:
<if condition="$show['left_column']">
			<td width="$vba_style[portal_leftcolwidth]"<if condition="$show['center_column'] OR $show['right_column']"> style="padding-$stylevar[right]: $vba_style[portal_colspacing]px"</if>>
				$home[leftblocks]
			</td>
		</if>
and Replace it with:

Code:
<if condition="$bbuserinfo['fieldX']== 'No' OR $bbuserinfo['fieldX']== ''">
		<if condition="$show['left_column']">
			<td width="$vba_style[portal_leftcolwidth]"<if condition="$show['center_column'] OR $show['right_column']"> style="padding-$stylevar[right]: $vba_style[portal_colspacing]px"</if>>
				$home[leftblocks]
			</td>
		</if>
</if>
Don't forget to change the X above with the number of your newly created profile field. Mine was 6 in the example above. See this screenshot again:



Make sure to use which ever one is used on your site for Hide Left Column.

Step 16:
Find:
Code:
<if condition="$show['right_column']">
			<td valign="top" width="$vba_style[portal_rightcolwidth]"<if condition="$show['center_column'] OR $show['left_column']"> style="padding-$stylevar[left]: $vba_style[portal_colspacing]px"</if>>
				$home[rightblocks]
			</td>
		</if>
and Replace with:

Code:
<if condition="$bbuserinfo['fieldX']== 'No' OR $bbuserinfo['fieldX']== ''">
		<if condition="$show['right_column']">
			<td valign="top" width="$vba_style[portal_rightcolwidth]"<if condition="$show['center_column'] OR $show['left_column']"> style="padding-$stylevar[left]: $vba_style[portal_colspacing]px"</if>>
				$home[rightblocks]
			</td>
		</if>
</if>
Don't forget to change the X above with the number of your newly created profile field. Mine was 13 in the example above. See this screenshot again:



Make sure to use which ever one is used on your site for Hide Right Column.

Now once you make sure you change out the X's for numbers you can hit save.

Step 17: Now you can tell your users to go to their User CP. Click Edit Options. Scroll to the bottom and they will see an option to hide the left/right column. Or you can just give them the link to the options: http://www.yoursite.com/forum/profile.php?do=editoptions

I guess that's it. See that was simple wasn't it? I probably made it seem daunting, but I wanted to be as detailed as possible. I have been playing around with vBulletin for a few years now, but never tried to release anything here... I thought I could try for the first time. Please be gentle with your criticism If you like it let me know and maybe I'll spend some time putting down other things that I have found.

Download

No files for download.

Screenshots

Click image for larger version
Name:	Step1.jpg
Views:	292
Size:	40.5 KB
ID:	89010   Click image for larger version
Name:	Step2.jpg
Views:	545
Size:	37.8 KB
ID:	89011   Click image for larger version
Name:	Step3.jpg
Views:	294
Size:	62.2 KB
ID:	89012  

Similar Mods

End-User Options Change your UserCP Navbar with the New UserCP Dropdown Menu! vBulletin 3.7 Add-ons
End-User Options GTUserCP - Enhanced USERCP Interface + USERCP Menu vBulletin 3.6 Template Modifications

vblts.ru supports vBulletin®, 2022-2024