Announcement

Collapse
No announcement yet.

prevent adsense ads from 1 forum

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

  • #16
    Actually, it's one particular usergroup that I want to show NO ads too, and certain forums that I want no ads shown to anyone in. Here's the thing. I have sponsors. I have what is called an "Ask the Expert" type forum with several child forums, each dedicated to individual experts. I don't want ads in my sponsors' forums, and I never want my sponsors to have to see ads in ANY OTHER forums. Make sense? This is what I'm trying to accomplish.

    Comment


    • #17
      What are the groups you never want to show ads to? Which are the forums you do not want to show ads to?

      Comment


      • #18
        Sponsor Forums
        >Sponsor Forum 1
        >Sponsor Forum 2
        >Sponsor Forum 3

        Usergroup to show NO ADS to in ANY of my forums: SPONSORS

        The forum IDs listed in the code are the actual sponsor forums, and their usergroup ID is 14. I guess I'll block them from myself too (usergroup 6).

        Forum IDs
        32,48,34,44,41,49,53,58,61,79,82,81,80,46,52,36,40

        Comment


        • #19
          Code:
          <vb:if condition="!is_member_of($bbuserinfo, 14)> 
          <vb:if condition="!in_array($GLOBALS[forumid], array(32,48,34,44,41,49,53,58,61,79,82,81,80,46,52,36,40))">
          ADD CODE HERE
          </vb:if>
          </vb:if>
          This should first check if a user is not part of usergroup 14, then assuming they're not, check if we're in one of the above forums. If both of those conditions are met, you put your code where it says ADD CODE HERE

          Comment


          • #20
            OMG, I just realized I'm posting in vb4. I'm running 3.8.6. Please don't kill me. I assume the code for vb3 is going to be slightly different?

            Comment


            • #21
              Remove the vb: bits.

              Moved the thread for you

              Comment


              • #22
                You're freaking awesome! I could kiss you!!!! Thank you so much for your help! At least now I'll know what to use when I upgrade to vb4. Just gotta finish customizing my test forum.

                Comment


                • #23
                  Ok, you're gonna kill me. This is the code I tried, and the error I get is beneath it.

                  Code:
                  <if condition="!is_member_of($bbuserinfo, 6,7,14)> 
                  <if condition="!in_array($GLOBALS[forumid], array(32,48,34,44,41,49,53,58,61,79,82,81,80,46,52,36,40))">
                  <script type="text/javascript"><!--
                  google_ad_client = "pub-xxxxxxxxxxxxxxxx";
                  /* Forum Leaderboard */
                  google_ad_slot = "xxxxxxxxx";
                  google_ad_width = 728;
                  google_ad_height = 90;
                  //-->
                  </script>
                  <script type="text/javascript"
                  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                  </script>
                  </if>
                  </if>
                  The following error occurred when attempting to evaluate this template:
                  The conditional on line 14 appears to be missing its beginning tag (<if>). This may cause unexpected behavior.

                  This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

                  Comment


                  • #24
                    You're missing a closing quote...
                    Code:
                    <if condition="!is_member_of($bbuserinfo, 6,7,14)"> 
                    ...
                    Lats...

                    Comment


                    • #25
                      That is my fault, sorry.

                      Comment


                      • #26
                        Originally posted by Zachery View Post
                        What is the code you're trying, in what templates?
                        hi

                        this is what i tried:

                        Code:
                        <if condition="!in_array($forumid, array(8,))">
                        <div style="width:728px; margin:0 auto; padding-bottom:1em">
                        <script type="text/javascript"><!--
                        google_ad_client = "{vb:var adsense_pub_id}";
                        google_ad_host = "{vb:var 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 = "{vb:stylevar alt2_bgcolor_hex}";
                        google_color_bg = "{vb:stylevar alt1_bgcolor_hex}";
                        google_color_link = "{vb:stylevar body_link_n_fgcolor_hex}";
                        google_color_text = "{vb:stylevar body_fgcolor_hex}";
                        google_color_url = "{vb: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>
                        </vb:if>
                        in the ad_navbar_below template. i have tried the possible solutions in this thread but none helped....please help. thanks.

                        Comment


                        • #27
                          What about it is not working?

                          Comment


                          • #28
                            Originally posted by Zachery View Post
                            What about it is not working?
                            after putting the code in that template i mentioned....the ads still show

                            Comment


                            • #29
                              hi, this is my thread...you moved it to 3.8 forum section on someone else's request.

                              btw, can i get some help?

                              Comment


                              • #30
                                no help in this thread too?

                                Comment

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