Announcement

Collapse
No announcement yet.

turn off adsense for certain usergroups?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • turn off adsense for certain usergroups?

    is there any way to setup a usergroup or a special skin that will not display the adsense ads for special members on vbulletin? I would like to set somehting up for the site donators, so they don't have to look at ads.

    thanks for any information or assistance in advance

  • #2
    First create a usergroup for people who donate, and set up the promotion in ACP. Then wrap the adsense code in this conditional:
    Code:
    <if condition="!is_member_of($bbuserinfo, n)">(adsense code)</if>
    Where n is the donator usergroup ID.

    What that conditional says is: "If the user is NOT a member of the donator usergroup, then display the adsense code".
    ~ Life isn't always fair, but you can be. ~

    Comment


    • #3
      thanks for the quick response.

      which file is the adsense code located at? I searched through the global.php file and couldn't find anything. forgive me if it sounds like an elementary question, I'm php retarded. html is about the extent of my coding experience.

      Comment


      • #4
        It maybe a template edit within these templates...
        A Quick Overview of the Ad Locations

        You can also search 'google' by using
        Admin CP > Styles & Templates > Search in Templates -> Search Templates -> Search for Text

        Another place would be a modification and you woould need to know what was added.

        Comment


        • #5
          hmm I changed that over with no luck. I created a user, moved him to the "donator" group and edited this from the "ad_navbar_below" section:

          Code:
          <if condition="!is_member_of($bbuserinfo, donator)">
          <if condition="$GLOBALS['vbulletin']->adsense_pub_id">
          <div style="width:728px; margin:0 auto; padding-bottom:1em">
          <script type="text/javascript"><!--
          google_ad_client = "{$GLOBALS['vbulletin']->adsense_pub_id}";
          google_ad_host = "{$GLOBALS['vbulletin']->adsense_host_id}";
          google_ad_width = 728;
          google_ad_height = 90;
          google_ad_format = "728x90_as";
          google_ad_type = "text_image";
          google_ad_channel = "";
          google_color_border = "$stylevar[alt2_bgcolor_hex]";
          google_color_bg = "$stylevar[alt1_bgcolor_hex]";
          google_color_link = "$stylevar[body_link_n_fgcolor_hex]";
          google_color_text = "$stylevar[body_fgcolor_hex]";
          google_color_url = "$stylevar[body_link_n_fgcolor_hex]";
          google_ui_features = "rc:6";
          //-->
          </script>
          <script type="text/javascript"
            src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
          </script>
          </div>
          </if>
          </if>
          red is what I inserted, with that, the ads still pop up for the donator usergroup

          Comment


          • #6
            You need to enter the usergroup ID of the donator group, not the name of the group. For instance, if the usergroup ID is 18, then put 18 where you have "donator".

            The clue was in my example, where I typed n. An italic n indicates a number, not a name.
            ~ Life isn't always fair, but you can be. ~

            Comment


            • #7
              works perfect thanks guys!

              Comment


              • #8
                Is there anyway to do this to a single member or multiple members by way of their userid?
                www.worldclassbodybuilding.com
                www.basskilleronline.com
                www.bodybuildingology.com

                Comment


                • #9
                  Originally posted by basskiller View Post
                  Is there anyway to do this to a single member or multiple members by way of their userid?
                  Yes, you can overload is_member_of() with multiple usergroups, such as:

                  Code:
                  <if condition="is_member_of($bbuserinfo, 1,2,3,4,5)"></if>
                  You can also do conditions like:

                  Code:
                  <if condition="in_array($bbuserinfo[userid], array(423,448,467))"></if>
                  Kyle Christensen
                  PbNation.com - one of the biggest and busiest vbulletin forums on the net!

                  Comment


                  • #10
                    why getting into coding? use a vb hack named YAAS
                    Mastiya

                    Comment

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