Browse Source

Merge pull request #245 from ghost/patch-2

Bug fixing inc.
main
Fredrick Brennan 7 years ago
committed by GitHub
parent
commit
09b373cf60
  1. 13
      inc/mod/pages.php
  2. 2
      templates/post/fileinfo.html

13
inc/mod/pages.php

@ -1167,6 +1167,7 @@ function mod_move_reply($originBoard, $postID) {
$post['has_file'] = true;
foreach ($post['files'] as $i => &$file) {
$file['file_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file'];
if (isset($file['thumb']))
$file['thumb_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb'];
}
} else {
@ -1185,9 +1186,10 @@ function mod_move_reply($originBoard, $postID) {
if ($post['has_file']) {
foreach ($post['files'] as $i => &$file) {
// move the image
if (isset($file['thumb']))
if ($file['thumb'] != 'spoiler' || $file['thumb'] != 'deleted') { //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']);
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']);
rename($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']);
}
}
}
@ -1355,8 +1357,11 @@ function mod_move($originBoard, $postID) {
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']);
if (isset($file['thumb']))
if ($file['thumb'] != 'spoiler' || $file['thumb'] != 'deleted') { //trying to move/copy the spoiler thumb raises an error
$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

2
templates/post/fileinfo.html

@ -5,7 +5,7 @@
{% for file in post.files %}
<div class="file{% if post.num_files > 1 %} multifile" style="width:{{ file.thumbwidth + 40 }}px"{% else %}"{% endif %}>
{% if file.file == 'deleted' %}
<img class="post-image deleted" src="{{ config.image_deleted }}" alt="" />
<img class="post-image deleted" src="{{ config.root }}{{ config.image_deleted }}" alt="" />
{% else %}
<p class="fileinfo">File: <a href="{{ config.uri_img }}{{ file.file }}">{{ file.file }}</a> <span class="unimportant">
(

Loading…
Cancel
Save