This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

How to exclude user groups from seeing adverts.


avatar
error 232
From: -
How to exclude user groups from seeing adverts.

I know this is not related to CT but hope you will answer me.

I have this if statement:

<if="in_array( $this->ipsclass->member['mgroup'], array( 0 ) )">

<!-- start Vibrant Media IntelliTXT script section -->
<script type="text/javascript" src="https://www.contentteller.com/ http://msfn.us.intellitxt.com/intellitxt/front.asp?ipid=6131"></script>
<!-- end Vibrant Media IntelliTXT script section -->
</if>


This doesn't work. I want the way to show adverts only to certain user groups.

Thanks.

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: How to exclude user groups from seeing adverts.
avatar
Editor
0
From: -
No and yes. Contentteller have a separate PHP part for each template.

Example:
To add your IntelliTXT ad code to the footer, open site_footer in the template editor and add the following PHP part:

global $user;


if($user['user_status'] == 6)
{
$intellitxt = "";
}
else
{
$intellitxt = "<!-- start Vibrant Media IntelliTXT script section -->
<script type=\"text/javascript\" src=\" http://msfn.us.intellitxt.com/intellitxt/front.asp?ipid=6131\"></script>
<!-- end Vibrant Media IntelliTXT script section -->";
}


Then you can use {$intellitxt} as place holder in the HTML part
1 Re: How to exclude user groups from seeing adverts.
avatar
OP 232
From: -
Thank you again. That works.

Does if statements works in CT templates?
1 Re: How to exclude user groups from seeing adverts.
avatar
Editor
0
From: -
I figured it out. But how add more members groups? Tried to add == 2 3 7 23 but doesn't work


<if test="$this->memberData['member_group_id'] == 2 or $this->memberData['member_group_id'] == 3 or $this->memberData['member_group_id'] == 7 or $this->memberData['member_group_id'] == 23">

<!-- start Vibrant Media IntelliTXT script section -->
<script type="text/javascript" src="https://www.contentteller.com/ http://msfn.us.intellitxt.com/intellitxt/front.asp?ipid=6131"></script>
<!-- end Vibrant Media IntelliTXT script section -->
</if>
1 Re: How to exclude user groups from seeing adverts.
avatar
OP 232
From: -
Right but i have 4 subscriber groups. i want to show advert to 3 groups: 2 3 17 but when i put it like this:


<if test="showVibrantMedia:|:$this->memberData['member_group_id'] == 2 3 17">
<!-- start Vibrant Media IntelliTXT script section -->
<script type="text/javascript" src="https://www.contentteller.com/ http://msfn.us.intellitxt.com/intellitxt/front.asp?ipid=6131"></script>
<!-- end Vibrant Media IntelliTXT script section -->
</if>


doesn't work. Something with spaces between numbers.
1 Re: How to exclude user groups from seeing adverts.
avatar
Editor
0
From: -
This seems to work:

<if test="$this->memberData['member_group_id'] == 2">
<!-- start Vibrant Media IntelliTXT script section -->
<script type="text/javascript" src="https://www.contentteller.com/ http://msfn.us.intellitxt.com/intellitxt/front.asp?ipid=6131"></script>
<!-- end Vibrant Media IntelliTXT script section -->
</if>


The code above will only show up for group 2 (guests).

If you like to show the code to all groups except a subscriber group:

<if test="$this->memberData['member_group_id'] != SUBSCRIBERGROUPHERE">
<!-- start Vibrant Media IntelliTXT script section -->
<script type="text/javascript" src="https://www.contentteller.com/ http://msfn.us.intellitxt.com/intellitxt/front.asp?ipid=6131"></script>
<!-- end Vibrant Media IntelliTXT script section -->
</if>

Replace SUBSCRIBERGROUPHERE with your subscriber group id

Edit: I wrote this before you posted #4
1 Re: How to exclude user groups from seeing adverts.
avatar
OP 232
From: -
I figured it out.


<if test="showVibrantMedia:|:$this->memberData['member_group_id'] == 2">
<!-- start Vibrant Media IntelliTXT script section -->
<script type="text/javascript" src="https://www.contentteller.com/ http://msfn.us.intellitxt.com/intellitxt/front.asp?ipid=6131"></script>
<!-- end Vibrant Media IntelliTXT script section -->
</if>


But how add more members groups? Tried to add == 2 3 7 23 but doesn't work
1 Re: How to exclude user groups from seeing adverts.
avatar
OP 232
From: -
Tried that and doesn't work. Slightly Frowning Face
1 Re: How to exclude user groups from seeing adverts.
avatar
Editor
0
From: -
There is no longer the variable $this->ipsclass->member['mgroup'] in IPB3. The group ID is now in $this->memberData['member_group_id']

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.