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

XF 1.4 User promotion

Discussion in 'XenForo Questions and Support' started by kankan, Aug 5, 2015.

  1. kankan

    kankan Active Member

    I am having two groups :

    I have created a user promotion rules based on a donation rule : promote user belonging to Member group to Donator group if a donation is made.
    The rule behaves ok except that the system does not change the primary group but add the user to the Donator secondary group.
    Due to this the user does not benefits from the advantages of donator group.

    Anyway to change the primary group on user promotion?

    Thank you
  2. Chris D

    Chris D XenForo Developer Staff Member

    No, generally the primary group wouldn't (and shouldn't) need to be changed.

    If you do the permissions correctly, then this shouldn't be an issue.
  3. kankan

    kankan Active Member

    Thanks Chris D

    i have created AD display exception based on group
    Donator is group 9

    If user is promoted from Members to Donator, then he stills see the ads.
    If i set the user to Donator group as a primary group, the ad disapear.

    I don't know how to manage to move user to Donator group and grant him the advantage of the group.
    He takes only the advantage of the primary group.

    Don't know if i am clear
  4. kankan

    kankan Active Member

    Just did a batch update to change primary group for those users to Donator group
    but this is not a solution :/
  5. Martok

    Martok Well-Known Member

    kankan likes this.
  6. Chris D

    Chris D XenForo Developer Staff Member

    If that is some sort of add-on that is doing the ad exceptions, I would suggest its logic is rather at odds with the best practices that should be taken when setting up user groups and permissions, and the author may want to review that.
  7. kankan

    kankan Active Member

    I have set this condition on pages and it is working OK if users belongs to Donator (as primary group), but not if user belongs to Registered and Donator as a second group.
    I understand the logic of permission. Registered has the minimum permission. When i promote a user, it add the user to Donator group (secondary group) but then the Ad is still visible (as if it user does not belongs to group 9 but 1) : user does not inherit to group Donator permissions.
  8. Chris D

    Chris D XenForo Developer Staff Member

    What are you using to conditionally show ads?

    Some sort of add-on? Template conditionals? If you can share some code or more details about how you're doing this we may be able to identify the problem.
  9. kankan

    kankan Active Member

    I am using conditionnals.

    Ex :

    <xen:if is="!{xen:helper ismemberof, $visitor, 3, 4, 5,9}"><div class="sectionMain"> <center><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- Asus Horizontal Haut -->
    <ins class="adsbygoogle"
    (adsbygoogle = window.adsbygoogle || []).push({});
  10. kankan

    kankan Active Member

    Just realised i got error while editing user promotion :

    Template Errors: user_group_promotion_edit
    1. Invalid argument supplied for foreach() in /home/e-smith/files/ibays/forumasus/html/forums/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 177:
      176: $__compilerVar51 = array();
      177: foreach ($nodeCriteriaData['nodes'] AS $_criteriaNode)
      178: {
  11. Martok

    Martok Well-Known Member

    Are you editing a template called user_group_promotion_edit? Or is this just showing in the error?

    It would be helpful to see the whole error message.

    Also, I can't find a template called user_group_promotion_edit, so that might be from an add-on. Are you using any user group promotion add-ons?
  12. kankan

    kankan Active Member

    Yes Martok,
    [ThemesCorp] Enhanced Trophy And Notice Criteria by @Allan
    i disabled the addon and it went ok.

Share This Page