1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Don't show ads to users in secondary usergroup?

Discussion in 'Troubleshooting and Problems' started by Chris Radford, May 1, 2016.

  1. Chris Radford

    Chris Radford Member

    OK folks,

    We have just rebuilt our permissions from the ground up as instructed to ensure that all users primary group is the registered user group, and then built up secondary usergroups for admin, moderator, etc.

    We are trying to ensure adverts do not display to everyone in our secondary usergroup called "Site Supporter" - this is users whom have made a token donation to help with the running of the website.

    We want adverts to appear to the Register user group,
    We do not want adverts to appear to the Register user group who also have a secondary Site Supporter permission.

    We've tried using the following code in the top breadcrumb, but adverts still display to site supporters;

    Code:
    <xen:if is="{xen:helper ismemberof, $visitor, 2, 1}">
    <xen:if is="{$contentTemplate} == 'forum_list'">
    <script language="javascript">
     if (snackMobile) {
      <!--
     if (window.adgroupid == undefined) {
      window.adgroupid = Math.round(Math.random() * 1000);
     }
     document.write('<!--JavaScript Tag with group ID // Tag for network 1639: Snack Media // Website: onefootballforum.co.uk // Page: ROS // Placement: onefootballforum.co.uk Mobile MPU (5835313) // created at: Apr 13, 2016 10:45:37 AM--><div style="display:block; margin:0 auto; width:300px; height: 250px;"><scr'+'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn/3.0/1639/5835313/0/170/ADTECH;loc=100;target=_blank;KVabbr='+adtechCCfullstring+';grp='+window.adgroupid+';misc='+new Date().getTime()+'"></scri'+'pt></div>');
     //-->
     }
     else {
     <!--
     if (window.adgroupid == undefined) {
      window.adgroupid = Math.round(Math.random() * 1000);
     }
     document.write('<!--JavaScript Tag with group ID // Tag for network 1639: Snack Media // Website: onefootballforum.co.uk // Page: ROS // Placement: onefootballforum.co.uk Billboard (5657009) // created at: Apr 13, 2016 10:45:10 AM--><div style="width: 100%; overflow:hidden;"><div style="display:block; margin:0 auto; min-width: 728px; min-height:90px; max-width:970px; max-height: 250px; text-align:center;"><scr'+'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn/3.0/1639/5657009/0/2466/ADTECH;loc=100;target=_blank;KVabbr='+adtechCCfullstring+';grp='+window.adgroupid+';misc='+new Date().getTime()+'"></scri'+'pt></div></div>');
     //-->
     }
    </script>
    <div style="width:300px;">
    <noscript><a href="http://adserver.adtech.de/adlink/3.0/1639/5835313/0/170/ADTECH;loc=300" target="_blank"><img src="http://adserver.adtech.de/adserv/3.0/1639/5835313/0/170/ADTECH;loc=300" border="0" width="300" height="250"></a></noscript>
    </div>
    </xen:if>
    </xen:if>
    The usergroups listed above are Registered & Unregistered. It's almost as as even though users have site supporter as a secondary, because the primary is registered the adverts fire.

    If it helps, the Site Supporter usergroup is 6.

    What am I doing wrong? Any help with setup would be greatly appreciated! If you need any further information, please let me know. The website is installed on; http://www.onefootballforum.co.uk.

    James
     
  2. Chris Radford

    Chris Radford Member

    I've now resolved this issue using the conditional statement as below to hide content from the site supporter usergroup...

    <xen:if is="!{xen:helper ismemberof, $visitor, 6}">
    CONTENT HERE
    </xen:if>
     
  3. Tracy Perry

    Tracy Perry Well-Known Member

Share This Page