By William E Workman on Tuesday, 03 October 2017
Posted in Technical Issues
Replies 1
Likes 0
Views 808
Votes 0
I'm having a difficult time following your documentation on adding custom badges. In the logging achievement actions section, it indicates that adding "2 liner code below in your own extension logic:" What extension logic? Are you saying to paste these two lines at the end of the .badge file containing the rules that I defined in the previous step?

I don't see where to place this .badge file once it's completed.

When i try to install the badge file through the backend "install" interface, i get a blank blue screen, and no changes in the achievements list.
When I place the badge file manually inside the folders:

administrator/components/
media/com_easysocial/apps/users/
media/com_easysocial/apps/fields/

no new rules are added and again no change is showing on the achievements listing. I feel like I am missing something, perhaps something to do with the final step in your documentation -- "..All you need to do is to embed the 2 liner code below in your own extension logic:" I have no idea what extension logic you are referring too. Thanks

P.S. Also, how do I know what commands are available to define points and badge rules for? Is there a creative syntax or are they all predefined? EX: anyobject.anyaction = command
Hey William,

That 2 liner code you shouldn't add into your custom .badge file, what this 2 liner code we mentioned here is you can use this method to achieve your custom badge for your site user.

To implement this, first you have to understand how user get your custom badge first.

Let me use one of the example to explain this :

>> One of the existing search badge in Easysocial

1. First you have to create similar this rules file and store it as this file format .badge , you can take a look this example located at this file location JoomlaFolder/administrator/components/com_easysocial/defaults/badges/search.badge

2. That command section you have to set any keyword for this but make sure your command is unique e.g. you can put something like custom.searchbadge and this command is very important.

3. Once you created the rules file, you can upload your custom .badge file from backend > Easysocial > achievement > install

4. Once you installed, this badge will appear on backend > Easysocial > achievement listing

5. How the user get this build-in search badge in Easysocial, you have to add one line of code into this function, you can open this file -> JoomlaFolder/components/com_easysocial/controllers/search.php
screenshot : http://take.ms/QSTn3
This code function is when the user trying to search something in Easysocial, it will go through this method from this php file, so system will stored this who perform this search, it will log 1 record into database.

I hope my explanation will help you understand more about this.

By the way, if you still unable to install it, can you zip your .badge file then attach into your next reply so I can better have a check and see whether you have wrote the correct syntax?

And can you share with us how you want to allow your site user to achieve your custom badge?
·
Wednesday, 04 October 2017 11:08
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post