Adsense by usergroup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • joe1989
    Senior Member
    • Apr 2008
    • 119
    • 4.0.0

    Adsense by usergroup

    I encourage members to donate to my site, and one of the incentives I'd like to have for donating is the removal of ads on the site (or reduced ads).

    I guess I would just create another usergroup, and then give that usergroup the option to remove ads...right?

    How could I go about doing this?
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 74161

    #2
    You would have to surround your advertising templates with template conditionals..

    <if condition="!is_member_of($bbuserinfo, X)">ad code here</if>

    X should be the usergroup ID of the paying group.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • joe1989
      Senior Member
      • Apr 2008
      • 119
      • 4.0.0

      #3
      That work with the new google adsense program integrated with 3.8?

      Comment

      • Wayne Luke
        vBulletin Technical Support Lead
        • Aug 2000
        • 74161

        #4
        You would have to edit the templates after deploying Adsense.

        The Google Ads get deployed to these templates: ad_footer_start, ad_navbar_below and ad_showthread_firstpost_start (high package only).
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment

        • Alien
          Senior Member
          • Jul 2000
          • 325

          #5
          Wayne: Will that code also work for secondary usergroups as well?
          -Jason / WTF.com

          "I think I've been quite clear that the new style will be in vB4." - Allen Lin / February 16, 2012

          Comment

          • Whitegnome
            New Member
            • Jul 2005
            • 21

            #6
            Originally posted by Wayne Luke
            You would have to surround your advertising templates with template conditionals..

            <if condition="!is_member_of($bbuserinfo, X)">ad code here</if>

            X should be the usergroup ID of the paying group.
            How would I go about using that for say two or three user groups that I don't want ads to show to but the rest do see them?

            Comment

            • Lats
              Senior Member
              • Mar 2002
              • 3671

              #7
              Code:
              !is_member_of($bbuserinfo, X,Y,Z)
              Lats...

              Comment

              • Whitegnome
                New Member
                • Jul 2005
                • 21

                #8
                Originally posted by Lats
                Code:
                !is_member_of($bbuserinfo, X,Y,Z)
                Thanks, I figured it out right after I posted my reply. One of those "Why didn't I try this before asking" moments.

                Comment

                • Alien
                  Senior Member
                  • Jul 2000
                  • 325

                  #9
                  Originally posted by Alien
                  Wayne: Will that code also work for secondary usergroups as well?
                  Anyone?
                  -Jason / WTF.com

                  "I think I've been quite clear that the new style will be in vB4." - Allen Lin / February 16, 2012

                  Comment

                  • Lats
                    Senior Member
                    • Mar 2002
                    • 3671

                    #10
                    Secondary groups would be...
                    Code:
                    ...
                    in_array($bbuserinfo[membergroupids], array(9,10,11))
                    ...
                    Lats...

                    Comment

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