diff options
author | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-04-23 22:47:28 +0000 |
---|---|---|
committer | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-04-23 22:47:28 +0000 |
commit | 716baed055c6c9b2a146e4693ab1b071c2275b77 (patch) | |
tree | 29ea43ef101e62906f7d383b59609345b6858bde /phpBB/mcp.php | |
parent | 3a4af0ea4ff060bee997f5dea955bda4265e1c51 (diff) | |
download | forums-716baed055c6c9b2a146e4693ab1b071c2275b77.tar forums-716baed055c6c9b2a146e4693ab1b071c2275b77.tar.gz forums-716baed055c6c9b2a146e4693ab1b071c2275b77.tar.bz2 forums-716baed055c6c9b2a146e4693ab1b071c2275b77.tar.xz forums-716baed055c6c9b2a146e4693ab1b071c2275b77.zip |
Changed: polls are forked with topics. Votes are not, which means users will have to vote again.
git-svn-id: file:///svn/phpbb/trunk@3938 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/mcp.php')
-rw-r--r-- | phpBB/mcp.php | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/phpBB/mcp.php b/phpBB/mcp.php index 8fd301ffc2..f32ffcd48e 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -617,7 +617,7 @@ switch ($mode) } $total_posts = 0; - $new_topic_id_list = array(); + $new_topic_id_list = $post_rows = array(); foreach ($topic_data as $topic_id => $topic_row) { $sql_ary = array( @@ -634,14 +634,30 @@ switch ($mode) 'topic_first_poster_name' => (string) $topic_row['topic_first_poster_name'], 'topic_last_poster_id' => (int) $topic_row['topic_last_poster_id'], 'topic_last_poster_name' => (string) $topic_row['topic_last_poster_name'], - 'topic_last_post_time' => (int) $topic_row['topic_last_post_time'] + 'topic_last_post_time' => (int) $topic_row['topic_last_post_time'], + 'poll_title' => (string) $topic_row['poll_title'], + 'poll_start' => (int) $topic_row['poll_start'], + 'poll_length' => (int) $topic_row['poll_length'] ); $db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $sql_ary)); $new_topic_id = $db->sql_nextid(); $new_topic_id_list[$new_topic_id] = $topic_id; - $post_rows = array(); + if ($topic_row['poll_start']) + { + $poll_rows = array(); + + $result = $db->sql_query('SELECT * FROM ' . POLL_OPTIONS_TABLE . ' WHERE topic_id = ' . $topic_id); + while ($row = $db->sql_fetchrow($result)) + { + $sql = 'INSERT INTO ' . POLL_OPTIONS_TABLE . ' (poll_option_id, topic_id, poll_option_text, poll_option_total) + VALUES (' . $row['poll_option_id'] . ', ' . $new_topic_id . ", '" . $db->sql_escape($row['poll_option_text']) . "', 0)"; + + $db->sql_query($sql); + } + } + $sql = 'SELECT * FROM ' . POSTS_TABLE . " WHERE topic_id = $topic_id @@ -918,7 +934,7 @@ switch ($mode) mcp_header('confirm_body.html'); $template->assign_vars(array( - 'MESSAGE_TITLE' => $user->lang['Confirm'], + 'MESSAGE_TITLE' => $user->lang['CONFIRM'], 'MESSAGE_TEXT' => (count($post_id_list) == 1) ? $user->lang['CONFIRM_DELETE_POST'] : $user->lang['CONFIRM_DELETE_POSTS'], 'S_CONFIRM_ACTION' => "mcp.$phpEx$SID&mode=disapprove", @@ -1013,6 +1029,7 @@ switch ($mode) // Resync last post infos, replies count et caetera sync('topic', 'topic_id', $topic_id_list); + sync('topic_attachment', 'topic_id', $topic_id_list); foreach ($user_posts as $user_id => $post_count) { |