A series of changes to push Elgg's approach to themes in a more CSS driven direction...
[elgg.git] / units / communities / communities_members.php
blob2e3e6aff658ccbce5efde2a835d0fa2f6e0fb32b
1 <?php
3 // Given a user ID as a parameter, will display a list of communities
5 $url = url;
7 if (isset($parameter[0])) {
9 $user_id = (int) $parameter[0];
11 $result = db_query("select users.*, friends.ident as friendident from friends
12 left join users on users.ident = friends.owner
13 where friends.friend = $user_id and users.user_type = 'person'");
15 $body = <<< END
16 <div class="networktable">
17 <table>
18 <tr>
19 END;
20 $i = 1;
21 if (sizeof ($result) > 0) {
22 foreach($result as $key => $info) {
23 // $info = $info[0];
24 if ($info->icon != -1) {
25 $icon = db_query("select filename from icons where ident = " . $info->icon . " and owner = " . $info->ident);
26 if (sizeof($icon) == 1) {
27 $icon = $icon[0]->filename;
28 } else {
29 $icon = "default.png";
31 } else {
32 $icon = "default.png";
34 list($width, $height, $type, $attr) = getimagesize(path . "_icons/data/" . $icon);
35 if (sizeof($parameter[1]) > 4) {
36 $width = round($width / 2);
37 $height = round($height / 2);
39 $friends_username = stripslashes($info->username);
40 $friends_name = htmlentities(stripslashes($info->name));
41 // $friends_menu = run("users:infobox:menu",array($info->ident));
42 $body .= <<< END
43 <td>
44 <p>
45 <a href="{$url}{$friends_username}/">
46 <img src="{$url}_icons/data/{$icon}" width="{$width}" height="{$height}" alt="{$friends_name}" border="0" /></a><br />
47 <span class="userdetails">
48 {$friends_name}
49 </span>
50 </p>
51 </td>
52 END;
53 if ($i % 5 == 0) {
54 $body .= "</tr><tr>";
56 $i++;
58 } else {
59 $body .= "<td><p>". gettext("This community doesn't currently have any members.") . "</p></td>";
61 $body .= <<< END
62 </tr>
63 </table>
64 </div>
65 END;
68 $run_result = $body;