It is currently 19 Feb 2018, 15:45

Anything Goesphpbb Show google ads after first post (but only to non-members). (Showcase | Slideshow)

Anything, almost anything at all
(even advertisement if it's decent, spammers will be banned)
Post Reply
User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 1/1
Posts: 2157
Joined: 26 Sep 2016, 00:16
Cash on hand: 7,894.01 GLP
Bank: 51,356.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1196
x 256
Contact:
Canada

phpbb Show google ads after first post (but only to non-members).

Post#1 by tim » 03 Nov 2016, 02:21


I installed this extension found here: https://www.phpbb.com/customise/db/extension/adsense/
And added google adsense code and it works.
But it shows to everyone.
I wanted to prevent ads from showing to logged in members.
This is what i did to the extension. It's very simple.
After enabling my extension and got the ads running for everyone.
in the file ext/ashus/adsense/styles/all/template/even/viewtopic_body_postrow_post_after.html
it has the code

Code: Select all

<!-- IF GOOGLE_ADSENSE_DISPLAY --><!-- IF ! $GOOGLE_ADSENSE_SHOWN -->
<div class="post bg2 adsense" style="position: relative;">		
	<div class="inner">		
		<div class="postbody">						
			<div> 			 			
				<div class="content">
					{GOOGLE_ADSENSE_HTML}
				</div>							
			</div>		
		</div>		
	</div>		
</div>
<!-- DEFINE $GOOGLE_ADSENSE_SHOWN = true -->
<!-- ENDIF --><!-- ENDIF -->
I just added this code before

Code: Select all

<!-- IF not S_USER_LOGGED_IN-->
and added this code after

Code: Select all

<!-- ENDIF -->
so that i have this code (after tabbing in to make it easy to read).

Code: Select all

<!-- IF not S_USER_LOGGED_IN-->
	<!-- IF GOOGLE_ADSENSE_DISPLAY --><!-- IF ! $GOOGLE_ADSENSE_SHOWN -->
	<div class="post bg2 adsense" style="position: relative;">		
		<div class="inner">		
			<div class="postbody">						
				<div> 			 			
					<div class="content">
						{GOOGLE_ADSENSE_HTML}
					</div>							
				</div>		
			</div>		
		</div>		
	</div>
	<!-- DEFINE $GOOGLE_ADSENSE_SHOWN = true -->
	<!-- ENDIF --><!-- ENDIF -->
<!-- ENDIF -->
That's it then uploaded the file.
And now only non-members or logged-out members see the google ads after first post.
0 x



aka Tin
Image gimplearn.net                                              

Registered members enjoy ads-free content
Post Reply

Last 20 Members Who Visited This Topic

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: gnerd
2: Issabella
3: trandoductin
4: david
5: Pat625
6: Issabella
7: RJKD

Who is online

Users browsing this forum: No registered users and 1 guest