Using a different approach for the data updates (same as the schema updates)

git-svn-id: file:///svn/phpbb/trunk@6671 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-11-27 16:05:23 +00:00
parent 22c729c41b
commit 688ef7560a
3 changed files with 21 additions and 26 deletions

View file

@ -687,7 +687,7 @@ function tz_select($default = '', $truncate = false)
if ($truncate)
{
$zone_trunc = truncate_string($zone, 50, false, '...');
}
}
else
{
$zone_trunc = $zone;

View file

@ -130,7 +130,7 @@ class ucp_prefs
'S_LANG_OPTIONS' => language_select($data['lang']),
'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['style']),
'S_TZ_OPTIONS' => tz_select($data['tz'], true),
'S_TZ_OPTIONS' => tz_select($data['tz'], true),
'S_CAN_HIDE_ONLINE' => ($auth->acl_get('u_hideonline')) ? true : false,
'S_SELECT_NOTIFY' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? true : false)
);

View file

@ -308,7 +308,7 @@ $database_update_info = array(
),
),
// Latest version
'3.0.b4-dev' => array(),
'3.0.b4' => array(),
);
// Determine mapping database type
@ -458,34 +458,29 @@ $errored = $no_updates = false;
flush();
$no_updates = true;
// some code magic
switch ($current_version)
if (version_compare($current_version, '3.0.b3', '<'))
{
case '3.0.b3':
// Set group_founder_manage for administrators group
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . "
WHERE group_name = 'ADMINISTRATORS'
AND group_type = " . GROUP_SPECIAL;
$result = $db->sql_query($sql);
$group_id = (int) $db->sql_fetchfield('group_id');
$db->sql_freeresult($result);
// Set group_founder_manage for administrators group
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . "
WHERE group_name = 'ADMINISTRATORS'
AND group_type = " . GROUP_SPECIAL;
$result = $db->sql_query($sql);
$group_id = (int) $db->sql_fetchfield('group_id');
$db->sql_freeresult($result);
if ($group_id)
{
$sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_founder_manage = 1 WHERE group_id = ' . $group_id;
_sql($sql, $errored, $error_ary);
}
if ($group_id)
{
$sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_founder_manage = 1 WHERE group_id = ' . $group_id;
_sql($sql, $errored, $error_ary);
}
add_bots();
add_bots();
// No need to change here. Before this line, no break should appear
break;
case '3.0.b4-dev':
default:
$no_updates = true;
break;
$no_updates = false;
}
_write_result($no_updates, $errored, $error_ary);