mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
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:
parent
e6bb539d92
commit
c7d15ef2fb
2 changed files with 13 additions and 23 deletions
|
@ -663,14 +663,12 @@ switch( $mode )
|
|||
$page_title = $lang['Mod_CP'];
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
if ( isset($HTTP_POST_VARS['split_type_all']) || isset($HTTP_POST_VARS['split_type_beyond']) )
|
||||
if (isset($HTTP_POST_VARS['split_type_all']) || isset($HTTP_POST_VARS['split_type_beyond']))
|
||||
{
|
||||
$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++)
|
||||
for ($i = 0; $i < count($posts); $i++)
|
||||
{
|
||||
$post_id_sql .= (($post_id_sql != '') ? ', ' : '') . intval($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);
|
||||
|
@ -732,15 +720,17 @@ switch( $mode )
|
|||
$sql = "UPDATE " . TOPICS_WATCH_TABLE . "
|
||||
SET topic_id = $new_topic_id
|
||||
WHERE topic_id = $topic_id
|
||||
AND user_id IN($user_id_sql)";
|
||||
AND user_id IN ($user_id_sql)";
|
||||
if (!$db->sql_query($sql))
|
||||
{
|
||||
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);
|
||||
|
|
|
@ -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&" . POST_TOPIC_URL . "=$topic_id"))
|
||||
);
|
||||
|
||||
$template->assign_var_from_handle('POLL_DISPLAY', 'pollbox');
|
||||
|
|
Loading…
Add table
Reference in a new issue