git-svn-id: file:///svn/phpbb/trunk@7246 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-03-31 12:35:44 +00:00
parent f6d1fa57b2
commit 3abc3dd331
4 changed files with 49 additions and 6 deletions

View file

@ -703,11 +703,13 @@ class acp_groups
while ($row = $db->sql_fetchrow($result))
{
$type = ($row['group_type'] == GROUP_SPECIAL) ? 'special' : 'normal';
// used to determine what type a group is
$lookup[$row['group_id']] = $type;
// used for easy access to the data within a group
$cached_group_data[$type][$row['group_id']] = $row;
$cached_group_data[$type][$row['group_id']]['total_members'] = '0';
$cached_group_data[$type][$row['group_id']]['total_members'] = 0;
}
$db->sql_freeresult($result);
@ -725,6 +727,9 @@ class acp_groups
}
$db->sql_freeresult($result);
// The order is... normal, then special
asort($cached_group_data);
foreach ($cached_group_data as $type => $row_ary)
{
if ($type == 'special')

View file

@ -854,6 +854,7 @@ function mcp_fork_topic($topic_ids)
$total_posts = 0;
$new_topic_id_list = array();
foreach ($topic_data as $topic_id => $topic_row)
{
$sql_ary = array(
@ -970,9 +971,10 @@ function mcp_fork_topic($topic_ids)
AND in_message = 0";
$result = $db->sql_query($sql);
$sql_ary = array();
while ($attach_row = $db->sql_fetchrow($result))
{
$sql_ary = array(
$sql_ary[] = array(
'post_msg_id' => (int) $new_post_id,
'topic_id' => (int) $new_topic_id,
'in_message' => 0,
@ -988,12 +990,36 @@ function mcp_fork_topic($topic_ids)
'filetime' => (int) $attach_row['filetime'],
'thumbnail' => (int) $attach_row['thumbnail']
);
$db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
}
$db->sql_freeresult($result);
if (sizeof($sql_ary))
{
$db->sql_multi_insert(ATTACHMENTS_TABLE, $sql_ary);
}
}
}
$sql = 'SELECT user_id, notify_status
FROM ' . TOPICS_WATCH_TABLE . '
WHERE topic_id = ' . $topic_id;
$result = $db->sql_query($sql);
$sql_ary = array();
while ($row = $db->sql_fetchrow($result))
{
$sql_ary[] = array(
'topic_id' => $new_topic_id,
'user_id' => $row['user_id'],
'notify_status' => $row['notify_status'],
);
}
$db->sql_freeresult($result);
if (sizeof($sql_ary))
{
$db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary);
}
}
// Sync new topics, parent forums and board stats

View file

@ -504,13 +504,23 @@ function merge_posts($topic_id, $to_topic_id)
FROM ' . TOPICS_TABLE . '
WHERE topic_id = ' . $topic_id;
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row = $db->sql_fetchrow($result))
if ($row)
{
$return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id) . '">', '</a>');
}
else
{
// If the topic no longer exist, we will update the topic watch table.
// To not let it error out on users watching both topics, we just return on an error...
$db->sql_return_on_error(true);
$db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . $to_topic_id . ' WHERE topic_id = ' . $topic_id);
$db->sql_return_on_error(false);
$db->sql_freeresult($result);
$db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . $topic_id);
}
// Link to the new topic
$return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');

View file

@ -162,6 +162,8 @@ $lang = array_merge($lang, array(
'MCP_NOTES_FRONT' => 'Front page',
'MCP_NOTES_USER' => 'User details',
'MCP_POST_REPORTS' => 'Reports issued on this post',
'MCP_REPORTS' => 'Reported posts',
'MCP_REPORT_DETAILS' => 'Report details',
'MCP_REPORTS_CLOSED' => 'Closed reports',