We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Earn credits systeme - User Credits | Forum

Hitorino
Hitorino Mar 23 '15
Hi, i set to options the user can earn points if upload a photo.
but i have set with approval and the user can still earn points although i have not approved the photo. and if deletet the foto, the user still have the points and i must remove manuel.
Is there a solution without having to solve all manuel? then the
points should get it actually only if it was approved.
The Forum post is edited by Hitorino Mar 23 '15
ross Team
ross Mar 23 '15
Topic was moved from Bug reports and troubleshooting.
Skalfa LLC Partner
Skalfa LLC Apr 24 '15

Dear Hitorino,


Sorry for taking so long to respond.


Let me explain the situation:


The fact is that the User Credits plugin is not responsible for this behavior. The User Credits works with the core User Roles feature, but it additionally allows to set the positive or negative price for the action, nothing more. So, if a plugin does not work with the authorization actions - it won't work with the User Credits plugin. Here is the authorization method:


if ( !OW::getUser()->isAuthorized('$groupName', '$actionName') )


        {


            $status = BOL_AuthorizationService::getInstance()->getActionStatus('$groupName', '$actionName');


            $this->assign('authMessage', $status['msg']);


            return;


        }


This method is described here: /ow_system_plugins/base/bol/authorization_service.php


As far as we've understood you are talking about the Premoderation plugin. If so, all depends on the functionality of the Photo plugin. Photo plugin should call the method which gives or deducts credits for this or that action. And only Photo plugin can check when and how, before or after the content is approved, the credits should be given/taken. User credits plugin cannot affect this functionality.


The same situation is in the content removal, Oxwall does not provide any methods which can be used for these purposes. Thus, the behavior you described is possible just in case the system will record each content and each user who has been granted for this or that action. 

And in case a content is removed - the system should find a user who added this content and remove the granted credits from their balance. 


As I said it requires creating your own methods which will cares of a content, a user who added this content and amount of credits granted to this user.


There are two negative sides of such behavior:


User side - a user added a photo, received 20 credits for this action, then this photo was removed for some reason and 20 credits simply disappeared from the user's balance. Don't you think this will really confuse the site members?


Admin/Server side - the functionality you want to implement is quite heavy, here is why:


Let's say you have 10000 users, your site activity is quite high. Each user adds one content unit everyday = 10000 content units. i.e. +10000 entries to the table which collects the information about the content, user who added this content and amount of credits granted to this user. 20 days = 200000 entries. The system should process this table: adds new entries, deletes old one and searches for required. This will be quite heavy process for the server and can lead to the site loading delays.


When we were developing the User Credits plugin we considered that the admins will configure the plugin to grant users for the actions. But mainly, this plugin was developed to monetize the site, i.e. to set the negative values for the price to force users to buy credits. If you want to use this plugin another way, you need to make changes in the plugin functionality.


We need you to understand that there are a lot of ways how the credits can be used on the site and we cannot cover all of them by default plugin functionality. We provide basic functionality and it's up to you if you want use it as is or customize it for your needs.


hope my explanation is clear enough. If not, please don't hesitate to get back to me for clarifications or additional instructions.

You do not have permission to reply this topic