vBulletin 4, the most powerful community software + vBSEO 3.5, the ultimate SEO solution = Your ultimate platform for 2010 and beyond. Click below to learn more.

Results 1 to 9 of 9

Do not Display Adsense for specific categories

This is a discussion on Do not Display Adsense for specific categories within the Ad Networks forums, part of the Monetizing category; HI Folk, I have been using below adsense block under my forum navbar. This block will display through out entire ...

  1. #1
    Junior Member
    Real Name
    Surya
    Join Date
    Jan 2007
    Posts
    14

    Do not Display Adsense for specific categories

    HI Folk,

    I have been using below adsense block under my forum navbar. This block will display through out entire forum.

    I do not want to display this ad block for specific categories & all threads under it, Even for guests also.

    How to achieve this ?


    <if condition="$show['guest']">

    <table border="0" width="56%" id="table1">
    <tr>


    <td align="left">

    <script type="text/javascript"><!--
    google_ad_client = "pub-xxxxxxxxx";
    /* 300x250, created x/xx/09 */
    google_ad_slot = "xxxxxx";
    google_ad_width = 300;
    google_ad_height = 250;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></td>

    <td align="left">

    <script type="text/javascript"><!--
    google_ad_client = "pub-xxxxxxxxx";
    /* 300x250, created x/xx/09 */
    google_ad_slot = "xxxxxx";
    google_ad_width = 300;
    google_ad_height = 250;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></td>

    </tr>
    </table>

    </if>


    Thanks in Advance.

    Surya.

  2. #2
    vBSEO Staff Michael Biddle's Avatar
    Real Name
    Michael Biddle
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    6,362
    Try:


    HTML Code:
     <if condition="$show['guest'] AND $foruminfo['forumid'] != 'X'"> 
    Or

    HTML Code:
     <if condition="$show['guest'] AND $forum['forumid'] != 'X'"> 
    Replace X with your forumid.
    Michael Biddle / Crawlability Inc.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Pre-Release)- Released for your Evaluation


  3. #3
    Junior Member
    Real Name
    Surya
    Join Date
    Jan 2007
    Posts
    14
    Thank you for the reply.

    Problem is i have more than 1000 categories. I think above condition is to display the ads.. ?

    What command we need to use to block the ad for specific categories ?

    Some example : If cate 1,2,3,4 = Do not disaply ads ( Just an idea- I dont know coding).

    Regards,
    Surya.

  4. #4
    vBSEO Staff Michael Biddle's Avatar
    Real Name
    Michael Biddle
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    6,362
    Change it to:
    HTML Code:
     <if condition="$show['guest'] AND !in_array($foruminfo['forumid'], array(z,y,z))"> 
    Michael Biddle / Crawlability Inc.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Pre-Release)- Released for your Evaluation


  5. #5
    Junior Member
    Real Name
    Surya
    Join Date
    Jan 2007
    Posts
    14
    Here z,y,z are the category numbers we are avoiding to display ads ?

  6. #6
    Junior Member
    Real Name
    Surya
    Join Date
    Jan 2007
    Posts
    14
    Let me explain in detail :


    I have 10 categories in my forum, 1,2,3,4,5,6,7,8,9,10 (forum Ids ), When ever the Guest or members visits any thread under these categories, i do not want to display the google adsense block. For all other categories i will display the adsense block.


    Is there any code snippent like :


    If Forumid = 1,2,3,4,5,6,7,8,9,10 , Do not diplay


    Else
    <ad block >


    Display for all remaining categories.


    Thanks in Advance,
    Surya.

  7. #7
    vBSEO Staff Michael Biddle's Avatar
    Real Name
    Michael Biddle
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    6,362
    Have you no tried what I said above? That should work. replace x,y,z with all of the numbered forumids
    Michael Biddle / Crawlability Inc.
    Sneek Preview Video of the new Control Panel

    vBSEO 3.5 RC2 (Pre-Release)- Released for your Evaluation


  8. #8
    Junior Member
    Real Name
    Surya
    Join Date
    Jan 2007
    Posts
    14
    I did tried this :

    <if condition="$show['guest'] AND !in_array($foruminfo['forumid'], array(619,620,621,622,623,624))">

    But no change i can see.

    regards,
    Surya.

  9. #9
    Junior Member
    Real Name
    Surya
    Join Date
    Jan 2007
    Posts
    14
    I tried this one also :

    <if condition="!in_array($foruminfo['forumid'], array(619,620,621,622,623,624))">

    Didn't worked this one too.l

Similar Threads

  1. Categories, sub categories NOT working properly
    By alalinh in forum Troubleshooting
    Replies: 3
    Last Post: 02-15-2009, 11:12 AM
  2. Subdomains for specific forum categories
    By Giorgiotave in forum vBSEO Features Archive
    Replies: 0
    Last Post: 11-17-2006, 08:07 AM
  3. Subdomains for specific forum categories?
    By Webnower in forum Custom Rewrite Rules
    Replies: 3
    Last Post: 04-20-2006, 05:11 PM