Browse Source

Fix mod_move for multi image

pull/40/head
Fredrick Brennan 10 years ago
parent
commit
53e33d414f
  1. 22
      inc/mod/pages.php

22
inc/mod/pages.php

@ -1096,13 +1096,13 @@ function mod_move_reply($originBoard, $postID) {
$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']; $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'];
$file_src = sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']; }
$file_thumb = sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb'];
} else { } else {
$post['has_file'] = false; $post['has_file'] = false;
} }
@ -1117,10 +1117,12 @@ function mod_move_reply($originBoard, $postID) {
$newID = post($post); $newID = post($post);
if ($post['has_file']) { if ($post['has_file']) {
// move the image foreach ($post['files'] as $i => &$file) {
rename($file_src, sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']); // move the image
if ($post['thumb'] != 'spoiler') { //trying to move/copy the spoiler thumb raises an error rename($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']);
rename($file_thumb, sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb']); if ($file['thumb'] != 'spoiler') { //trying to move/copy the spoiler thumb raises an error
rename($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']);
}
} }
} }

Loading…
Cancel
Save