- Posts: 78
- Thank you received: 1
Add an option to restrict articles older than X days
- jan44
- Topic Author
- Offline
- Senior Member
Less
More
2 months 3 days ago #169737
by jan44
Add an option to restrict articles older than X days was created by jan44
Hello!
I’m trying to add a new option to the Membership Pro plugin to restrict access to articles after a certain number of days (e.g., after 3 days, articles would be viewable only by members). Currently, the plugin has an option to release articles after X days, but I need to do the opposite.
What I’ve Tried:
Plugin Code (osmembershiparticles.php):
I identified the isArticleReleased function, which currently makes articles available after X days. I think I could create a similar function, like isArticleRestrictedAfterDays, to restrict instead.
Configuration (osmembershiparticles.xml):
I added a new field, restrict_articles_after_x_days, to specify the number of days before restriction. It appears in the settings, but I’m unsure how to fully integrate it.
Templates (form.php, advanced.php):
Added input fields to show the new setting for administrators.
Could you advise on how to:
Properly implement a restriction function like isArticleRestrictedAfterDays?
Integrate this function with the current plugin logic?
Any guidance would be appreciated. Thank you!
Or maybe the best it to create new plugin (copy of origianl one) to keep this working in case of updates ?
Thanks a lot !
I’m trying to add a new option to the Membership Pro plugin to restrict access to articles after a certain number of days (e.g., after 3 days, articles would be viewable only by members). Currently, the plugin has an option to release articles after X days, but I need to do the opposite.
What I’ve Tried:
Plugin Code (osmembershiparticles.php):
I identified the isArticleReleased function, which currently makes articles available after X days. I think I could create a similar function, like isArticleRestrictedAfterDays, to restrict instead.
Configuration (osmembershiparticles.xml):
I added a new field, restrict_articles_after_x_days, to specify the number of days before restriction. It appears in the settings, but I’m unsure how to fully integrate it.
Templates (form.php, advanced.php):
Added input fields to show the new setting for administrators.
Could you advise on how to:
Properly implement a restriction function like isArticleRestrictedAfterDays?
Integrate this function with the current plugin logic?
Any guidance would be appreciated. Thank you!
Or maybe the best it to create new plugin (copy of origianl one) to keep this working in case of updates ?
Thanks a lot !
Please Log in or Create an account to join the conversation.
- jan44
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 1
3 days 17 hours ago #170554
by jan44
Replied by jan44 on topic Add an option to restrict articles older than X days
Any idea is welcome
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
3 days 15 hours ago #170561
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Add an option to restrict articles older than X days
For this, you will need to find a developer to help you. Better create a new plugin base on existing plugin so that the function won't be lost when you update to future releases of the extension
Regards,
Tuan
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- jan44
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 1
3 days 13 hours ago #170563
by jan44
Replied by jan44 on topic Add an option to restrict articles older than X days
Can you help me as developper and as you know better the product ?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
3 days 11 hours ago #170565
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Add an option to restrict articles older than X days
Sorry, that would be a custom plugin, so you will need to pay for the development if it is really needed
Regards,
Tuan
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- jan44
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 1
2 days 17 hours ago #170589
by jan44
Replied by jan44 on topic Add an option to restrict articles older than X days
Yes its ok for me, how to proceed ?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
1 day 17 hours ago #170607
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Add an option to restrict articles older than X days
Hello
Please submit a support ticket to Membership Pro category. I will tell you the next steps from there
Regards,
Tuan
Please submit a support ticket to Membership Pro category. I will tell you the next steps from there
Regards,
Tuan
The following user(s) said Thank You: jan44
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.