3 // Given a user ID as a parameter, will display a list of communities
5 if (isset($parameter[0])) {
7 $user_id = (int) $parameter[0];
9 $result = get_records_sql('SELECT u.*, f.ident AS friendident FROM '.$CFG->prefix
.'friends f
10 JOIN '.$CFG->prefix
.'users u ON u.ident = f.friend
11 WHERE f.owner = ? AND u.user_type = ?', array($user_id,'community'));
14 <div
class="networktable">
19 if (!empty($result)) {
21 if (sizeof($result) > 4) {
24 foreach($result as $key => $info) {
25 $friends_name = run("profile:display:name",$info->ident
);
26 $info->icon
= run("icons:get",$info->ident
);
27 $friends_menu = run("users:infobox:menu",array($info->ident
));
31 <a href
="{$CFG->wwwroot}{$info->username}/">
32 <img src
="{$CFG->wwwroot}_icon/user/{$info->icon}/w/{$w}" alt
="{$friends_name}" border
="0" /></a
><br
/>
33 <span
class="userdetails">
34 <a href
="{$CFG->wwwroot}{$info->username}/">{$friends_name}</a
>
46 if ($user_id == $_SESSION['userid']) {
47 $body .= "<td><p>". __gettext("You don't have any communities listed! To join a community, click the 'join' button underneath a community's icon. You can find communities you're interested in by using the search function.") ."</p></td>";
49 $body .= "<td><p>". __gettext("This user is not currently a member of any communities.") ."</p></td>";