1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-04 21:44:57 +02:00

Merge remote-tracking branch 'nickvergessen/ticket/10410' into develop

* nickvergessen/ticket/10410:
  [ticket/10410] Add option to display users in their first teampage group
This commit is contained in:
Andreas Fischer 2011-11-01 20:04:08 +01:00
commit 589f7ac8e4
6 changed files with 23 additions and 16 deletions

View File

@ -82,10 +82,11 @@
<fieldset>
<legend>{L_TEAMPAGE_SETTINGS}</legend>
<dl>
<dt><label for="teampage_multiple">{L_TEAMPAGE_MULTIPLE}:</label><br /><span>{L_TEAMPAGE_MULTIPLE_EXPLAIN}</span></dt>
<dt><label for="teampage_multiple">{L_TEAMPAGE_MEMBERSHIPS}:</label></dt>
<dd>
<label><input type="radio" name="teampage_multiple" class="radio" value="1"<!-- IF DISPLAY_MULTIPLE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="teampage_multiple" class="radio" value="0"<!-- IF not DISPLAY_MULTIPLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
<label><input type="radio" name="teampage_memberships" class="radio" value="0"<!-- IF DISPLAY_MEMBERSHIPS == 0 --> checked="checked"<!-- ENDIF --> /> {L_TEAMPAGE_DISP_FIRST}</label><br />
<label><input type="radio" name="teampage_memberships" class="radio" value="1"<!-- IF DISPLAY_MEMBERSHIPS == 1 --> checked="checked"<!-- ENDIF --> /> {L_TEAMPAGE_DISP_DEFAULT}</label><br />
<label><input type="radio" name="teampage_memberships" class="radio" value="2"<!-- IF DISPLAY_MEMBERSHIPS == 2 --> checked="checked"<!-- ENDIF --> /> {L_TEAMPAGE_DISP_ALL}</label>
</dd>
</dl>
<dl>

View File

@ -835,7 +835,7 @@ class acp_groups
case 'set_config_teampage':
set_config('teampage_forums', request_var('teampage_forums', 0));
set_config('teampage_multiple', request_var('teampage_multiple', 0));
set_config('teampage_memberships', request_var('teampage_memberships', 0));
break;
case 'add':
@ -916,11 +916,11 @@ class acp_groups
'U_ACTION_LEGEND' => $this->u_action . '&amp;field=legend',
'U_ACTION_TEAMPAGE' => $this->u_action . '&amp;field=teampage',
'S_GROUP_SELECT_LEGEND' => $s_group_select_legend,
'S_GROUP_SELECT_TEAMPAGE' => $s_group_select_teampage,
'DISPLAY_FORUMS' => ($config['teampage_forums']) ? true : false,
'DISPLAY_MULTIPLE' => ($config['teampage_multiple']) ? true : false,
'LEGEND_SORT_GROUPNAME' => ($config['legend_sort_groupname']) ? true : false,
'S_GROUP_SELECT_LEGEND' => $s_group_select_legend,
'S_GROUP_SELECT_TEAMPAGE' => $s_group_select_teampage,
'DISPLAY_FORUMS' => ($config['teampage_forums']) ? true : false,
'DISPLAY_MEMBERSHIPS' => $config['teampage_memberships'],
'LEGEND_SORT_GROUPNAME' => ($config['legend_sort_groupname']) ? true : false,
));
}
}

View File

@ -2125,10 +2125,9 @@ function change_database_data(&$no_updates, $version)
_sql($sql, $errored, $error_ary);
}
if (!isset($config['use_system_cron']))
if (!isset($config['legend_sort_groupname']))
{
set_config('legend_sort_groupname', '0');
set_config('teampage_multiple', '1');
set_config('teampage_forums', '1');
}
@ -2268,6 +2267,11 @@ function change_database_data(&$no_updates, $version)
set_config('load_cpf_pm', '0');
}
if (!isset($config['teampage_memberships']))
{
set_config('teampage_memberships', '1');
}
$no_updates = false;
break;
}

View File

@ -246,7 +246,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_multiple', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_memberships', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_forums', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');

View File

@ -129,11 +129,13 @@ $lang = array_merge($lang, array(
'SPECIAL_GROUPS' => 'Pre-defined groups',
'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.',
'TEAMPAGE_DISP_ALL' => 'All memberships',
'TEAMPAGE_DISP_DEFAULT' => 'Users default group only',
'TEAMPAGE_DISP_FIRST' => 'First membership only',
'TEAMPAGE_EXPLAIN' => 'These are the groups which are displayed on the teampage:',
'TEAMPAGE_FORUMS' => 'Display moderated forums',
'TEAMPAGE_FORUMS_EXPLAIN' => 'If set to yes, moderators will have a list with all of the forums where they have moderator permissions displayed in their row. This can be very database intensive for big boards.',
'TEAMPAGE_MULTIPLE' => 'Display users in all groups',
'TEAMPAGE_MULTIPLE_EXPLAIN' => 'If set to no, the users will only be displayed in their primary group (If the primary group is not listed, the users will be displayed in their first displayed group).',
'TEAMPAGE_MEMBERSHIPS' => 'Display user memberships',
'TEAMPAGE_SETTINGS' => 'Teampage settings',
'TOTAL_MEMBERS' => 'Members',

View File

@ -229,7 +229,7 @@ switch ($mode)
if (isset($user_ary[$user_id]))
{
$row = $user_ary[$user_id];
if (!$config['teampage_multiple'] && ($group_id != $groups_ary[$row['default_group']]['group_id']) && $groups_ary[$row['default_group']]['group_teampage'])
if ($config['teampage_memberships'] == 1 && ($group_id != $groups_ary[$row['default_group']]['group_id']) && $groups_ary[$row['default_group']]['group_teampage'])
{
// Display users in their primary group, instead of the first group, when it is displayed on the teampage.
continue;
@ -259,7 +259,7 @@ switch ($mode)
'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
));
if (!$config['teampage_multiple'])
if ($config['teampage_memberships'] != 2)
{
unset($user_ary[$user_id]);
}