By User on Thursday, 13 June 2019
Posted in General Issues
Replies 1
Likes 0
Views 545
Votes 0
Hello. I created simple "videos.badge" file with standart EasySocail commands: video.upload, video.like & video.comment.add (with friqency: 3) for test. File attached.
It was cucessfully installed to backend (on test / non live site).

I tried to add linked videos in stream - it doesn't work.
I tried to like videos in stream and in video single page - it doesn't work.
I tried to comment videos in stream and in video single page - it doesn't work.
I didn't get any badge.

My goal is to get badge by "Achieve Type: By Frequency" (3 times, for example = add 3 videos to get badge) and not by Points.

What I'm doing wrong?



[
{
"title" : "Video Uploader",
"alias" : "video-uploader",
"description" : "You are the best in video uploading",
"howto" : "Add 3 videos",
"command" : "video.upload",
"extension" : "com_easysocial",
"avatar" : "media/com_easysocial/badges/photogenic.png",
"frequency" : 3
},
{
"title" : "Video Liker",
"alias" : "video-liker",
"description" : "You are the best in video liking",
"howto" : "React to 3 videos",
"command" : "video.like",
"extension" : "com_easysocial",
"avatar" : "media/com_easysocial/badges/journalist.png",
"frequency" : 3
},
{
"title" : "Video Commentator",
"alias" : "video-commentator",
"description" : "You are the best in video commenting",
"howto" : "Comment 3 videos",
"command" : "video.comment.add",
"extension" : "com_easysocial",
"avatar" : "media/com_easysocial/badges/photo-tagger.png",
"frequency" : 3
}
]


Thanks.

Updated: I also try to edit file: /www/****.ru/components/com_easysocial/controllers/videos.php
and add code:
// Assign badge for the person that...
ES::badges()->log('com_easysocial', 'video.upload', $this->my->id, 'Some text');

or this:
Foundry::badges()->log( 'com_easysocial' , 'video.upload' , $userId , JText::_( 'Some text.' ) );

but may be I chosed wrong place to put it?

Can you please give me a hint?

PS: I'm suprised that this badges not included to default list
Hey there,

For the following code, you need to add it at the function of onAfterLikeSave() of JoomlFolder/media/com_easysocial/apps/user/videos/videos.php:

ES::badges()->log('com_easysocial', 'video.like', $likes->created_by, 'test');


add the code above after the following code:

ES::points()->assign('video.like', 'com_easysocial', $likes->created_by);


Note: If you want this to apply on the group, event and page as well, same place to add but different paths which are :
JoomlFolder/media/com_easysocial/apps/group/videos/videos.php
JoomlFolder/media/com_easysocial/apps/event/videos/videos.php
JoomlFolder/media/com_easysocial/apps/page/videos/videos.php

______________________________________________________________________

For the following code, you need to add it at the function of onAfterCommentSave() of JoomlFolder/media/com_easysocial/apps/user/videos/videos.php:

ES::badges()->log('com_easysocial', 'video.comment.add', $actor->id, 'Some text');


add the code above after the following code:

ES::points()->assign('video.comment.add', 'com_easysocial', $comment->created_by);


Note: If you want this to apply on the group, event and page as well, same place to add but different paths which are :
JoomlFolder/media/com_easysocial/apps/group/videos/videos.php
JoomlFolder/media/com_easysocial/apps/event/videos/videos.php
JoomlFolder/media/com_easysocial/apps/page/videos/videos.php

______________________________________________________________________

For the following code, you need to add it at the function of save() of JoomlFolder/administrator/components/com_easysocial/includes/video/video.php:

ES::badges()->log('com_easysocial', 'video.upload', $data['uid'], 'Some text');


add the code above after the following code:

ES::points()->assign('video.upload', 'com_easysocial', $this->getAuthor()->id);


Take note that you need to replace these files back if you got update your EasySocial to the next version.

We will consider to add this into EasySocial in the future.
·
Thursday, 13 June 2019 12:37
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post