Fix mod_move for multi image
This commit is contained in:
parent
bb5446a93d
commit
2b3942d19d
@ -1193,13 +1193,14 @@ function mod_move($originBoard, $postID) {
|
|||||||
// indicate that the post is a thread
|
// indicate that the post is a thread
|
||||||
$post['op'] = true;
|
$post['op'] = true;
|
||||||
|
|
||||||
if ($post['file']) {
|
if ($post['files']) {
|
||||||
|
$post['files'] = json_decode($post['files'], TRUE);
|
||||||
$post['has_file'] = true;
|
$post['has_file'] = true;
|
||||||
$post['width'] = &$post['filewidth'];
|
foreach ($post['files'] as $i => &$file) {
|
||||||
$post['height'] = &$post['fileheight'];
|
var_dump($file);
|
||||||
|
$file['file_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file'];
|
||||||
$file_src = sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file'];
|
$file['thumb_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb'];
|
||||||
$file_thumb = sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb'];
|
}
|
||||||
} else {
|
} else {
|
||||||
$post['has_file'] = false;
|
$post['has_file'] = false;
|
||||||
}
|
}
|
||||||
@ -1215,9 +1216,11 @@ function mod_move($originBoard, $postID) {
|
|||||||
|
|
||||||
if ($post['has_file']) {
|
if ($post['has_file']) {
|
||||||
// copy image
|
// copy image
|
||||||
$clone($file_src, sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']);
|
foreach ($post['files'] as $i => &$file) {
|
||||||
if (!in_array($post['thumb'], array('spoiler', 'deleted', 'file')))
|
$clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']);
|
||||||
$clone($file_thumb, sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb']);
|
if (!in_array($file['thumb'], array('spoiler', 'deleted', 'file')))
|
||||||
|
$clone($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// go back to the original board to fetch replies
|
// go back to the original board to fetch replies
|
||||||
@ -1233,13 +1236,13 @@ function mod_move($originBoard, $postID) {
|
|||||||
$post['mod'] = true;
|
$post['mod'] = true;
|
||||||
$post['thread'] = $newID;
|
$post['thread'] = $newID;
|
||||||
|
|
||||||
if ($post['file']) {
|
if ($post['files']) {
|
||||||
|
$post['files'] = json_decode($post['files'], TRUE);
|
||||||
$post['has_file'] = true;
|
$post['has_file'] = true;
|
||||||
$post['width'] = &$post['filewidth'];
|
foreach ($post['files'] as $i => &$file) {
|
||||||
$post['height'] = &$post['fileheight'];
|
$file['file_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file'];
|
||||||
|
$file['thumb_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb'];
|
||||||
$post['file_src'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file'];
|
}
|
||||||
$post['file_thumb'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb'];
|
|
||||||
} else {
|
} else {
|
||||||
$post['has_file'] = false;
|
$post['has_file'] = false;
|
||||||
}
|
}
|
||||||
@ -1274,14 +1277,16 @@ function mod_move($originBoard, $postID) {
|
|||||||
$post['op'] = false;
|
$post['op'] = false;
|
||||||
$post['tracked_cites'] = markup($post['body'], true);
|
$post['tracked_cites'] = markup($post['body'], true);
|
||||||
|
|
||||||
|
if ($post['has_file']) {
|
||||||
|
// copy image
|
||||||
|
foreach ($post['files'] as $i => &$file) {
|
||||||
|
$clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']);
|
||||||
|
$clone($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']);
|
||||||
|
}
|
||||||
|
}
|
||||||
// insert reply
|
// insert reply
|
||||||
$newIDs[$post['id']] = $newPostID = post($post);
|
$newIDs[$post['id']] = $newPostID = post($post);
|
||||||
|
|
||||||
if ($post['has_file']) {
|
|
||||||
// copy image
|
|
||||||
$clone($post['file_src'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']);
|
|
||||||
$clone($post['file_thumb'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($post['tracked_cites'])) {
|
if (!empty($post['tracked_cites'])) {
|
||||||
$insert_rows = array();
|
$insert_rows = array();
|
||||||
|
Loading…
Reference in New Issue
Block a user