Fix voting and splitting issues

git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3245 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-12-22 23:49:56 +00:00
parent e6bb539d92
commit c7d15ef2fb
2 changed files with 13 additions and 23 deletions

View file

@ -667,8 +667,6 @@ switch( $mode )
{
$posts = $HTTP_POST_VARS['post_id_list'];
if( !empty($HTTP_POST_VARS['split_type_all']) )
{
$post_id_sql = '';
for ($i = 0; $i < count($posts); $i++)
{
@ -679,16 +677,6 @@ switch( $mode )
FROM " . POSTS_TABLE . "
WHERE post_id IN ($post_id_sql)
ORDER BY post_time ASC";
}
else if( !empty($HTTP_POST_VARS['split_type_beyond']) )
{
$sql = "SELECT post_id, poster_id, topic_id, post_time
FROM " . POSTS_TABLE . "
WHERE post_time >= $post_time
AND topic_id = $topic_id
ORDER BY post_time ASC";
}
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not get post information', '', __LINE__, __FILE__, $sql);
@ -738,9 +726,11 @@ switch( $mode )
message_die(GENERAL_ERROR, 'Could not update topics watch table', '', __LINE__, __FILE__, $sql);
}
$sql_where = (!empty($HTTP_POST_VARS['split_type_beyond'])) ? " post_time >= $post_time AND topic_id = $topic_id" : "post_id IN ($post_id_sql)";
$sql = "UPDATE " . POSTS_TABLE . "
SET topic_id = $new_topic_id, forum_id = $new_forum_id
WHERE post_id IN ($post_id_sql)";
WHERE $sql_where";
if (!$db->sql_query($sql, END_TRANSACTION))
{
message_die(GENERAL_ERROR, 'Could not update posts table', '', __LINE__, __FILE__, $sql);

View file

@ -794,7 +794,7 @@ if ( !empty($forum_topic_data['topic_vote']) )
'POLL_QUESTION' => $vote_title,
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_POLL_ACTION' => append_sid("posting.$phpEx?" . POST_TOPIC_URL . "=$topic_id"))
'S_POLL_ACTION' => append_sid("posting.$phpEx?mode=vote&amp;" . POST_TOPIC_URL . "=$topic_id"))
);
$template->assign_var_from_handle('POLL_DISPLAY', 'pollbox');