Any tips on to how to code the assigning of a badge to the user logged once an "if" condition is met?
<#if finished> window.setTimeout( function(){ $('#imageIncomplete').fadeOut(1500); }, 4000); window.setTimeout( function(){ $('#imageSuccess').fadeIn(1500); }, 4000) < -- #I want to assign badge here --> ; </#if>
I got a temp solution by making an Advanced Badge Rule, however what I really want to do for a custom solution is to write to the database a var condition that is met, and that global variable can be used in an advanced badge rule in cases there is not a predefined rule.
I used this to check to see if defaults were changed in profile.
setting.profile.signature != 'default'
Create complex badge rule formulas with the Advanced Editor
About badge rules and supported badge criteria
http://community.lithium.com/t5/Badges/About-badge-rules-and-supported-badge-criteria/ta-p/117227
The easiest to achieve what I understand you want to achieve (which might be wrong, so please feel free to share some more background about your badging example):
Very helpful. This sounds like it will work however, any idea what is the script to add a logged in user to a role?
Thanks!
Ryan
I published a couple of bits and bobs that add roles to users for different purposes. Maybe you'll find something helpful in there.
http://community.lithium.com/t5/Developers-Discussion/Badge-for-consecutive-daily-logins/m-p/207446
Long story short, add or remove a role:
<#assign result = restadmin("/roles/name/<role>/users/add?role.user=id/${user.id}")/>
<#assign result = restadmin("/roles/name/<role>/users/remove?role.user=id/${user.id}")/>
Welcome to the Technology board!
Curious about our platform? Looking to connect on social technology? You've come to the right place!