Page 1 of 2

Google Adsense in Topics

Posted: 08 Mar 2010, 08:16
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

Re: Google Adsense in Topics

Posted: 29 Aug 2010, 01:00
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

Re: Google Adsense in Topics

Posted: 29 Aug 2010, 02:19
by Stoker
So you want it after first, fifth and last post?

Re: Google Adsense in Topics

Posted: 29 Aug 2010, 02:25
by sman
yes, but fifth only if i have 10 topics in page.
If i have 9 post in topic > only first and last.

Re: Google Adsense in Topics

Posted: 29 Aug 2010, 11:40
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

Posted: 29 Aug 2010, 19:10
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

Posted: 29 Aug 2010, 19:14
by cisco007
I think it's agains the TOS, but you have to read all that yourself!

Re: Google Adsense in Topics

Posted: 29 Aug 2010, 20:46
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

Posted: 29 Aug 2010, 20:57
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

Posted: 29 Aug 2010, 22:04
by Stoker
I think you may be right.