|
From: Joas S. <nic...@ph...> - 2009-08-30 11:57:03
|
Author: nickvergessen
Date: Sun Aug 30 12:56:15 2009
New Revision: 10065
Log:
Fix Bug #50475 - Only show "Add friend" and "Add foe" links if the specific module is enabled.
Authorised by: AcydBurn
Modified:
branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html
branches/phpBB-3_0_0/phpBB/memberlist.php
branches/phpBB-3_0_0/phpBB/styles/prosilver/template/memberlist_view.html
branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/memberlist_view.html
Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html
==============================================================================
*** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original)
--- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Sun Aug 30 12:56:15 2009
***************
*** 200,205 ****
--- 200,206 ----
<li>[Fix] Correctly orientate Control-Panel-Navigation background-image on RTL languages. (Bug #49945)</li>
<li>[Fix] Sort private messages by message time and not message id. (Bug #50015)</li>
<li>[Fix] Make sure only logs for existing users are displayed and user-specific logs removed on user deletion. (Bug #49855)</li>
+ <li>[Fix] Only show "Add friend" and "Add foe" links if the specific module is enabled. (Bug #50475)</li>
<li>[Change] submit_post() now accepts force_approved_state key passed to $data to indicate new posts being approved (true) or unapproved (false).</li>
<li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li>
<li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li>
Modified: branches/phpBB-3_0_0/phpBB/memberlist.php
==============================================================================
*** branches/phpBB-3_0_0/phpBB/memberlist.php (original)
--- branches/phpBB-3_0_0/phpBB/memberlist.php Sun Aug 30 12:56:15 2009
***************
*** 500,507 ****
$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;
// Only check if the user is logged in
if ($user->data['is_registered'])
--- 500,507 ----
$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' ('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,523 ****
--- 518,525 ----
$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,594 ****
'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) : '',
));
if (!empty($profile_fields['row']))
--- 587,596 ----
'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 && !$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']))
Modified: branches/phpBB-3_0_0/phpBB/styles/prosilver/template/memberlist_view.html
==============================================================================
*** branches/phpBB-3_0_0/phpBB/styles/prosilver/template/memberlist_view.html (original)
--- branches/phpBB-3_0_0/phpBB/styles/prosilver/template/memberlist_view.html Sun Aug 30 12:56:15 2009
***************
*** 34,47 ****
<!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}:</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF -->
<!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields -->
<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
! <!-- IF U_ADD_FRIEND and U_ADD_FOE-->
! <dt> </dt> <dd><a href="{U_ADD_FRIEND}"><strong>{L_ADD_FRIEND}</strong></a></dd>
! <dt> </dt> <dd><a href="{U_ADD_FOE}"><strong>{L_ADD_FOE}</strong></a></dd>
<!-- ELSE -->
! <!-- IF U_REMOVE_FRIEND -->
! <dt> </dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
! <!-- ELSE -->
! <dt> </dt> <dd><a href="{U_REMOVE_FOE}"><strong>{L_REMOVE_FOE}</strong></a></dd>
<!-- ENDIF -->
<!-- ENDIF -->
<!-- ENDIF -->
--- 34,49 ----
<!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}:</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF -->
<!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields -->
<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
! <!-- IF U_REMOVE_FRIEND -->
! <dt> </dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
! <!-- ELSEIF U_REMOVE_FOE -->
! <dt> </dt> <dd><a href="{U_REMOVE_FOE}"><strong>{L_REMOVE_FOE}</strong></a></dd>
<!-- ELSE -->
! <!-- IF U_ADD_FRIEND-->
! <dt> </dt> <dd><a href="{U_ADD_FRIEND}"><strong>{L_ADD_FRIEND}</strong></a></dd>
! <!-- ENDIF -->
! <!-- IF U_ADD_FOE-->
! <dt> </dt> <dd><a href="{U_ADD_FOE}"><strong>{L_ADD_FOE}</strong></a></dd>
<!-- ENDIF -->
<!-- ENDIF -->
<!-- ENDIF -->
Modified: branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/memberlist_view.html
==============================================================================
*** branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/memberlist_view.html (original)
--- branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/memberlist_view.html Sun Aug 30 12:56:15 2009
***************
*** 51,57 ****
<!-- ENDIF -->
<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
<tr>
! <td class="genmed" align="center">[ <!-- IF U_ADD_FRIEND and U_ADD_FOE--><a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a> | <a href="{U_ADD_FOE}">{L_ADD_FOE}</a><!-- ENDIF --><!-- IF U_REMOVE_FRIEND --><a href="{U_REMOVE_FRIEND}">{L_REMOVE_FRIEND}</a><!-- ENDIF --><!-- IF U_REMOVE_FOE --><a href="{U_REMOVE_FOE}">{L_REMOVE_FOE}</a><!-- ENDIF --> ]</td>
</tr>
<!-- ENDIF -->
</table>
--- 51,65 ----
<!-- ENDIF -->
<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
<tr>
! <td class="genmed" align="center">[
! <!-- IF U_REMOVE_FRIEND -->
! <a href="{U_REMOVE_FRIEND}">{L_REMOVE_FRIEND}</a>
! <!-- ELSEIF U_REMOVE_FOE -->
! <a href="{U_REMOVE_FOE}">{L_REMOVE_FOE}</a>
! <!-- ELSE -->
! <!-- IF U_ADD_FRIEND--><a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a><!-- ENDIF --><!-- IF U_ADD_FOE--><!-- IF U_ADD_FRIEND--> | <!-- ENDIF --><a href="{U_ADD_FOE}">{L_ADD_FOE}</a><!-- ENDIF -->
! <!-- ENDIF -->
! ]</td>
</tr>
<!-- ENDIF -->
</table>
|