Simple status box for the sidebar.
[elgg_plugins.git] / sitemembers / lib.php
blob84f6075c9c2478fa5968d01b18e4f0393af9fd46
1 <?php
3 function sitemembers_pagesetup() {
6 function sitemembers_init() {
8 global $CFG;
9 $CFG->templates->variables_substitute['sitemembericons'][] = "sitemembers_random_users";
13 function sitemembers_random_users($vars) {
15 global $CFG;
16 if (!isset($vars[1])) {
17 $numberofusers = 9;
18 } else {
19 $numberofusers = (int) $vars[1];
22 $html = "";
24 if ($users = get_records_sql("select * from ".$CFG->prefix."users where icon <> -1 and user_type = 'person' order by rand() limit $numberofusers")) {
25 foreach($users as $user) {
27 $html .= "<a href=\"{$CFG->wwwroot}{$user->username}\"><img src=\"{$CFG->wwwroot}_icon/user/{$user->icon}/h/67/w/67\" alt=\"" . htmlspecialchars($user->name) . "\" /></a> ";
32 return $html;