How to exclude user groups from seeing adverts.
error 232
From: -
From: -
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.
Philipp Esselbach
From: -
Editor
0From: -
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:
Then you can use {$intellitxt} as place holder in the HTML part
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.
error
OP
232
From: -
From: -
Thank you again. That works.
Does if statements works in CT templates?
Does if statements works in CT templates?
1 Re: How to exclude user groups from seeing adverts.
Philipp Esselbach
From: -
Editor
0From: -
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.
error
OP
232
From: -
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:
doesn't work. Something with spaces between numbers.
<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.
Philipp Esselbach
From: -
Editor
0From: -
This seems to work:
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:
Replace SUBSCRIBERGROUPHERE with your subscriber group id
Edit: I wrote this before you posted #4
<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.
error
OP
232
From: -
From: -
I figured it out.
But how add more members groups? Tried to add == 2 3 7 23 but doesn't work
<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.
error
OP
232
From: -
From: -
Tried that and doesn't work.
1 Re: How to exclude user groups from seeing adverts.
Philipp Esselbach
From: -
Editor
0From: -
There is no longer the variable $this->ipsclass->member['mgroup'] in IPB3. The group ID is now in $this->memberData['member_group_id']
I know this is not related to CT but hope you will answer me.
I have this if statement:
This doesn't work. I want the way to show adverts only to certain user groups.
Thanks.