Archived
1
0

Holiday changes ;)

This commit is contained in:
Marcel
2018-10-27 12:08:54 +02:00
parent 23a79c98df
commit 774dbc3388
39 changed files with 2931 additions and 2332 deletions

View File

@@ -14,7 +14,7 @@ class File extends MY_Controller
if ($title == null) {
redirect(base_url());
} else {
$file = $this->db->query('SELECT name, type, path FROM files WHERE name = ?', [urldecode($title)])->result_array();
$file = $this->db->query('SELECT name, type, path, isUserData FROM files WHERE name = ?', [urldecode($title)])->result_array();
if (!empty($file)) {
$file = $file[0];
@@ -25,7 +25,7 @@ class File extends MY_Controller
header("Content-Disposition: attachment; filename=" . $file['name'] . '.' . explode('/', $file['type'])[1]);
}
$imagePath = 'files/' . (isset($_GET['w']) || isset($_GET['h']) ? 'thumbs/' : '') . $file['name'] . (isset($_GET['w']) ? '_w' . $_GET['w'] : '') . (isset($_GET['h']) ? '_h' . $_GET['h'] : '') . '.' . explode('.', $file['path'])[1];
$imagePath = 'files/' . ($file['isUserData'] ? 'userContent/' : '') . (isset($_GET['w']) || isset($_GET['h']) ? 'thumbs/' : '') . $file['name'] . (isset($_GET['w']) ? '_w' . $_GET['w'] : '') . (isset($_GET['h']) ? '_h' . $_GET['h'] : '') . '.' . explode('.', $file['path'])[1];
if (!file_exists($imagePath)) {
$config['image_library'] = 'gd2';