Adsense after the first AND second posts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neodesc
    New Member
    • Jun 2006
    • 10
    • 3.6.x

    Adsense after the first AND second posts

    The old instructions (http://www.vbulletin.com/forum/showthread.php?t=157022) for version 3.5.x required some changes in 3.6.x. The conditions are the same, but the layout code is different. Here are the new instructions: Admin CP -> Styles & Templates -> Style Manager -> « » -> Postbit Templates ->


    I'm using this condition right now on my forum:
    Code:
    <if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid]">
    but it only shows the adsense banner after the first post, is there any way to display it after the first and second posts both?

    I have tried this
    Code:
    <if condition="$post[postcount] == 1 OR $post[postcount] % 1 == 0">
    but I need to limit the number of banners it displays to just two, can you help me please? maybe another way?
    Last edited by Colin F; Tue 22 May '07, 1:42pm.
  • Jose Amaral Rego
    Senior Member
    • Feb 2005
    • 11058
    • 1.1.x

    #2
    This should work on all forums with 2(two) post.
    Code:
    <if condition="in_array($post[postcount], array(1,2))"> BANNER CODE </if>

    Comment

    • neodesc
      New Member
      • Jun 2006
      • 10
      • 3.6.x

      #3
      Originally posted by José M. Amaral Rego
      This should work on all forums with 2(two) post.
      Code:
      <if condition="in_array($post[postcount], array(1,2))"> BANNER CODE </if>
      It works but only in the first page of each thread

      Comment

      • Jose Amaral Rego
        Senior Member
        • Feb 2005
        • 11058
        • 1.1.x

        #4
        I can not find any instance for conditional to locate 2nd post per page. I tried simular variations, but that would depend on members settings on total post per page. This is the closest I got in everypage in a thread.
        Code:
        <if condition="$GLOBALS['FIRSTPOSTID'] == 0"> BANNER CODE </if>
        I can not see any other way in .php, I think someone else needs to help you more on this.

        Comment

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