1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 23:25:30 +02:00

View profile now shows relevant add/remove links

git-svn-id: file:///svn/phpbb/trunk@6462 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Graham Eames 2006-10-07 20:11:45 +00:00
parent d7545025c3
commit 32c2ea4339
4 changed files with 23 additions and 5 deletions

View File

@ -20,7 +20,7 @@ class ucp_zebra
{
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
$submit = (isset($_POST['submit']) || isset($_GET['add'])) ? true : false;
$submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
$s_hidden_fields = '';
$l_mode = strtoupper($mode);
@ -32,7 +32,7 @@ class ucp_zebra
$var_ary = array(
'usernames' => array(0),
'add' => '',
'add' => '',
);
foreach ($var_ary as $var => $default)

View File

@ -251,6 +251,7 @@ $lang = array_merge($lang, array(
'TESTS_PASSED' => 'Tests passed',
'TESTS_FAILED' => 'Tests failed',
'UNABLE_WRITE_LOCK' => 'Unable to write lock file',
'UNAVAILABLE' => 'Unavailable',
'UNWRITEABLE' => 'Unwriteable',

View File

@ -103,6 +103,8 @@ $lang = array_merge($lang, array(
'RANK' => 'Rank',
'REAL_NAME' => 'Recipient name',
'RECIPIENT' => 'Recipient',
'REMOVE_FOE' => 'Remove foe',
'REMOVE_FRIEND' => 'Remove friend',
'SEARCH_USER_POSTS' => 'Search users posts',
'SELECT_MARKED' => 'Select marked',

View File

@ -367,6 +367,19 @@ switch ($mode)
{
$group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
// What colour is the zebra
$sql = 'SELECT friend, foe
FROM ' . ZEBRA_TABLE . "
WHERE zebra_id = $user_id
AND user_id = {$user->data['user_id']}";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$foe = ($row['foe']) ? true : false;
$friend = ($row['friend']) ? true : false;
$db->sql_freeresult($result);
if ($config['load_onlinetrack'])
{
@ -484,9 +497,11 @@ switch ($mode)
'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_id}") : '',
'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false,
'U_ADD_FRIEND' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;add=' . urlencode($member['username'])),
'U_ADD_FOE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;mode=foes&amp;add=' . urlencode($member['username'])))
);
'U_ADD_FRIEND' => (!$friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;add=' . urlencode($member['username'])) : '',
'U_ADD_FOE' => (!$foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;mode=foes&amp;add=' . urlencode($member['username'])) : '',
'U_REMOVE_FRIEND' => ($friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;usernames[]=' . $user_id) : '',
'U_REMOVE_FOE' => ($foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;usernames[]=' . $user_id) : '',
));
if (!empty($profile_fields['row']))
{