Link units, how is this done on AA?

Discussion in 'vBulletin Discussions' started by Mikey, Nov 3, 2009.

  1. Mikey

    Mikey Mikeylicio.us

    The current Google Adsense Link units you have after the first and 10th post of every thread here on AA, how've you done that? E

    verytime I try to put an ad after "n'th" amount of posts, it only goes after the first one..

    Would be mighty nifty to know how you did it, I'm assuming/hoping it's template controlled and not a mod?

    If you'd share, I'd appreciate it ;)
     
  2. Chani

    Chani Grand Master

    2 people like this.
  3. Nick

    Nick Regular Member

    All I did was add the following to the end of the postbit_legacy template:

    Code:
    <if condition="in_array($post['postcount'], array([COLOR=Red][B]1, 10[/B][/COLOR]))"><br />
    <table class="tborder" cellpadding="6" cellspacing="0" border="0" width="100%" align="center">
    <tr valign="top">
    <td class="alt1"><div> 
    <center>
    
    [COLOR=DarkGreen][I][B]GOOGLE ADSENSE CODE[/B][/I][/COLOR]
    
    </center>
    </div></td>
    </tr>
    </table>
    
    </if>
    You can change the numbers (in red), and add as many as you'd like, to display the ad(s) after whichever post #s you want.
     
    5 people like this.
  4. Wayne Luke

    Wayne Luke Regular Member

    You can use any math as well..

    Every 5th post for an ad unit?
    $post[postcount] % 5 == 0

    Etc... There is a thread in the quick tips forum at vBulletin.com by Jake Bunce that includes a bunch of conditionals for these purposes. Here:
    How To Show A Banner After The First Post In A Thread
     
    5 people like this.
  5. Nick

    Nick Regular Member

    I honestly didn't know that; that makes things much easier at times! Thank you! :)
     
    2 people like this.
  6. Mikey

    Mikey Mikeylicio.us

    Thanks all! I'll have a look at these now :)
     

Share This Page