Google Adsense in Topics

Guides & Snippets for phpBB3. Try the Snippets here and share Your own Snippets
There is no support here! Only Read Access!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

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
Attachments
google.gif
google.gif (3.75 KiB) Viewed 6657 times
Board rules! No PM support
sman
BBCoder II
BBCoder II
Posts: 23
Joined: 31 Jul 2010, 13:58
Contact:

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 29 Aug 2010, 01:04, edited 2 times in total.
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Google Adsense in Topics

Post by Stoker »

So you want it after first, fifth and last post?
Board rules! No PM support
sman
BBCoder II
BBCoder II
Posts: 23
Joined: 31 Jul 2010, 13:58
Contact:

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, 02:28, edited 6 times in total.
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

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 -->
Board rules! No PM support
testas123
BBCoder II
BBCoder II
Posts: 13
Joined: 11 Jun 2010, 18:09

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?
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

Re: Google Adsense in Topics

Post by cisco007 »

I think it's agains the TOS, but you have to read all that yourself!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

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 -->
Board rules! No PM support
cisco007
BBCoder VI
BBCoder VI
Posts: 1015
Joined: 16 Mar 2010, 18:14
Location: Don't really know!

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!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Google Adsense in Topics

Post by Stoker »

I think you may be right.
Board rules! No PM support
Locked