Fixing a small css issue in the user class.
[elgg.git] / units / friends / profile_friends.php
blob141d72792ef2215b5e9877fc074892a198170a8d
1 <?php
2 global $CFG;
3 global $page_owner;
5 if ($page_owner != -1 && (user_type($page_owner) == "person" || user_type($page_owner) == "external")) {
6 $friends = array();
7 if ($result = get_records_sql('SELECT DISTINCT u.ident,1 FROM '.$CFG->prefix.'friends f
8 JOIN '.$CFG->prefix.'users u ON u.ident = f.friend
9 WHERE f.owner = ? AND u.user_type = ? order by u.last_action desc LIMIT 8',array($page_owner,'person'))) {
10 foreach($result as $row) {
11 $friends[] = (int) $row->ident;
14 $run_result .= "<li id=\"sidebar_friends\">";
15 if ($page_owner != $_SESSION['userid']) {
16 $run_result .= run("users:infobox",
17 array(
18 __gettext("Friends"),
19 $friends,
20 "<a href=\"".url."_friends/?owner=$profile_id\">[" . __gettext("View all Friends") . "]</a>"
24 } else {
25 $run_result .= run("users:infobox",
26 array(
27 __gettext("Your Friends"),
28 $friends,
29 "<a href=\"".url.$_SESSION['username']."/friends/\">[" . __gettext("View all Friends") . "]</a>"
33 $run_result .= "</li>";