By MD King on Friday, 23 May 2014
Posted in General Issues
Likes 0
Views 1K
Votes 0
Trying to figure out a workaround to something that really seems like it should be native to ES. Custom, admin assigned badges. You can do this function in Easy Discuss - simple, effective, works...

So, I have tried uploading a custom poweredby.badge to the admin/com/com_easysocial directory - discovered, but not imported - code below:
[
{
// The title of the badge.
"title" : "Powered By",

// The description of the badge
"description" : "Users that power the site",

// The steps needed to unlock this badge.
"howto" : "To unlock this badge, contribute $20/month.",

// The alias of the badge.
"alias" : "poweredby",

// The extension for this badge.
"extension" : "com_easysocial",

// The badge command.
"command" : "admin.task.manual"

// The default avatar for this rule. Relative to the site's document root a.k.a (JPATH_ROOT)
"avatar" : "media/com_easysocial/badges/poweredby.png",

// When user creates a new discussion for 15 times.
"frequency" : 1
}
]

Discover sees the file, and does nothing.

Next try to upload the .badge file directly - says error reading file (tried different encoding, nothing)

So, try to add the badge to another component - Easy Discuss.
Works! Nice and simple - no muss, no fuss, assigned to user, done.

View users profile in ES - it doesn't show badges from other components ??
It also does not show on the MENU>ES>BADGES page.

Earning custom admin only badges should be a no brainer, it works in ED like a charm, should be a standard ES feature -

Is there a way to display other component badges, especially custom ones, on the users ES profile?

(This would provide a nice workaround for your multi-component subscribers - just saying)
Hello,

Hm, if it is displayed as installed, then it basically means that the rule has been installed but it shouldn't list as installed every time you run because if it is installed already it will never install again.

Try this instead


[
{
"title" : "Powered By",
"description" : "Users that power the site",
"howto" : "To unlock this badge, contribute $20/month.",
"alias" : "poweredby",
"extension" : "com_easysocial",
"command" : "admin.task.manual",
"avatar" : "media/com_easysocial/badges/poweredby.png",
"frequency" : 1
}
]
·
Saturday, 24 May 2014 14:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Hm, try removing the "comments" from the json file. We are now no longer relying on 3rd party libraries to encode / decode json contents (Extremely heavy). We are relying on php's native json_encode and json_decode.

Also, if the rule has already been discovered, it will not re-discover it again. Double check and see if the rules are already imported in the Badges area?
·
Friday, 23 May 2014 12:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Shows the badge imported every time, see below:


Not sure what you mean by "remove comments" - can you provide an example?
Thanks!
·
Saturday, 24 May 2014 03:44
·
0 Likes
·
0 Votes
·
0 Comments
·
That worked! Thanks - going to do the happy dance!!
·
Sunday, 25 May 2014 05:28
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Sunday, 25 May 2014 13:30
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post