diff options
Diffstat (limited to 'phpBB/includes/functions_convert.php')
| -rw-r--r-- | phpBB/includes/functions_convert.php | 58 | 
1 files changed, 42 insertions, 16 deletions
| diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 3b26f417e9..1646c79161 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -2,9 +2,8 @@  /**  *  * @package install -* @version $Id$  * @copyright (c) 2006 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2  *  */ @@ -824,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; @@ -1028,7 +1027,6 @@ function set_user_options()  		'attachsig'		=> array('bit' => 6, 'default' => 0),  		'bbcode'		=> array('bit' => 8, 'default' => 1),  		'smilies'		=> array('bit' => 9, 'default' => 1), -		'popuppm'		=> array('bit' => 10, 'default' => 0),  		'sig_bbcode'	=> array('bit' => 15, 'default' => 1),  		'sig_smilies'	=> array('bit' => 16, 'default' => 1),  		'sig_links'		=> array('bit' => 17, 'default' => 1), @@ -1118,7 +1116,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; @@ -1298,7 +1296,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 !== '')  		{ @@ -1720,7 +1718,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), @@ -1749,7 +1747,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],  		);  	} @@ -1759,6 +1757,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. @@ -1769,7 +1799,7 @@ function sync_post_count($offset, $limit)  	$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id  			FROM ' . POSTS_TABLE . '  			WHERE post_postcount = 1 -				AND post_approved = 1 +				AND post_visibility = ' . ITEM_APPROVED . '  			GROUP BY poster_id  			ORDER BY poster_id';  	$result = $db->sql_query_limit($sql, $limit, $offset); @@ -1885,7 +1915,7 @@ function add_bots()  			'user_email'			=> '',  			'user_lang'				=> $config['default_lang'],  			'user_style'			=> 1, -			'user_timezone'			=> 0, +			'user_timezone'			=> 'UTC',  			'user_allow_massemail'	=> 0,  		); @@ -1942,7 +1972,7 @@ function update_dynamic_config()  	$sql = 'SELECT COUNT(post_id) AS stat  		FROM ' . POSTS_TABLE . ' -		WHERE post_approved = 1'; +		WHERE post_visibility = ' . ITEM_APPROVED;  	$result = $db->sql_query($sql);  	$row = $db->sql_fetchrow($result);  	$db->sql_freeresult($result); @@ -1951,7 +1981,7 @@ function update_dynamic_config()  	$sql = 'SELECT COUNT(topic_id) AS stat  		FROM ' . TOPICS_TABLE . ' -		WHERE topic_approved = 1'; +		WHERE topic_visibility = ' . ITEM_APPROVED;  	$result = $db->sql_query($sql);  	$row = $db->sql_fetchrow($result);  	$db->sql_freeresult($result); @@ -2473,7 +2503,3 @@ function fill_dateformat($user_dateformat)  	return ((empty($user_dateformat)) ? $config['default_dateformat'] : $user_dateformat);  } - - - -?>
\ No newline at end of file | 
