Google ads, how do I make them disappear for..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Allen Mead
    Member
    • Jul 2004
    • 54
    • 3.0.9

    Google ads, how do I make them disappear for..

    particular types of member / user?
  • Mazinger
    Senior Member
    • Jul 2005
    • 2399
    • 3.7.x

    #2
    Use this variable for groups:

    <if condition="$bbuserinfo['usergroupid'] ==6">TEXT</if>

    * Change the blue areas.
    $post[signature]

    Comment

    • Allen Mead
      Member
      • Jul 2004
      • 54
      • 3.0.9

      #3
      Hi Mazinger, thanks for the reply.

      I have copied my code below but I can still see the ad. (we do have a usergroup id of 6)

      <if condition="$bbuserinfo['usergroupid'] ==6"><div align="center">
      <script type="text/javascript"><!--
      google_ad_client = "pub-3363499795400448";
      google_ad_width = 468;
      google_ad_height = 60;
      google_ad_format = "468x60_as";
      google_ad_type = "image";
      //2007-04-16: sport, play, canon, eos
      google_ad_channel = "0707114293+1100394895+3516999069+4334477588";
      //-->
      </script>
      <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
      </script>
      </div></if>
      <table><tr><td>&nbsp;</td></tr></table>

      Comment

      • Mazinger
        Senior Member
        • Jul 2005
        • 2399
        • 3.7.x

        #4
        The id '6' is for the Administrators usergroup, if you want it to be for Registered Users usergroup, use 2.

        Also, put the </if> code in the end, after </td></tr></table>.
        $post[signature]

        Comment

        • Allen Mead
          Member
          • Jul 2004
          • 54
          • 3.0.9

          #5
          Cool, I got now, thanks! How do i do it if I want more than 1 usergroup?

          Comment

          • Reeve of Shinra
            Senior Member
            • Sep 2001
            • 4325
            • 4.0.0

            #6
            I think this is it:

            HTML Code:
            <if condition="$bbuserinfo['usergroupid'] == in_array(6,7,8,9,10)">
            You may also want to look at the "!$bbuserinfo" ... the "!" acts as NOT.
            Plan, Do, Check, Act!

            Comment

            • Mazinger
              Senior Member
              • Jul 2005
              • 2399
              • 3.7.x

              #7
              So, will it be like this?

              HTML Code:
              <if condition="$bbuserinfo['usergroupid'] == 1,2,3">
              $post[signature]

              Comment

              • Floris
                Senior Member
                • Dec 2001
                • 37767

                #8
                No, that won't work.

                Comment

                • Allen Mead
                  Member
                  • Jul 2004
                  • 54
                  • 3.0.9

                  #9
                  So, can I just confirm that if I want usergroup with id 2 (example)

                  to not be able to view my adverts, then I need to wrap the ad text like so;

                  PHP Code:
                  <if condition="!$bbuserinfo['usergroupid'] ==2">
                   
                  advert text here
                   
                  </div
                  giving;

                  PHP Code:
                  <if condition="!$bbuserinfo['usergroupid'] ==2"><div align="center">
                  <
                  script type="text/javascript"><!--
                  google_ad_client "pub-3363499795400448";
                  google_ad_width 468;
                  google_ad_height 60;
                  google_ad_format "468x60_as";
                  google_ad_type "image";
                  //2007-04-16: sport, play, canon, eos
                  google_ad_channel "0707114293+1100394895+3516999069+4334477588";
                  //-->
                  </script>
                  <
                  script type="text/javascript"
                    
                  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                  </
                  script>
                  </
                  div>
                  <
                  table><tr><td>&nbsp;</td></tr></table>
                  <
                  div align="center">
                          <
                  div class="smallfont" align="center">To remove these advertsbecome a Premium MemberClick here for more info.</div></if> 
                  Just asking as my ad disappears completely now?!?

                  Comment

                  • Mazinger
                    Senior Member
                    • Jul 2005
                    • 2399
                    • 3.7.x

                    #10
                    That could have disappeared because you're probaply in usergroup 6 - the ad will appear for usergroup 2.

                    hint: add the tag </if> to the end of the first code. The second code is fine.
                    $post[signature]

                    Comment

                    • Allen Mead
                      Member
                      • Jul 2004
                      • 54
                      • 3.0.9

                      #11
                      Originally posted by Mazinger
                      That could have disappeared because you're probaply in usergroup 6 - the ad will appear for usergroup 2.

                      hint: add the tag </if> to the end of the first code. The second code is fine.

                      Doh! Ok, no probs.

                      Comment

                      • Allen Mead
                        Member
                        • Jul 2004
                        • 54
                        • 3.0.9

                        #12
                        I've gotta be doing something wrong as it doesn't matter if I clear my cookies or whatever, the ad just disappears for all user groups?!?

                        Comment

                        • Floris
                          Senior Member
                          • Dec 2001
                          • 37767

                          #13
                          You are using !$bbuserinfo and then later ==

                          this is why it won't work.

                          <if condition="$bbuserinfo['usergroupid'] == '2'">
                          You see this, because you're a member from usergroup ID 2, and browsing this page - nobody else can see this text, because they're not specifically in usergroup 2
                          </if>

                          <if condition="$bbuserinfo['usergroupid'] != '2'">
                          You see this, because you're NOT a member from usergroup ID 2, and browsing this page. So everybody can see this, except when specifically in usergroup 2.
                          </if>

                          Comment

                          • Allen Mead
                            Member
                            • Jul 2004
                            • 54
                            • 3.0.9

                            #14
                            Thanks very much Floris, very much appreciated !!!!!

                            Comment

                            • Allen Mead
                              Member
                              • Jul 2004
                              • 54
                              • 3.0.9

                              #15
                              This is an interesting one. I am using the following code for my ads which works great, they disappear when the particular member id usergroup sign in. However, If I have the usergroup tags wrapped around the google ads in the footer only, the forum behave's itself (can still have the adsense code in other templates without the usergroup bit). If I add the usergroup code around the adsense code and add it to formdisplay navbar etc etc, it affects the way the forumboard displays and I don't know how to correct it. I can see that it's something to do with "center" on the adsense code, but I thought that it was contained to just the adsense. Any help would be much appreciated!

                              PHP Code:
                              <if condition="$bbuserinfo['usergroupid'] != '9'">
                              <
                              div align="center">
                              <
                              script type="text/javascript"><!--
                              google_ad_client "pub-3363499795400448";
                              google_ad_width 468;
                              google_ad_height 60;
                              google_ad_format "468x60_as";
                              google_ad_type "image";
                              //2007-04-16: sport, play, canon, eos
                              google_ad_channel "0707114293+1100394895+3516999069+4334477588";
                              //-->
                              </script>
                              <
                              script type="text/javascript"
                                
                              src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                              </
                              script></div>
                              <
                              div align="center">
                                      <
                              div class="smallfont" align="center">To remove these advertsbecome a Premium MemberClick <a href="/forum/faq.php" rel="nofollow"><b><i>here</i></b></a> for more info.</div></if>
                              <
                              table><tr><td>&nbsp;</td></tr></table
                              Screenshot of what it's doing.


                              It also does this in on another forumboard which is running 3.6.2 but it also changes the colours of the fonts from blue to white?!?!?!

                              Comment

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