Exclude Group?

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
JupiterGPL
Registered User
Posts: 131
Joined: Thu Jun 08, 2006 4:52 pm
Contact:

Exclude Group?

Post by JupiterGPL »

Okay gang... This is not really about an extension, but more about a slight modification I have used for years that no longer works with 3.2

For years I have included Google Ads to my Viewtopic. I did this manually by adding the code directly to the viewtopic.html template file. But I excluded a group of users so they do not see the ads.

This is the code I used.

Code: Select all

<!-- IF not S_GROUP_2268 -->
<!-- Begin Google Ad -->
<center>
			<div class="inner"><span class="corners-top"><span></span></span>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Responsive - Viewtopic -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-5823325814502313"
     data-ad-slot="4518462780"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

			<span class="corners-bottom"><span></span></span></div>
</center>			
<!-- End Google Ad -->
<!-- ENDIF -->
Now while getting my site upgraded from 3.1 to 3.2, I have found that this snippet of code does not work. Anyone in that group is STILL seeing the Google Ads.


So I am curious... Has something changed between 3.1 and 3.2 that would prevent me from using this code? I have always found that using IF NOT S_GROUP has always worked well. Have things changed?
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: Exclude Group?

Post by javiexin »

The variable S_GROUP_2268 does not exist either in 3.1 or 3.2, so it is coming from (another) core change in 3.1, or an extension that you had and no longer have...

-javiexin
User avatar
JupiterGPL
Registered User
Posts: 131
Joined: Thu Jun 08, 2006 4:52 pm
Contact:

Re: Exclude Group?

Post by JupiterGPL »

Hmmmm.... It's been so long that I have looked at this that I have no idea how it is working on my 3.1 board. I guess I'll need to start from scratch and figure it out.
User avatar
JimA
Former Team Member
Posts: 7833
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Exclude Group?

Post by JimA »

javiexin wrote: Thu Mar 23, 2017 9:31 pm The variable S_GROUP_2268 does not exist either in 3.1 or 3.2, so it is coming from (another) core change in 3.1, or an extension that you had and no longer have...

-javiexin
JupiterGPL wrote: Thu Mar 23, 2017 11:53 pm Hmmmm.... It's been so long that I have looked at this that I have no idea how it is working on my 3.1 board. I guess I'll need to start from scratch and figure it out.
This might be related. :)
viewtopic.php?f=456&t=2325391
Jim Mossing Holsteyn - Former Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.
User avatar
JupiterGPL
Registered User
Posts: 131
Joined: Thu Jun 08, 2006 4:52 pm
Contact:

Re: Exclude Group?

Post by JupiterGPL »

Nice!!!

That extension worked like a charm! I installed it on my test board and now the I used in the past works great!
Post Reply

Return to “Extension Writers Discussion”