In our project we want to allow users to do a specific amount of things according to their level of suscription in CBSubs. For instance:
"user junior" can write 3 com_content articles,
"user professional" can write 5 articles
and "user premium" can write 10
We want to do that not only with com_comtent but with other custom joomla extensions that we have created.
I was wondering if you have any idea about how to do that.
My initial idea is:
- to create a CB_FIELD called max_articles.
- This field is non editable by user
- With autoaction I change this field everytime user changes it's type of suscription. For instance, if the user it becomes a CBSubs "user professional" autoaction will set this value to 5. If user cancel hes/shes subscription the CB_FIELD value turns to 0 (and unpublish previous articles).
- I do a joomla plugin that before the user can add a "article" checks the CB_FIELD "max articles" and if the user have done 5 it will redirect to a page that says that he/she needs to upgrade hes/shes membership.
What do you think? do you have a better idea?
Thanks very much.
By the way forum readers: autoactions rocks! if you haven't tested try it:
autoactions
- With autoaction I change this field everytime user changes it's type of suscription. For instance, if the user it becomes a CBSubs "user professional" autoaction will set this value to 5. If user cancel hes/shes subscription the CB_FIELD value turns to 0 (and unpublish previous articles).
I suggest CBSubs Fields for this as it alters a fields value (integer fields can be incremented with different operators) based off subscription status. You can use CB Auto Actions though if you prefer as the latest release now comes with CBSubs triggers.
- I do a joomla plugin that before the user can add a "article" checks the CB_FIELD "max articles" and if the user have done 5 it will redirect to a page that says that he/she needs to upgrade hes/shes membership.
That would absolutely work. I suggest checking out the below tutorials for using CB API to check the fields value.
With the above 2 you'll have CBs API loaded into your plugin and have a CB user object so you can access field values directly with $user->MYFIELD.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.