XF 2.3 User whose membership period has expired

LeoTR

Active member
When a member purchases a paid membership, I manually change the main user group. However, I want the membership period to automatically expire when it expires. When I try this with the promotion method, it adds the user to the additional user group. How can I ensure that the main user group of the member I manually upgraded to becomes "member whose membership period has expired" when the membership period expires?
 
I have to do the paid membership manually. Because paypal is banned in Türkiye. And xenforo infrastructure does not support any other payment infrastructure here.
 
Shouldn't the membership be automatically removed from the user group when the membership period ends?

I'm trying to solve the issue with promotion, but there are only upward promotions, not downward promotions.
 
I am already doing a manual upgrade. But the problem is that the membership group is not updated automatically. I want to do it automatically. The upgrade ends when the manual upgrade ends. There is no problem here. The problem: The user group remains the same.
 
It can add an active membership group while they are an active member, and auto remove it when they are not. I have special features and post banners tied into the active member group. (longer time to edit posts, member banner on posts, self editable title/nickname, longer signature line space, etc)

It doesn't do anything with a potential secondary "former member" group, however. It just takes away the current membership status and makes them a normal member again.
 
Let me explain more clearly. When a member purchases a membership, the upgrade is done manually. There is no problem here. The real problem is; when the membership period ends, the upgrade is dropped. But the membership group is not dropped. How can I solve this?
 
Do you have that group specified in the adcp -> users -> user upgrades ->(your user upgrade name) settings screen?

Your group names will differ from mine, but here is what mine looks like. Highlighted example in yellow.

1743414151630.webp

If so, it should auto add and remove it if they subscribe themselves, or if you do it through the manual process.
(ADCP -> users -> user upgrades -> ACTIONS (on the membership you wish to assign) -> manually upgrade user -> enter their username)
 
In the opening post you say you are manually changing the primary user group, i think a typical user upgrade setup would be to leave the primary group alone and set the upgrade to add the user to a secondary user group with defined permissions then when the upgrade expires the user is removed from that secondary group back and loses any associated additional permissions
 
As has already been mooted the only way to have XenForo automate the "downgrade" for you is to use the XenForo User upgrades system, but it may not be apparent that you can use it even if you don't let your actual forum members "use it". It sounds as if you already have a group setup that grants the various permissions you want when someone has a paid membership, for the sake of this example I'll refer to that group as the "paid membership" group.

So I think your current workflow is:
  1. Someone gives you the money
  2. You manually edit that user to add them to your "paid membership" group
  3. You try to remember when to manually edit them to remove the "paid membership" group when their membership expires.

You want to be using XenForo User upgrades system instead:

You will need a Payment profile in order to add user upgrades. Go to Setup → Payment profiles in your Admin Control Panel (ACP) (/admin.php?payment-profiles/)
You could create a PayPal one - it doesn't have to be real since we wont actually have it enabled to make purchases through. Alternatively you can install https://xenforo.com/community/resources/ozzmodz-test-payment-provider.8754/ which provides a "test" provider which would be safer.

Anyhow once you have at least one payment provider you can setup your upgrade.
So go to Users → user upgrades in your ACP (/admin.php?user-upgrades/).
Click on the Add user upgrade button.
Fill in sensible values (note that you can't set the cost to be 0 unless you manually do that in the database) and set the Length to be however long you want your paid memberships to last for.
Keep the Recurring payments unchecked.
Pick the Payment profile you created earlier.
Check your "paid membership" group in the Additional user groups section.
Finally un-check the Can be purchased box and click Save.

You should now have a user upgrade that looks something akin to:

xf-user-upgrade.webp

It's disabled (little sliding button is white) so shouldn't appear to your members if they go to /account/upgrades. So no one can accidentally try to buy this via your forum. You can however use it from the ACP! The actions drop down menu will allow you to manually apply this User upgrade to a member once they have handed over their money!

xf-user-upgrade-actions.webp

That will kick the upgrade system into action, they will be placed into your "paid membership" group and they will be downgraded out of that group when the Length condition is reached.

So your new workflow would become:
  1. Someone gives you the money
  2. You manually "upgrade" that user via the User upgrades action menu
  3. You sit back and enjoy letting their membership auto expire as per the upgrade settings.
 
Last edited:
Thank you very much for your detailed explanation. At first, I defined paid membership as the primary user group. However, I am now using the secondary user group for paid subscription. However, despite this, the membership of the member whose membership period has expired is not dropped. I follow this from admin.php?logs/user-change. The user group is not removed at this address.

Paypal and other payment systems are not legal in Türkiye. I use a local payment system. However, most payments are made by money transfer. In this case, would you still recommend that I install the following plugin?

 
However, I am now using the secondary user group for paid subscription.
This sounds like you're still manually editing the groups on the user directly instead of applying a user upgrade. XF would always add them as secondary groups, but that isn't a conscious decision you would need to make. If you're applying a user upgrade, XF will remove the groups when it expires. If you manually set a user group by editing the user, it won't.
 
Thank you very much for your detailed explanation. At first, I defined paid membership as the primary user group. However, I am now using the secondary user group for paid subscription.
Generally it seems to be recommended that you use the secondary groups to "add" extra permissions and functionality and leave the primary group as a "common" one for all (or most) members. It sounds like you are now doing this which is good.

However, despite this, the membership of the member whose membership period has expired is not dropped. I follow this from admin.php?logs/user-change. The user group is not removed at this address.
Unless you are using User upgrades as outlined above there is nothing in XenForo to tell it to remove a group after a period of arbitrary time. The User group promotions system can "promote" and "demote", but only based off the available options and none of those are "after some period of time".

Paypal and other payment systems are not legal in Türkiye. I use a local payment system. However, most payments are made by money transfer. In this case, would you still recommend that I install the following plugin?
You certainly don't need to. As mentioned you can just create a Payment profile using PayPal - you are not going to actually attempt to take any payments through Paypal - it's only that you need a Payment profile in order to create a User upgrade. So it's just a "place holder" if you like. You can fill in whatever details you like in the Payment Profile. Call it what you want, put in whatever email address you like. As long as the User Upgrade you then create using it is disabled no one will ever see it.
 
This sounds like you're still manually editing the groups on the user directly instead of applying a user upgrade. XF would always add them as secondary groups, but that isn't a conscious decision you would need to make. If you're applying a user upgrade, XF will remove the groups when it expires. If you manually set a user group by editing the user, it won't.

Unfortunately, when the membership expires, the user group is not removed. I only see the membership expired on this link: admin.php?user-upgrades/expired
 
The User group promotions system can "promote" and "demote", but only based off the available options and none of those are "after some period of time".

Actually, I would have expected it to be removed from the secondary user group when the membership period expired. However, since it did not remove it automatically, I tried to remove it with promotion, but it did not work.

When doing this: User has at least X active promotions: 0

I marked it. However, this does not work to get back the given secondary user group. It only helps me add a different user group. My aim is to lower the user group of someone whose membership period has expired with promotion, but I could not do this.

By the way, I have a local payment profile.
Unless you are using User upgrades as outlined above there is nothing in XenForo to tell it to remove a group after a period of arbitrary time.

I have a payment profile and upgrade. If the payment comes as a transfer, I upgrade manually. If the member buys from the site, there is an automatic upgrade. However, the problem is that when the membership ends, it does not remove the member from the second user group. I am trying to do this using the upgrade system. However, the upgrade works upwards, I could not make it work downwards.. :(
 
I only see the membership expired on this link: admin.php?user-upgrades/expired
By the way, I have a local payment profile.
Cool. As long as you have something then as you are aware you can create User upgrades.

Anyhow, so you are using the User upgrades system then... sorry I thought perhaps you were manually managing everything. So as long as you have a length set on the User upgrade in question, for example:

xf-user-upgrade-length.webp

And you've ticked at least one Additional users groups, for example:

xf-user-upgrade-additional.webp

Then that group will be added when the member is given that User upgrade and removed when that User upgrade expires. However if you have manually also edited that user to be in your "paid membership" group or have competing User group promotions happening I guess things could easily get messed up.

My aim is to lower the user group of someone whose membership period has expired with promotion, but I could not do this.
I would avoid trying to mix the two things. Just leave the User upgrades system to add and remove the extra "paid membership" type group. It certainly does work (in general) as we use it all the time for various "timed" user upgrades.

I guess if you've done all this and it's still not working then I guess maybe one of the periodic (cron) type tasks may not be running or something much more bespoke to your system is happening. You could perhaps try raising a support ticket with XF themselves to see if they can more eloquently debug the situation for you.
 
Back
Top Bottom