#6368, thanks to ToonArmy

git-svn-id: file:///svn/phpbb/trunk@6784 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2006-12-20 22:36:06 +00:00
parent 3503830c47
commit 9e5819ac4c

View file

@ -463,14 +463,18 @@ function merge_posts($topic_id, $to_topic_id)
$success_msg = 'POSTS_MERGED_SUCCESS'; $success_msg = 'POSTS_MERGED_SUCCESS';
// Does the original topic still exist? If yes, link back to it // Does the original topic still exist? If yes, link back to it
$topic_data = get_topic_data(array($topic_id)); $sql = 'SELECT forum_id
FROM ' . TOPICS_TABLE . '
WHERE topic_id = ' . $topic_id;
$result = $db->sql_query_limit($sql, 1);
if (sizeof($topic_data)) if ($row = $db->sql_fetchrow($result))
{ {
$topic_data = $topic_data[$topic_id]; $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>');
$return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_data['forum_id'] . '&amp;t=' . $topic_id) . '">', '</a>');
} }
$db->sql_freeresult($result);
// Link to the new topic // 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>'); $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>');
} }