XF 1.1 Usergroup promotions cron does not demote members

Akela

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?
 
What is the exact criteria of your promotion?

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>
 
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.)

Apply This Promotion While... /
- User State Is: Valid
- User has posted at least X messages: 0
- User has posted no more than X messages: 24

Custom User Field Criteria:
- no settings

^ the following settings somehow add myself and other users with hundreds of posts into the Ads group...
 
All right. The ad-free group is 22.
Code:
<xen:if is="!{xen:helper ismemberof, $visitor, 22}">
 
Ad code
</xen:if>
Both myself and some members can still see the ad... I checked, they are in the group.
 
Back
Top Bottom