Simple status box for the sidebar.
[elgg_plugins.git] / similarusers / lib.php
blobddccad9a90c86e48321fb6fe446d41e17227e41f
1 <?php
3 function similarusers_pagesetup() {
4 // Dummy function
7 function similarusers_get_users($userid, $limit = 25) {
8 global $CFG;
9 return get_records_sql("select u.*, count(t.tag) as metric from {$CFG->prefix}tags t join {$CFG->prefix}users u on u.ident = t.owner where t.tagtype = \"interests\" and t.owner <> {$_SESSION['userid']} and tag in ( select tag from {$CFG->prefix}tags where tagtype = \"interests\" and owner = {$_SESSION['userid']} ) group by u.ident order by metric desc limit $limit");