I was noticing your use of adsense ads in the showthread template. That has to be one of the best locations I have seen. Where and how did you place it so it only shows up once after the first post? I would love to use this if you don't mind sharing.

Recommended Answers

All 16 Replies

The founder of this site made it herself; you should just go to www.vbulletin.org and request for it there.

If you're using vBulletin 3, go into the Style Manager for the style you wish to edit. The change will be made in either the postbit or postbit_legacy template, depending upon which one you use. (User info on top vs. user info on left).

The very bottom of the template should say:

<if condition="$show['spacer']"><if condition="!$post['islastshown']"></div></if>$spacer_close</if>
<!-- / post #$post[postid] -->

Directly above this, add:

<if condition="$post[postcount]==1">
<!-- text advertising -->
Google AdSense here
<!-- / text advertising -->
</if>

Of course, it can be customized via HTML and CSS as I have done to have a background, etc.

If you're using vBulletin 3, go into the Style Manager for the style you wish to edit. The change will be made in either the postbit or postbit_legacy template, depending upon which one you use. (User info on top vs. user info on left).

The very bottom of the template should say:

<if condition="$show['spacer']"><if condition="!$post['islastshown']"></div></if>$spacer_close</if>
<!-- / post #$post[postid] -->

Directly above this, add:

<if condition="$post[postcount]==1">
<!-- text advertising -->
Google AdSense here
<!-- / text advertising -->
</if>

Of course, it can be customized via HTML and CSS as I have done to have a background, etc.

What about doing this on the second or susequent pages of a thread, would it be something like this (assuming I have 10 post a page) :

<if condition="$post[postcount]==1 || 11 || 21">

No. It would be

<if condition="$post[postcount]==1 || $post[postcount]==11 || $post[postcount]==21">

This is a nice hack.

Thank you. :)

are you getting a respectable ctr from it, keep in mind that specifics are not allowed and I know this.

great hack, i love vBulletin more and more :)

<if condition="$post[postcount]==1 || $post[postcount]==11 || $post[postcount]==21">

This code as is will work for upto page 2? Or for upto any page number?

Instead of using adsense, how do you code it for banners?

thanks,
007

p.s. which link in this vbulletin control panel allows me add my signature?
i tried all of them but can't find it. :(

The above code would work for the first three pages - the ad would show after the first post (page 1), after the eleventh post (page 2), and after the twenty-first post (page 3). You might be able to use some modular (remainder) division to make it work for an infinite number of pages. I'm not so sure if the vBulletin templating system supports mod division (%), but it's worth a shot ...

<if condition=="$post[postcount] % 10==1">advertising here</if>

Basically, this means to show the ad code if when you divide the number of the current post by ten, you get a remainder of one. In other words, when you do the division 1 divided by 10, you get 0 remainder 1, so you show the ad. Similarily, when you do 21 divided by 10, you get 1 remainder 1, so again show the ad. You see how this will work for an infinite number of pages.

To answer your second question, there is a ten post minimum on DaniWeb before you have access to forum signatures. Only two more posts to go, 007!

do the ads display to guests only ?

To display them to guests only just do

<if condition=="$post[postcount]==1 AND !$bbuserinfo[userid]">

I don't see AdSense in showthread on this forum, nor Adsense on this site -- sorry, am I missing something here? Thanks! Hey, GREAT site Dani and all. Amazingly helpful!

In the old version of DaniWeb (pre-April) we had some areas of the site reserved for AdSense, such as below the first and last posts of a thread. However, AdSense is now rotated with the other ad spots :)

Adsense ads in showthread listings are really simple to setup and appear quickly in the index.

This is an interesting discussion. thank you for sharing

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.