5 if ($page_owner != -1 && (user_type($page_owner) == "person" ||
user_type($page_owner) == "external")) {
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",
20 "<a href=\"".url
."_friends/?owner=$profile_id\">[" . __gettext("View all Friends") . "]</a>"
25 $run_result .= run("users:infobox",
27 __gettext("Your Friends"),
29 "<a href=\"".url
.$_SESSION['username']."/friends/\">[" . __gettext("View all Friends") . "]</a>"
33 $run_result .= "</li>";