By Karen Laksamana on Thursday, 02 February 2017
Posted in Technical Issues
Likes 0
Views 785
Votes 0
Where are the .points files in EasySocial?

Is it possible to write a new points rule based on an EasySocial action? I'd like a rule that assigns points when a user comments on a post that is on a Page. I looked at the developer documentation, but that looks like it's instructions on creating rules for a custom app or 3rd party extension to integrate with ES. Is it possible to extend the core EasySocial rules? Where do you come up with the commands?

Also, it's possible to put a max limit on points for a rule, but it is possible to set a daily or weekly limit?

Thanks, Karen
Hey Karen,

Where are the .points files in EasySocial?

Most of the Easysocial point rules files located at

JoomlaFolder/administrator/components/com_easysocial/defaults/points/..
JoomlaFolder/media/com_easysocial/apps/users/...
JoomlaFolder/media/com_easysocial/apps/fields/...


Is it possible to write a new points rule based on an EasySocial action? I'd like a rule that assigns points when a user comments on a post that is on a Page. I looked at the developer documentation, but that looks like it's instructions on creating rules for a custom app or 3rd party extension to integrate with ES. Is it possible to extend the core EasySocial rules? Where do you come up with the commands?

Actually this documentation is quite similar how to create the point rules which extend to Easysocial rules.
https://stackideas.com/docs/easysocial/developers/points/points

But currently we do not have any point rules for Page comment yet, so we do not have fixed command for that, you can set what command you would like to use from the point rules, you can download my attached file to see some example.

Once you create point rules file, you have to install from your backend > Easysocial > user point > install > upload that point rule file

After you done that, you have to add this similar php code into Easysocial core file.

For example : If you would like to add those comment point in Page story stream, you have to add following code into this php file -> JoomlaFolder/media/com_easysocial/apps/page/story/story.php

[gist type="php"]
// @points: photos.comment
// Assign points for the author for comment this item
$points = ES::points();
$points->assign('pages.commentstory.add', 'com_easysocial', $comment->created_by);

[/gist]
screenshot : http://take.ms/q9AAt

Note : all those php code variable you have to double check like which you would like to add point to him.

Also, it's possible to put a max limit on points for a rule, but it is possible to set a daily or weekly limit?

Unfortunately that was not possible at this point of time.
·
Thursday, 02 February 2017 11:10
·
0 Likes
·
0 Votes
·
0 Comments
·
I'm not really clear on how you came up with what command to use... do you just have a list of them that EasySocial recognizes?

Regardless of how well I understand the process, I duplicated exactly what you said to do and it works. I now have a points rule for commenting (or commenting with a photo) on a page and my user earns points for it! Thank you!

BTW, I could find no files ending in .points in the locations you mentioned. I was trying to find them for reference incase there are other rules I want to create going forward.

For now, thank you for helping me customize the code!
·
Thursday, 02 February 2017 14:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Oh btw, if I wanted to create this file where I added the points code as an override, what would be the correct path?

JoomlaFolder/media/com_easysocial/apps/page/story/story.php

Override path:
JoomlaFolder/templates/MY_TEMPLATE/html/com_easysocial/....??
·
Thursday, 02 February 2017 14:39
·
0 Likes
·
0 Votes
·
0 Comments
·
I've checked again, it seems like we didn't include these point rules file from the installer is because everything automatically discover it during the installation.

If you would like to check those point command sample, you can download my attached file.


Oh btw, if I wanted to create this file where I added the points code as an override, what would be the correct path?

JoomlaFolder/media/com_easysocial/apps/page/story/story.php

Override path:
JoomlaFolder/templates/MY_TEMPLATE/html/com_easysocial/....??

Unfortunately that is not possible to template override this function php file. For those template override feature only available for theme file. For now you have to temporary backup this file before you update.

If you would like to request this add into Easysocial core file in the future, I would suggest you start a new thread and select "Easysocial - Feature request" category for request this feature (not just only for PAGE, for another group/event as well), if a lot of user request this, we will definitely consider implement this in the future.
·
Thursday, 02 February 2017 22:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you! I really appreciate your support. You went the extra mile to help me create the rule I needed and that was fantastic!
·
Saturday, 04 February 2017 04:54
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Karen, glad that your issues are resolved now
·
Saturday, 04 February 2017 10:36
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post