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) == "community") {
11 $result = count_records_sql('SELECT COUNT(u.ident) FROM '.$CFG->prefix
.'friends f
12 LEFT JOIN '.$CFG->prefix
.'users u ON u.ident = f.friend
13 WHERE f.owner = ? AND f.friend = ?',
14 array($USER->ident
,$user_id));
16 $moderation = user_info('moderation',$user_id);
18 case "no": $run_result = "<a href=\"".url
."_communities/index.php?friends_name=".$_SESSION['username']."&action=friend&friend_id=$user_id\" onclick=\"return confirm('". __gettext("Are you sure you want to join this community?") ."')\">" . __gettext("Click here to join this community."). "</a>";
20 case "yes": $run_result = "<a href=\"".url
."_communities/index.php?friends_name=".$_SESSION['username']."&action=friend&friend_id=$user_id\" onclick=\"return confirm('". __gettext("Are you sure you want to apply to join this community?") ."')\">" . __gettext("Click here to apply to join this community."). "</a>";
22 case "priv": $run_result = "";
26 $run_result = "<a href=\"".url
."_communities/index.php?friends_name=".$_SESSION['username']."&action=unfriend&friend_id=$user_id\" onclick=\"return confirm('". __gettext("Are you sure you want to leave this community?") ."')\">" . __gettext("Click here to leave this community."). "</a>";