diff options
Diffstat (limited to 'phpBB/includes/functions_convert.php')
| -rw-r--r-- | phpBB/includes/functions_convert.php | 42 | 
1 files changed, 37 insertions, 5 deletions
| diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index a34a193f60..3eeecd038d 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -823,7 +823,7 @@ function get_avatar_dim($src, $axis, $func = false, $arg1 = false, $arg2 = false  		break;  		case AVATAR_REMOTE: -			 // see notes on this functions usage and (hopefully) model $func to avoid this accordingly +			// see notes on this functions usage and (hopefully) model $func to avoid this accordingly  			return get_remote_avatar_dim($src, $axis);  		break; @@ -1117,7 +1117,7 @@ function words_unique(&$words)  * Adds a user to the specified group and optionally makes them a group leader  * This function does not create the group if it does not exist and so should only be called after the groups have been created  */ -function add_user_group($group_id, $user_id, $group_leader=false) +function add_user_group($group_id, $user_id, $group_leader = false)  {  	global $convert, $phpbb_root_path, $config, $user, $db; @@ -1297,7 +1297,7 @@ function restore_config($schema)  				$src_ary = $schema['array_name'];  				$config_value = (isset($convert_config[$src_ary][$src])) ? $convert_config[$src_ary][$src] : '';  			} -   		} +		}  		if ($config_value !== '')  		{ @@ -1719,7 +1719,7 @@ function add_default_groups()  		'GUESTS'			=> array('', 0, 0),  		'REGISTERED'		=> array('', 0, 0),  		'REGISTERED_COPPA'	=> array('', 0, 0), -		'GLOBAL_MODERATORS'	=> array('00AA00', 1, 0), +		'GLOBAL_MODERATORS'	=> array('00AA00', 2, 0),  		'ADMINISTRATORS'	=> array('AA0000', 1, 1),  		'BOTS'				=> array('9E8DA7', 0, 0),  		'NEWLY_REGISTERED'		=> array('', 0, 0), @@ -1748,7 +1748,7 @@ function add_default_groups()  			'group_type'			=> GROUP_SPECIAL,  			'group_colour'			=> (string) $data[0],  			'group_legend'			=> (int) $data[1], -			'group_founder_manage'	=> (int) $data[2] +			'group_founder_manage'	=> (int) $data[2],  		);  	} @@ -1758,6 +1758,38 @@ function add_default_groups()  	}  } +function add_groups_to_teampage() +{ +	global $db; + +	$teampage_groups = array( +		'ADMINISTRATORS'	=> 1, +		'GLOBAL_MODERATORS'	=> 2, +	); + +	$sql = 'SELECT * +		FROM ' . GROUPS_TABLE . ' +		WHERE ' . $db->sql_in_set('group_name', array_keys($teampage_groups)); +	$result = $db->sql_query($sql); + +	$teampage_ary = array(); +	while ($row = $db->sql_fetchrow($result)) +	{ +		$teampage_ary[] = array( +			'group_id'				=> (int) $row['group_id'], +			'teampage_name'			=> '', +			'teampage_position'		=> (int) $teampage_groups[$row['group_name']], +			'teampage_parent'		=> 0, +		); +	} +	$db->sql_freeresult($result); + +	if (sizeof($teampage_ary)) +	{ +		$db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_ary); +	} +} +  /**  * Sync post count. We might need to do this in batches. | 
