/ Published in: JavaScript
For a way to add quick "join group" functionality to your group list page - put this code in your AC footer (wrapped in script tags).
--
For more tips and tricks checkout the <a href="http://www.kickdeveloper.com/resources">KickApps resources page</a>.
--
For more tips and tricks checkout the <a href="http://www.kickdeveloper.com/resources">KickApps resources page</a>.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if (Ka.Info.PAGE === "search/searchPage.jsp" && Ka.Util.getLocationParam('mediaType') === 'group') { $j(function() { var userid = Ka.Info.USERID; var aff = Ka.Info.AFFILIATESITEID; $j('#ka_contentContainer li.ka_list').each(function() { var $li = $j(this); var group = $li.find('h4 a:first').attr('href').match(/\/(\d.*)\//)[1]; var $button = $j('<button>Join Group</button>').click(function() { KickAppsBizComponent.joinClub(group, userid, aff, function(joined) { if (joined) { $button.text('joined').attr('disabled', 'disabled'); } }); }); KickAppsBizComponent.isUserMemberOfClub(userid, group, aff, function(isMember) { if (!isMember) { $li.append($button); } }); }); }); }