5 // If we've been passed a valid user ID as a parameter ...
6 if (isset($parameter) && (isset($parameter[0])) && ($parameter[0] != $_SESSION['userid']) && logged_on
) {
8 $user_id = (int) $parameter[0];
10 if (user_type($user_id) == "person" ||
user_type($user_id) == "external") {
12 if (!count_records_sql('SELECT COUNT(u.ident) FROM '.$CFG->prefix
.'friends f
13 JOIN '.$CFG->prefix
.'users u ON u.ident = f.friend
14 WHERE f.owner = ? AND f.friend = ?',array($USER->ident
,$user_id))) {
15 $moderation = user_info('moderation',$user_id);
16 switch ($moderation) {
19 $run_result = "<a href=\"".url
."_friends/index.php?friends_name=".$_SESSION['username']."&action=friend&friend_id=$user_id\" onclick=\"return confirm('". __gettext("Are you sure you want to add this user as a friend?") ."')\">" . __gettext("Click here to add this user as a friend."). "</a>";
26 $run_result = "<a href=\"".url
."_friends/index.php?friends_name=".$_SESSION['username']."&action=unfriend&friend_id=$user_id\" onclick=\"return confirm('". __gettext("Are you sure you want to remove this user from your friends list?") ."')\">" . __gettext("Click here to remove this user from your friends list."). "</a>";