Hiding adsense ads from a certain usergroup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mholtum
    Senior Member
    • May 2004
    • 298
    • 3.5.x

    Hiding adsense ads from a certain usergroup

    Is there a way to hide the built in adsense placement in the header and footer from a certain usergroup?
    Home of the free, Because of the brave.
  • Trevor Hannant
    vBulletin Support
    • Aug 2002
    • 24183
    • 5.7.X

    #2
    If you edit the header/footer template and wrap the AdSense Code/template call in the following (change the usergroup number to the one you wish to hide it from):

    Code:
    [COLOR=#FF0000]
    <if condition=[COLOR=#0000FF]"$post['usergroupid'] != 6"[/COLOR]>[/COLOR][COLOR=#FF0000][I][COLOR=black]AdSense Template call[/COLOR][/I]</if>[/COLOR]
    Vote for:

    - Admin Settable Paid Subscription Reminder Timeframe (vB6)
    - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

    Comment

    • mholtum
      Senior Member
      • May 2004
      • 298
      • 3.5.x

      #3
      Thank you sounds easy enough.. Could you please post what code I should actually look for to wrap..
      Home of the free, Because of the brave.

      Comment

      • Trevor Hannant
        vBulletin Support
        • Aug 2002
        • 24183
        • 5.7.X

        #4
        That depends on how you're adding the AdSense code! Are you using the inbuilt Google AdSense integration?
        Vote for:

        - Admin Settable Paid Subscription Reminder Timeframe (vB6)
        - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

        Comment

        • mholtum
          Senior Member
          • May 2004
          • 298
          • 3.5.x

          #5
          Originally posted by mholtum
          Is there a way to hide the built in adsense placement in the header and footer from a certain usergroup?
          Yes...
          Home of the free, Because of the brave.

          Comment

          • Trevor Hannant
            vBulletin Support
            • Aug 2002
            • 24183
            • 5.7.X

            #6
            Sorry, long day....

            navbar template, change:

            Code:
            $ad_location[ad_navbar_below]
            to
            Code:
            [COLOR=#ff0000]
            [COLOR=black]<if condition=[/COLOR][COLOR=black]"$post['usergroupid'] != 6">[/COLOR][/COLOR][COLOR=black]$ad_location[ad_navbar_below][/COLOR][COLOR=black]</if>[/COLOR]
            For the footer, change:

            Code:
            $ad_location[ad_footer_start]
            to
            Code:
            [COLOR=#ff0000]
            [COLOR=black]<if condition=[/COLOR][COLOR=black]"$post['usergroupid'] != 6">[/COLOR][/COLOR][COLOR=black]$ad_location[ad_footer_start][/COLOR][COLOR=black]</if>[/COLOR]

            Obviously, as before, change the number to the usergroup you wish to hide these from.
            Vote for:

            - Admin Settable Paid Subscription Reminder Timeframe (vB6)
            - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

            Comment

            • mholtum
              Senior Member
              • May 2004
              • 298
              • 3.5.x

              #7
              Thank you so much.. I will implement this ASAP
              Home of the free, Because of the brave.

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...
              😀
              😂
              🥰
              😘
              🤢
              😎
              😞
              😡
              👍
              👎