XF 1.1Usergroup promotions cron does not demote members

Active member

I do not seem to have much luck with the usergroup promotions cron demoting members...

I have an Ads group for users with 0 - 24 posts. At 25 posts they should be removed from the group and hence no longer see the ads.

I keep getting reports from users that they can see ads when they are anywhere from 25 to 500 posts. This has been going on for months. I also have a test user with 30 posts. Running cron manually does not remove the account from the Ads group.

I also noticed that Ads somehow gets set as the default usergroup. Could this be part of the issue? Or did I misunderstand the promotion/demotion function?

XenForo moderator

To be clear, promotions add users to groups if they meet the criteria. If a user gets added to the group (promoted) and then later no longer meets the criteria then they will be removed from the group (demoted). Demotion can only happen if they previously were given the promotion.

In your case the proper implementation would be to promote users to an ad-free group after they reach 25 posts, and then your ads would use a condition that excludes members of that group from seeing the ad.

Code:

<xen:if is="!{xen:helper ismemberof, $visitor, 5}">
AD CODE THAT IS SHOWN TO ALL EXCEPT GROUP 5
</xen:if>

Active member

Thank you very much, Jake. I will try the code.
Still, I am very curious to know what is wrong with my cron...

My promotion criteria for group Ads.
Promotion Options:
- Add user to user groups: Ads, Registered
(I added Registered group into the promotion because a few members somehow ended up being automatically removed from it.)