diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2009-08-30 11:56:15 +0000 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2009-08-30 11:56:15 +0000 |
commit | 2ad1abe0eedb9348bcb624eed23aba15c4ca94fe (patch) | |
tree | f531d33d541edc86303a07e364f58e20045ca730 /phpBB/memberlist.php | |
parent | fd24241044338f9210319398ae10bc6ad02983ea (diff) | |
download | forums-2ad1abe0eedb9348bcb624eed23aba15c4ca94fe.tar forums-2ad1abe0eedb9348bcb624eed23aba15c4ca94fe.tar.gz forums-2ad1abe0eedb9348bcb624eed23aba15c4ca94fe.tar.bz2 forums-2ad1abe0eedb9348bcb624eed23aba15c4ca94fe.tar.xz forums-2ad1abe0eedb9348bcb624eed23aba15c4ca94fe.zip |
Fix Bug #50475 - Only show "Add friend" and "Add foe" links if the specific module is enabled.
Authorised by: AcydBurn
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10065 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/memberlist.php')
-rw-r--r-- | phpBB/memberlist.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 424ea27739..11ff9e7685 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -500,8 +500,8 @@ switch ($mode) $poster_avatar = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']); - // We need to check if the modules 'zebra', 'notes' ('user_notes' mode) and 'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links - $zebra_enabled = $user_notes_enabled = $warn_user_enabled = false; + // We need to check if the modules 'zebra' ('friends' & 'foes' mode), 'notes' ('user_notes' mode) and 'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links + $zebra_enabled = $friends_enabled = $foes_enabled = $user_notes_enabled = $warn_user_enabled = false; // Only check if the user is logged in if ($user->data['is_registered']) @@ -518,6 +518,8 @@ switch ($mode) $user_notes_enabled = ($module->loaded('notes', 'user_notes')) ? true : false; $warn_user_enabled = ($module->loaded('warn', 'warn_user')) ? true : false; $zebra_enabled = ($module->loaded('zebra')) ? true : false; + $friends_enabled = ($module->loaded('zebra', 'friends')) ? true : false; + $foes_enabled = ($module->loaded('zebra', 'foes')) ? true : false; unset($module); } @@ -585,10 +587,10 @@ switch ($mode) 'S_USER_NOTES' => ($user_notes_enabled) ? true : false, 'S_WARN_USER' => ($warn_user_enabled) ? true : false, 'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false, - 'U_ADD_FRIEND' => (!$friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '', - 'U_ADD_FOE' => (!$foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '', - 'U_REMOVE_FRIEND' => ($friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '', - 'U_REMOVE_FOE' => ($foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&mode=foes&usernames[]=' . $user_id) : '', + 'U_ADD_FRIEND' => (!$friend && !$foe && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '', + 'U_ADD_FOE' => (!$friend && !$foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '', + 'U_REMOVE_FRIEND' => ($friend && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '', + 'U_REMOVE_FOE' => ($foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&mode=foes&usernames[]=' . $user_id) : '', )); if (!empty($profile_fields['row'])) |