Fixing a small css issue in the user class.
[elgg.git] / units / communities / user_info_menu_text.php
bloba4581c5c7c79cdbc6cb68f4228603b5cd9909250
1 <?php
2 global $CFG,$USER;
3 global $user_type;
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));
15 if ($result == 0) {
16 $moderation = user_info('moderation',$user_id);
17 switch($moderation) {
18 case "no": $run_result = "<a href=\"".url."_communities/index.php?friends_name=".$_SESSION['username']."&amp;action=friend&amp;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>";
19 break;
20 case "yes": $run_result = "<a href=\"".url."_communities/index.php?friends_name=".$_SESSION['username']."&amp;action=friend&amp;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>";
21 break;
22 case "priv": $run_result = "";
23 break;
25 } else {
26 $run_result = "<a href=\"".url."_communities/index.php?friends_name=".$_SESSION['username']."&amp;action=unfriend&amp;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>";