How can i put Adsense Between ever 3-4 Posts in Vbulletin, PLEASE Help!!!

Discussion in 'vBulletin' started by Woodcs82, Nov 18, 2009.

  1. #1
    How can i put Adsense Between ever 3-4 Posts in VBulletin, PLEASE Help!!!

    Thank you,

    -C
     
    Woodcs82, Nov 18, 2009 IP
  2. GetALink

    GetALink Guest

    Messages:
    1,717
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I am also in search of an answer to this question. :)
     
    GetALink, Nov 19, 2009 IP
  3. Brandon Sheley

    Brandon Sheley Illustrious Member

    Messages:
    9,721
    Likes Received:
    612
    Best Answers:
    2
    Trophy Points:
    420
    #3
    have you tried using a template condition?
     
    Brandon Sheley, Nov 20, 2009 IP
  4. Abhik

    Abhik ..:: The ONE ::..

    Messages:
    11,337
    Likes Received:
    606
    Best Answers:
    0
    Trophy Points:
    410
    Digital Goods:
    2
    #4
    Admin CP > Styles & Templates > Style Manager > Postbit Templates -> postbit or postbit_legacy (depending on which layout you are using)

    Add the code at the very bottom of the template

    <if condition="$post[postcount] == XX">
    
    $spacer_open
    <div style="padding:0px 0px $stylevar[cellpadding]px 0px">
    
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
    <tr>
        <td class="thead" align="left">Sponsored Links</td>
    </tr>
    <tr>
        <td class="alt1" align="center">
            BANNER CODE HERE
        </td>
    </tr>
    </table>
    
    </div>
    $spacer_close
    
    </if>
    PHP:
    Replacing the XX with the number of the post.

    Let me know if that worked.
    If you wanna show it only after first post, there's a hook location available though.
     
    Abhik, Nov 21, 2009 IP
    Ibn Juferi likes this.
  5. Ibn Juferi

    Ibn Juferi Prominent Member

    Messages:
    6,221
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    310
    #5
    Thanks for the code, been looking for something like this :)
     
    Ibn Juferi, Nov 23, 2009 IP
  6. Raymond.C

    Raymond.C Peon

    Messages:
    516
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    No need for all of this. There should be a plugin at the vBulletin community. If your using a fake copy then to bad. I am not aloud to discuss that on this forum.
     
    Raymond.C, Nov 23, 2009 IP
  7. Brandon Sheley

    Brandon Sheley Illustrious Member

    Messages:
    9,721
    Likes Received:
    612
    Best Answers:
    2
    Trophy Points:
    420
    #7
    There is no reason to clutter up and slow down your site with a plugin, the template condition works just fine ;)
    the excuse some may use is "issues with upgrades" this isn't a problem since you should be posting in the ad_location templates, which don't get upgraded ;)
     
    Brandon Sheley, Nov 23, 2009 IP
  8. webcosmo

    webcosmo Notable Member

    Messages:
    5,840
    Likes Received:
    153
    Best Answers:
    2
    Trophy Points:
    255
    #8
    You can also use the Red Tyger plugin.
     
    webcosmo, Nov 23, 2009 IP
  9. Abhik

    Abhik ..:: The ONE ::..

    Messages:
    11,337
    Likes Received:
    606
    Best Answers:
    0
    Trophy Points:
    410
    Digital Goods:
    2
    #9
    ad_location template doesn't let you show ads after a particular post count.
    That template is highly usable if you want to show ads right after first post. But, if you want more flexibility,you have to edit the postbit template.

    I might be wrong in this case, but would also like someone to prove it.
     
    Abhik, Dec 1, 2009 IP
  10. Qryztufre

    Qryztufre Prominent Member

    Messages:
    6,071
    Likes Received:
    491
    Best Answers:
    0
    Trophy Points:
    300
    #10
    I used <if condition="in_array($post['postcount'], array(1, 11, 21, 31, 41, 51, 61, 71, 81, 91, 101, 111, 121, 131, 141, 151)) AND !$bbuserinfo[userid]"> for my fist line, as it allowed me to place the add after the first post of each page (I have the default 10 posts per page set) so the first 15 pages of a thread will have addage. Anything after that on my forum and it's generally a word game so it's not really needed.

    NOTE: after the AND is to make it so only guests see the adds, you may need to remove that if you are wanting everyone to see it.

     
    Qryztufre, Dec 2, 2009 IP
  11. Raymond.C

    Raymond.C Peon

    Messages:
    516
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    There are official plug ins for this. I think this guy has a copy of vB.
     
    Raymond.C, Dec 3, 2009 IP
  12. Abhik

    Abhik ..:: The ONE ::..

    Messages:
    11,337
    Likes Received:
    606
    Best Answers:
    0
    Trophy Points:
    410
    Digital Goods:
    2
    #12
    If you use
    <if condition="$post['postcount'] % $vboptions['maxposts'] == x AND !$bbuserinfo[userid]"></if> will do the same..
     
    Abhik, Dec 3, 2009 IP
  13. Raymond.C

    Raymond.C Peon

    Messages:
    516
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #13
    No need for complex PHP or XML.
     
    Raymond.C, Dec 3, 2009 IP