How to make the display of something a user option

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rob B
    Senior Member
    • Dec 2005
    • 311
    • 3.6.x

    How to make the display of something a user option

    There may be certain things on your forum that you have either added through hacks etc. or that are existing vBulletin features that some of your users may not use or whatever and you may want to give them the option to hide that item.

    An example use would be the pre-defined avatars list, this slows down loading times on the 'Edit Avatar' page and if one of your users only uses custom avatars, it may be good to give them the option of hiding the predefined avatars list so they don't have to load it.

    -----------------------------

    New Profile Field > Single Selection Menu
    Options:
    Display
    Hide
    Set Default: Yes, but no blank option.
    Private: Yes
    Optional Input: No
    All the options I have not specified settings for are your preference. Make a note of the profile field ID.

    Open the template containing the bit you want to make an option to hide.Find the bit you want to hide and wrap it in this conditional:

    Code:
    <if condition="$vbulletin->userinfo['field[COLOR=Red]x[/COLOR]'] == 'Display'">
    
    [COLOR=Blue]i want to let users hide this[/COLOR]
    
    </if>


    with x being the profile field ID.

    If you want something to be displayed whilst the object is hidden, you could do this:

    Code:
    <if condition="$vbulletin->userinfo['field[COLOR=Red]x[/COLOR]'] == 'Hide'">
    
    [COLOR=Blue]this object is hidden, adjust your options to display it in future.[/COLOR]
    
    <else />
    
    [COLOR=Blue]the hidden object[/COLOR]
    
    </if>
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...