Google Adsense in Topics

Guides & Snippets for phpBB3.
Try the Snippets here and share Your own Snippets

Google Adsense in Topics

Post by Stoker »

Google Adsense in Topics
Written by Stoker

This snippet will show you how to implement Google Adsense in the topics of your phpBB3 board.
Its quite simple, only 1 edit per template.

Moved here: viewtopic.php?f=45&t=1255
You do not have the required permissions to view the files attached to this post.

Re: Google Adsense in Topics

Post by sman »

And if we want it after first post and after last post if we have more than 3 replies
& :

And this little req: add after 5-nd post too if that topic had 10 posts.
IPS I have maxim 10 posts per page in topic.
tks
Last edited by sman on 28 Aug 2010, 23:04, edited 2 times in total.

Re: Google Adsense in Topics

Post by Stoker »

So you want it after first, fifth and last post?

Re: Google Adsense in Topics

Post by sman »

yes, but fifth only if i have 10 topics in page.
If i have 9 post in topic > only first and last.
Last edited by sman on 29 Aug 2010, 00:28, edited 6 times in total.

Re: Google Adsense in Topics

Post by Stoker »

I suggest you use this one:

Code: Select all

<!-- IF postrow.S_FIRST_ROW or postrow.S_ROW_COUNT > 3 and postrow.S_LAST_ROW -->

Re: Google Adsense in Topics

Post by testas123 »

Is it possible to add adsense in posts? for example, in first post with the user's message ?

Or is it against adsense TOS?

Re: Google Adsense in Topics

Post by cisco007 »

I think it's agains the TOS, but you have to read all that yourself!

Re: Google Adsense in Topics

Post by Stoker »

No, its not any problem. You can insert them in posts.

Open viewtopic_body.html
Find:

Code: Select all

{postrow.MESSAGE}
You can insert the following code before or after, depending on if you want it to appear before or after the post:

Code: Select all

<!-- IF postrow.S_FIRST_ROW -->
			<div style="text-align:center;">
			adsense code here
			</script>
			</div>
			<!-- ENDIF -->

Re: Google Adsense in Topics

Post by cisco007 »

what i meant was that i think for google adsense you can only have about 3 ads showing per page if i remember correctly, which sometimes i don't!

Re: Google Adsense in Topics

Post by Stoker »

I think you may be right.