By Haki Saki on Tuesday, 21 February 2017
Posted in General
Replies 6
Likes 0
Views 134
Votes 0
I'm trying to get this 3rd party quiz app to work which has some ES point integration capabilities. I want (potentially) each quiz taken to award a different amount of ES points... they are saying "Easysocial does not have custom points capability. You must set points in the rule file." What does this mean? It looks like the standard rules that come with ES (invite friend, register, etc..) have the ability to set the point value..why wouldn't a 3rd party app have the ability to assign multiple point values? thoughts?
It should be allow 3rd party to set custom point to retrieve those reward from there action, may i know your developer get back to you yet regarding with my previous reply?

https://stackideas.com/forums/points-set-in-rules-file-are-ignored#reply-317651
·
Tuesday, 21 February 2017 10:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Alex,

Our previous issue was resolved after reconfiguring the rules file.

However I do not find any custom points assigning code in the documentation. Could you please point me to the right direction?

https://stackideas.com/docs/easysocial/developers/points/logging
·
Tuesday, 21 February 2017 15:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks getting back to us Maverick.

Actually I have a little bit lost here, what do you mean by the "custom point"?

Is it you mean you would like to set the custom point for specific point rule so user can reward this point from what you set?
- screenshot : http://take.ms/iZdiac

Or do you mean you would like to set 1 extra custom point for the user without go through the point rule?
·
Tuesday, 21 February 2017 22:39
·
0 Likes
·
0 Votes
·
0 Comments
·
I need to go through the rule file but to assign whatever the amount of points decided by the component.

If this is not possible, can it be done without rule?

The requirement is to assign X number of points configured in each quiz.

If I trigger the rule, i get same points as configured but it is not what we need.
·
Tuesday, 21 February 2017 23:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Try this following assignCustom function code and see how it goes?

[gist type="php"]
$lib = ES::points();

$user = ES::user($userId);

$lib->assignCustom($user->id, $points, $message);
[/gist]

I believe this function is what you looking for, what this function does is assign custom point to the user, in your case you do not need to add any point rule file, just pass in userid, point, and the reward message, so those data will store in the #__social_points_history table.
·
Wednesday, 22 February 2017 15:49
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post