Log in

View Full Version : Showing Adsense *Only If There's" 2nd Post?


Mostjolly
07-03-2010, 02:11 AM
I already know how to stick adsense after 1st post, however that's not what I want.

For example: If there only ONE POST in a thread - adsense will NOT show under 1st post, but when there's a 2nd post.. the adsense then will appear under 1st post.

So basically, no 2nd post = no adsense.

I'm not sure but does it has anything with the <else> code?

Here's my coding sampling:

<if condition="in_array($post['postcount'], array(1,9,10,15,20))">
<div style="padding:6px 0px 0px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="alt1" align="center">
ADSENSE CODES........
</td>
</tr>
</table>
</div>
</if>Any help is greatly appreciated :)
-Nhat

Xencored
07-03-2010, 02:23 AM
<vb:if condition="$post[postcount]==2" /></vb:if>

Mostjolly
07-03-2010, 04:07 AM
<vb:if condition="$post[postcount]==2" /></vb:if>

I believe that's for vB 4, how about vB 3.8?

Where exactly would I stick the code? Should it look something like this?

<if condition="$post[postcount]==2" "in_array($post['postcount'], array(1,9,10,15,20))">
<div style="padding:6px 0px 0px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="alt1" align="center">
ADSENSE CODES........
</td>
</tr>
</table>
</div>
</if>


Tried the code above without success :)

Xencored
07-03-2010, 09:26 AM
Try posting in 3.8 than this is 4.0...........

Marco van Herwaarden
07-03-2010, 10:42 AM
Moved to vB3 forums.

Mostjolly
07-03-2010, 09:02 PM
Any expert? :)

BirdOPrey5
07-05-2010, 04:09 AM
I don't know what you're trying to do with the array in your if statement, it should merely be:


<if condition="$post[postcount]==2">
<div style="padding:6px 0px 0px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="alt1" align="center">
ADSENSE CODES........
</td>
</tr>
</table>
</div>
</if>


I don't know for sure that postcount==2 will work outside the actual post but if it does then that is the correct if statement.