Log in

View Full Version : Placing Adsense


specmav
07-14-2006, 01:09 AM
Yup another Adsense post.

I am looking to place adsense after the first post, after the 5th post and the last post. I also want to hide it from admins, mods and paid subscribers.

What do I need to finish this code, where do I need to place it and do I need to place it in more than one place?

<if condition="$post[postcount] == 1" condition="!is_member_of($bbuserinfo, 1, 2, 3)">

$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">
ADSENSE CODE
</td>
</tr>
</table>

</div>
$spacer_close

</if>


Thanks for the help!

specmav
07-16-2006, 01:08 PM
bump

zooki
07-17-2006, 01:34 PM
I would love to see solution to this too. Come on, where are the geeks when you need them :p

specmav
07-17-2006, 04:29 PM
I found a backwards way of doing it.


<if condition="!is_member_of($bbuserinfo, 1, 2, 3)">
<if condition="$post[postcount] == 1">

$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">
ADSENSE CODE
</td>
</tr>
</table>

</div>
$spacer_close

</if>
</if>


Unfortunately I have to use this code three times (post count for 1st, 5th and 10th) . I have to change the post count for each copy of it.

I wish I knew a way to add the other post count numbers into the first conditional.

Any Ideas?

lightwave
07-17-2006, 11:53 PM
this should work

<if condition="!is_member_of($bbuserinfo, 1, 2, 3)">
<if condition="$post[postcount] == 1 || $post[postcount] == 5 || $post[postcount] ==10">

$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">
ADSENSE CODE
</td>
</tr>
</table>

</div>
$spacer_close

</if>
</if>

Paul M
07-18-2006, 02:55 AM
Or this ;

<if condition="!is_member_of($bbuserinfo, 1, 2, 3) AND in_array($post[postcount], array(1,5,9)">

$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">
ADSENSE CODE
</td>
</tr>
</table>

</div>
$spacer_close

</if>

specmav
07-18-2006, 03:10 AM
Thanks!

TSM_Pikachu
07-18-2006, 09:37 AM
I am having issues setting up my adsense but this one seems cool and what I really want on my forum. I know you have to modify one of the templates but what part of the template do i modify for THIS specific one to work?