Created
January 7, 2014 13:54
-
-
Save normansolutions/8299614 to your computer and use it in GitHub Desktop.
For use on blog post: http://www.normansolutions.co.uk/post/creating-a-firefly-online-users-feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<br/> | |
<h3>Most recent visitors</h3> | |
<script> | |
(function doPoll() { | |
var count = 0; | |
$.ajax({ | |
url: "http://YOUR_DOMAIN_NAME/plugins/clientaspxfiles/stmwhoonline.aspx", | |
dataType: "json", | |
success: function (json) { | |
var strHtml = '<ul>'; | |
for (var i = 0; i < json.length; i++) { | |
strHtml += '<li><a href=\profile?guid=' + json[i].guid + ' title=' + json[i].logged + '>' + json[i].user + '</a></li>'; | |
count++; | |
} | |
strHtml += '</ul>'; | |
if (count < 10) { | |
$("#online").html(strHtml).hide().fadeIn(); | |
} else { | |
$("#online").html(strHtml); | |
} | |
} | |
}); | |
setTimeout(doPoll, 10000); | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment