Profile Field Conditional

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DarkWarriorXII
    New Member
    • Nov 2004
    • 12
    • 3.7.x

    Profile Field Conditional

    I have adsense ads on my forums displayed to guests only. However, I have received a request from a member who would like to view the ads when logged in as a member because he finds they are helpful sometimes.

    To try to accomodate his request, I added a profile field where a member can select Yes or No to display the ads. No matter what I try though, I can't get the ads (separate from the guest only ads) to show if Yes is selected.

    Here are the different things I have tried:

    PHP Code:
    <if condition="$vbulletin->userinfo['field14'] == 'Yes'"
    PHP Code:
    <if condition="$bbuserinfo['field14'] == 'Yes'"
    PHP Code:
    <if condition="($bbuserinfo['field14'] == "Yes")"
    I have also tried the above combinations without the single quotes around field14.

    How would I form the conditional to show the ads if the user selects Yes? Any help would be appreciated!
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    Try:

    HTML Code:
     <if condition="$vbulletin->userinfo[field14] == 'Yes'">

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools &lt;- awesome site for html/css help

    Comment

    • Nick
      Senior Member
      • Feb 2008
      • 3507
      • 3.8.x

      #3
      I have a similar setup on my forum but it is an option if members want to have posts from the Games section show up in New Posts.

      I couldn't find the appropriate conditional for a Yes/No radio button, so I just created a checkbox: "Check this if you do not want games to be displayed in New Posts".

      And this is the conditional I use:
      Code:
      <if condition="$vbulletin->userinfo['field15'] == '1'">
      A value of 1 means the box is ticked.

      So if you're willing to settle for a checkbox rather than radio buttons, then you can use this

      However if you find out the appropriate conditional for radio buttons, I'd be very interested in knowing
      Regards,
      Nick

      Comment

      • DarkWarriorXII
        New Member
        • Nov 2004
        • 12
        • 3.7.x

        #4
        I got it working. Thanks.

        Comment

        • Nick
          Senior Member
          • Feb 2008
          • 3507
          • 3.8.x

          #5
          Lynne, I didn't see your response -- you replied while I was still typing my response.

          Thanks for posting that.
          Regards,
          Nick

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...