|
@ -28,6 +28,12 @@ function mod_page($title, $template, $args, $subtitle = false) { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function clone_wrapped_with_exist_check($clonefn, $src, $dest) { |
|
|
|
|
|
if (file_exists($src)) { |
|
|
|
|
|
$clonefn($src, $dest); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function mod_login($redirect = false) { |
|
|
function mod_login($redirect = false) { |
|
|
global $config; |
|
|
global $config; |
|
|
|
|
|
|
|
@ -1353,9 +1359,9 @@ function mod_move($originBoard, $postID) { |
|
|
// copy image |
|
|
// copy image |
|
|
foreach ($post['files'] as $i => &$file) { |
|
|
foreach ($post['files'] as $i => &$file) { |
|
|
if ($file['file'] !== 'deleted') |
|
|
if ($file['file'] !== 'deleted') |
|
|
$clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); |
|
|
clone_wrapped_with_exist_check($clone, $file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); |
|
|
if (isset($file['thumb']) && !in_array($file['thumb'], array('spoiler', 'deleted', 'file'))) |
|
|
if (isset($file['thumb']) && !in_array($file['thumb'], array('spoiler', 'deleted', 'file'))) |
|
|
$clone($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); |
|
|
clone_wrapped_with_exist_check($clone, $file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1416,8 +1422,8 @@ function mod_move($originBoard, $postID) { |
|
|
if ($post['has_file']) { |
|
|
if ($post['has_file']) { |
|
|
// copy image |
|
|
// copy image |
|
|
foreach ($post['files'] as $i => &$file) { |
|
|
foreach ($post['files'] as $i => &$file) { |
|
|
$clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); |
|
|
clone_wrapped_with_exist_check($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']); |
|
|
clone_wrapped_with_exist_check($clone, $file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// insert reply |
|
|
// insert reply |
|
@ -1610,9 +1616,9 @@ function mod_merge($originBoard, $postID) { |
|
|
// copy image |
|
|
// copy image |
|
|
foreach ($post['files'] as $i => &$file) { |
|
|
foreach ($post['files'] as $i => &$file) { |
|
|
if ($file['file'] !== 'deleted') |
|
|
if ($file['file'] !== 'deleted') |
|
|
$clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); |
|
|
clone_wrapped_with_exist_check($clone, $file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); |
|
|
if (isset($file['thumb']) && !in_array($file['thumb'], array('spoiler', 'deleted', 'file'))) |
|
|
if (isset($file['thumb']) && !in_array($file['thumb'], array('spoiler', 'deleted', 'file'))) |
|
|
$clone($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); |
|
|
clone_wrapped_with_exist_check($clone, $file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1673,8 +1679,8 @@ function mod_merge($originBoard, $postID) { |
|
|
if ($post['has_file']) { |
|
|
if ($post['has_file']) { |
|
|
// copy image |
|
|
// copy image |
|
|
foreach ($post['files'] as $i => &$file) { |
|
|
foreach ($post['files'] as $i => &$file) { |
|
|
$clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); |
|
|
clone_wrapped_with_exist_check($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']); |
|
|
clone_wrapped_with_exist_check($clone, $file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// insert reply |
|
|
// insert reply |
|
|