Points for posts

12 years 4 months ago #182502 by softforge
Points for posts was created by softforge
Would be be possible to use the current GroupJive API to write a plugin that charges AlphaUserPoints for posts within Groups?

In our use case, we allow people to buy points and we want to "charge" points to post within groups. Ideally we could charge different amounts for different types of posts (eg. wall = 2 points / image = 5 points / video = 10 points / etc.) and disallow posting if not enough points are owned.

We are more then happy to develop this plugin and release it when its ready, if it is possible to develop.

Any comments or pointers will be greatly appreciated :)

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

Please Log in to join the conversation.

12 years 4 months ago #183023 by krileon
Replied by krileon on topic Re: Points for posts
Charges points for wall posts? You don't need to write anything to do this. GJ has plenty of triggers so you'd just need to use CB Auto Actions and its AlphaUserPoints action to subtract points on the gjint_onAfterCreateWall trigger.


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.

Please Log in to join the conversation.

12 years 4 months ago #183034 by softforge
Replied by softforge on topic Re: Points for posts
That's fantastic, thanks for your replay!

Would this solution be able to prevent users from posting if the cost of the post took them below 0 points?

Thanks again!

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

Please Log in to join the conversation.

12 years 4 months ago #183068 by krileon
Replied by krileon on topic Re: Points for posts

Would this solution be able to prevent users from posting if the cost of the post took them below 0 points?

Yup, create a redirect action just before the points deduction action with the trigger gjint_onBeforeCreateWall have a condition check if points is equal to 0 then redirect. Unfortunately you won't be able to dynamically redirect back to the group. Next release of CB Auto Actions the redirect action will review allow you to specify special tags (e.g. {goback}) for the URL to redirect back. You'd also want to put a condition on the AUP action to check that the points are greater then 0. To do this you'll need to use CB Query Field to perform a database query to obtain their points count and use that field as the substitution.


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.
The following user(s) said Thank You: softforge

Please Log in to join the conversation.

12 years 4 months ago #183090 by softforge
Replied by softforge on topic Re: Points for posts
Amazing!!! :)

I'm going to try and set this up right now, I'll let you know how it goes.

For the moment, I can forward them to a page that says you need to buy more credits but ideally, like you say, {goback} would be best especially is it can retain their message (I can imagine users getting annoyed if they forget they haven't got enough credits and loose their message when they post).

Many many thanks for all your great work!

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

Please Log in to join the conversation.

12 years 4 months ago #183095 by softforge
Replied by softforge on topic Re: Points for posts
It works fantastically, what an elegant solution!!!

The redirect forwards the user to the buy points page with a relevant message and if you click back, the wall post is still there (although this may be Firefox being helpful). I did the condition check with an select statement with substitution in brackets on the #__alpha_userpoints table, I assume there is no better way.

The only problem I found was when using multiple triggers in 1 action. When I changed the single triggers to the following, none of them worked:

gjint_onBeforeCreateWall,gjint_onBeforeCreateEvent,gjint_onBeforeCreateFile,gjint_onBeforeCreatePhoto,gjint_onBeforeCreateVideo

gjint_onAfterCreateWall,gjint_onAfterCreateEvent,gjint_onAfterCreateFile,gjint_onAfterCreatePhoto,gjint_onAfterCreateVideo

We can create 1 action for each trigger as we probably want to charge different point amounts for the different types of posts but I'm guessing this is a bug you would want to look into.

Huge thanks again for this amazing system!!! :)

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.218 seconds

Facebook Twitter LinkedIn