By Ron Wade-Megghross on Friday, 15 May 2015
Posted in General Issues
Replies 4
Likes 0
Views 698
Votes 0
Hi,

I want to create different badges based on frequency of an action.

For example, I would like to award a badge if someone reads 10 articles. I would like to award another badge if that person reads 20 articles, and another badge for 50 articles, and so on.

Another example. Someone may get a badge for having 10 friends, then a different badge for having 20 friends, and so on.

The problem is that I don't see a way to duplicate badges and change just the frequency of the action involved.

How do I accomplish this?
Hi Ron,

Currently, this feature is not available in Easysocial.

However you can try this following method for the time being,

Create a badge file and after that save it as filename.badge.

http://screen.stackideas.com/badgecustom05.png

search for the file easysocial.php under the file path JoomlaFolder\plugins\content\easysocial\easysocial.php.

Refer to line 150 this is an example for the read Joomla article page.

and add the following code.
http://screen.stackideas.com/badge_custom_s1.png

Login to your backend->Components->Easysocial->Badges->Choose file filename.badge->upload & Install.

Regarding the friend badge, you can do the same thing as I mentioned above (create a new badge file) ->sample file (JoomlaFolder\administrator\components\com_easysocial\defaults\badges\friends.badge) - command `friends.create`

Then the following file will trigger the friend,create command (LINE 877)
JoomlaFolder\administrator\components\com_easysocial\models\friends.php

Hope that helps .

Best regards
Chris
·
Friday, 15 May 2015 17:50
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Chris, thanks for your reply.

I realized that I don't have the easysocial content plugin installed, and I can't find it on your site. Can you provide the link?

Also, using the example you gave above, would I have to create separate triggers for each new badge as shown below?

Foundry::badges()->log( 'com_content' , 'read.article2' , $userId , JText::_( 'Read an article' ) );

Foundry::badges()->log( 'com_content' , 'read.article3' , $userId , JText::_( 'Read an article' ) );


And finally, can you tell me which database table keeps track of how many times a trigger has been called?

Thanks
·
Tuesday, 19 May 2015 03:33
·
0 Likes
·
0 Votes
·
0 Comments
·
sub++
·
Tuesday, 19 May 2015 05:08
·
0 Likes
·
0 Votes
·
0 Comments
·
hi Ron Wade-Megghross,

Sorry for late reply to this,

You can download the app here and install from your backend > Easysocial > Application > install

Yes, you have to create a separate trigger to achieve this and separate with your new badge file.

This table will be take responsible to store the badge record -> `#__social_badges_history`

Hope this help.
·
Wednesday, 20 May 2015 17:03
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post