mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- small UTF-8 thing git-svn-id: file:///svn/phpbb/trunk@6971 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
333b3515ed
commit
0fc55efc7d
4 changed files with 96 additions and 6 deletions
|
@ -1205,7 +1205,7 @@ function update_folder_pm_count()
|
||||||
$sql = 'SELECT user_id, folder_id, COUNT(msg_id) as num_messages
|
$sql = 'SELECT user_id, folder_id, COUNT(msg_id) as num_messages
|
||||||
FROM ' . PRIVMSGS_TO_TABLE . '
|
FROM ' . PRIVMSGS_TO_TABLE . '
|
||||||
WHERE folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ', ' . PRIVMSGS_INBOX . ', ' . PRIVMSGS_OUTBOX . ', ' . PRIVMSGS_SENTBOX . ')
|
WHERE folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ', ' . PRIVMSGS_INBOX . ', ' . PRIVMSGS_OUTBOX . ', ' . PRIVMSGS_SENTBOX . ')
|
||||||
GROUP BY folder_id';
|
GROUP BY folder_id, user_id';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
|
|
@ -719,7 +719,7 @@ function utf8_recode($string, $encoding)
|
||||||
{
|
{
|
||||||
$ret = @iconv($encoding, 'utf-8', $string);
|
$ret = @iconv($encoding, 'utf-8', $string);
|
||||||
|
|
||||||
if (isset($ret[0]))
|
if (!empty($ret))
|
||||||
{
|
{
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
@ -730,7 +730,7 @@ function utf8_recode($string, $encoding)
|
||||||
{
|
{
|
||||||
$ret = @mb_convert_encoding($string, 'utf-8', $encoding);
|
$ret = @mb_convert_encoding($string, 'utf-8', $encoding);
|
||||||
|
|
||||||
if (isset($ret[0]))
|
if (!empty($ret))
|
||||||
{
|
{
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
@ -741,7 +741,7 @@ function utf8_recode($string, $encoding)
|
||||||
{
|
{
|
||||||
$ret = @recode_string($encoding . '..utf-8', $string);
|
$ret = @recode_string($encoding . '..utf-8', $string);
|
||||||
|
|
||||||
if (isset($ret[0]))
|
if (!empty($ret))
|
||||||
{
|
{
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,9 +158,9 @@ function phpbb_insert_forums()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now insert the forums
|
// Now insert the forums
|
||||||
$sql = 'SELECT f.*, fp.prune_days, fp.prune_freq FROM ' . $convert->src_table_prefix . 'forums f
|
$sql = 'SELECT f.forum_id, f.forum_name, f.cat_id, f.forum_desc, f.forum_status, f.prune_enable, f.prune_next, fp.prune_days, fp.prune_freq FROM ' . $convert->src_table_prefix . 'forums f
|
||||||
LEFT JOIN ' . $convert->src_table_prefix . 'forum_prune fp ON f.forum_id = fp.forum_id
|
LEFT JOIN ' . $convert->src_table_prefix . 'forum_prune fp ON f.forum_id = fp.forum_id
|
||||||
GROUP BY f.forum_id
|
GROUP BY f.forum_id, f.forum_name, f.cat_id, f.forum_desc, f.forum_status, f.prune_enable, f.prune_next, f.forum_order, fp.prune_days, fp.prune_freq
|
||||||
ORDER BY f.cat_id, f.forum_order';
|
ORDER BY f.cat_id, f.forum_order';
|
||||||
|
|
||||||
if ($convert->mysql_convert)
|
if ($convert->mysql_convert)
|
||||||
|
|
|
@ -909,6 +909,51 @@ class install_convert extends module
|
||||||
$db->sql_query($query_first);
|
$db->sql_query($query_first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db->sql_layer === 'postgres')
|
||||||
|
{
|
||||||
|
$tables = array(
|
||||||
|
ATTACHMENTS_TABLE => 'attach_id',
|
||||||
|
ACL_OPTIONS_TABLE => 'auth_option_id',
|
||||||
|
ACL_ROLES_TABLE => 'role_id',
|
||||||
|
BANLIST_TABLE => 'ban_id',
|
||||||
|
BOTS_TABLE => 'bot_id',
|
||||||
|
DISALLOW_TABLE => 'disallow_id',
|
||||||
|
DRAFTS_TABLE => 'draft_id',
|
||||||
|
EXTENSIONS_TABLE => 'extension_id',
|
||||||
|
EXTENSION_GROUPS_TABLE => 'group_id',
|
||||||
|
FORUMS_TABLE => 'forum_id',
|
||||||
|
GROUPS_TABLE => 'group_id',
|
||||||
|
ICONS_TABLE => 'icons_id',
|
||||||
|
LANG_TABLE => 'lang_id',
|
||||||
|
LOG_TABLE => 'log_id',
|
||||||
|
MODULES_TABLE => 'module_id',
|
||||||
|
POSTS_TABLE => 'post_id',
|
||||||
|
PRIVMSGS_TABLE => 'msg_id',
|
||||||
|
PRIVMSGS_FOLDER_TABLE => 'folder_id',
|
||||||
|
PRIVMSGS_RULES_TABLE => 'rule_id',
|
||||||
|
PROFILE_FIELDS_TABLE => 'field_id',
|
||||||
|
RANKS_TABLE => 'rank_id',
|
||||||
|
REPORTS_TABLE => 'report_id',
|
||||||
|
REPORTS_REASONS_TABLE => 'reason_id',
|
||||||
|
SEARCH_WORDLIST_TABLE => 'word_id',
|
||||||
|
SITELIST_TABLE => 'site_id',
|
||||||
|
SMILIES_TABLE => 'smiley_id',
|
||||||
|
STYLES_TABLE => 'style_id',
|
||||||
|
STYLES_TEMPLATE_TABLE => 'template_id',
|
||||||
|
STYLES_TEMPLATE_DATA_TABLE => 'template_id',
|
||||||
|
STYLES_THEME_TABLE => 'theme_id',
|
||||||
|
STYLES_IMAGESET_TABLE => 'imageset_id',
|
||||||
|
TOPICS_TABLE => 'topic_id',
|
||||||
|
USERS_TABLE => 'user_id',
|
||||||
|
WARNINGS_TABLE => 'warning_id',
|
||||||
|
WORDS_TABLE => 'word_id'
|
||||||
|
);
|
||||||
|
if (!empty($tables[$schema['target']]))
|
||||||
|
{
|
||||||
|
$db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $tables[$schema['target']] . ")>0 then max(" . $tables[$schema['target']] . ")+1 else 1 end from " . $schema['target'] . '));');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process execute_always for this table
|
// Process execute_always for this table
|
||||||
|
@ -1122,6 +1167,51 @@ class install_convert extends module
|
||||||
|
|
||||||
$waiting_rows = array();
|
$waiting_rows = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($db->sql_layer === 'postgres')
|
||||||
|
{
|
||||||
|
$tables = array(
|
||||||
|
ATTACHMENTS_TABLE => 'attach_id',
|
||||||
|
ACL_OPTIONS_TABLE => 'auth_option_id',
|
||||||
|
ACL_ROLES_TABLE => 'role_id',
|
||||||
|
BANLIST_TABLE => 'ban_id',
|
||||||
|
BOTS_TABLE => 'bot_id',
|
||||||
|
DISALLOW_TABLE => 'disallow_id',
|
||||||
|
DRAFTS_TABLE => 'draft_id',
|
||||||
|
EXTENSIONS_TABLE => 'extension_id',
|
||||||
|
EXTENSION_GROUPS_TABLE => 'group_id',
|
||||||
|
FORUMS_TABLE => 'forum_id',
|
||||||
|
GROUPS_TABLE => 'group_id',
|
||||||
|
ICONS_TABLE => 'icons_id',
|
||||||
|
LANG_TABLE => 'lang_id',
|
||||||
|
LOG_TABLE => 'log_id',
|
||||||
|
MODULES_TABLE => 'module_id',
|
||||||
|
POSTS_TABLE => 'post_id',
|
||||||
|
PRIVMSGS_TABLE => 'msg_id',
|
||||||
|
PRIVMSGS_FOLDER_TABLE => 'folder_id',
|
||||||
|
PRIVMSGS_RULES_TABLE => 'rule_id',
|
||||||
|
PROFILE_FIELDS_TABLE => 'field_id',
|
||||||
|
RANKS_TABLE => 'rank_id',
|
||||||
|
REPORTS_TABLE => 'report_id',
|
||||||
|
REPORTS_REASONS_TABLE => 'reason_id',
|
||||||
|
SEARCH_WORDLIST_TABLE => 'word_id',
|
||||||
|
SITELIST_TABLE => 'site_id',
|
||||||
|
SMILIES_TABLE => 'smiley_id',
|
||||||
|
STYLES_TABLE => 'style_id',
|
||||||
|
STYLES_TEMPLATE_TABLE => 'template_id',
|
||||||
|
STYLES_TEMPLATE_DATA_TABLE => 'template_id',
|
||||||
|
STYLES_THEME_TABLE => 'theme_id',
|
||||||
|
STYLES_IMAGESET_TABLE => 'imageset_id',
|
||||||
|
TOPICS_TABLE => 'topic_id',
|
||||||
|
USERS_TABLE => 'user_id',
|
||||||
|
WARNINGS_TABLE => 'warning_id',
|
||||||
|
WORDS_TABLE => 'word_id'
|
||||||
|
);
|
||||||
|
if (!empty($tables[$schema['target']]))
|
||||||
|
{
|
||||||
|
$db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $tables[$schema['target']] . ")>0 then max(" . $tables[$schema['target']] . ")+1 else 1 end from " . $schema['target'] . '));');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// When we reach this point, either the current table has been processed or we're running out of time.
|
// When we reach this point, either the current table has been processed or we're running out of time.
|
||||||
|
|
Loading…
Add table
Reference in a new issue