summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/config.php14
-rw-r--r--inc/display.php10
2 files changed, 18 insertions, 6 deletions
diff --git a/inc/config.php b/inc/config.php
index 3eac19d5..b2f4e7c8 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -35,7 +35,9 @@
'custom_tripcode' => Array(),
'dnsbl' => Array(),
'dnsbl_exceptions' => Array(),
- 'remote' => Array()
+ 'remote' => Array(),
+ 'allowed_ext_files' => Array(),
+ 'file_icons' => Array()
);
/*
@@ -326,14 +328,18 @@
$config['ie_mime_type_detection'] = '/<(?:body|head|html|img|plaintext|pre|script|table|title|a href|channel|scriptlet)/i';
// Allowed image file extensions
- $config['allowed_ext'] = Array('jpg', 'jpeg', 'bmp', 'gif', 'png');
// $config['allowed_ext'][] = 'svg';
// Allowed additional file extensions (not images; downloadable files)
- $config['allowed_ext_files'] = Array();
+ // $config['allowed_ext_files'][] = 'txt';
+ // $config['allowed_ext_files'][] = 'zip';
+
+ // Non-image file icons
+ $config['file_icons']['default'] = 'file.png';
+ $config['file_icons']['zip'] = 'zip.png';
// Thumbnail to use for the downloadable files (not images)
- $config['file_thumb'] = 'static/file.png';
+ $config['file_thumb'] = 'static/%s';
// Thumbnail to use for spoiler images
$config['spoiler_image'] = 'static/spoiler.png';
diff --git a/inc/display.php b/inc/display.php
index 0248a3b4..fc15c152 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -365,7 +365,10 @@
);
}
+ $ext = explode('.', $this->file);
+ $ext = $ext[1];
$built .= ')</span></p>' .
+
// Thumbnail
'<a href="' .
$config['uri_img'] .$this->file .
@@ -373,7 +376,7 @@
($this->thumb == 'file' ? ' class="file"' : '') .
'><img src="' .
($this->thumb == 'file' ?
- $config['root'] . $config['file_thumb']
+ $config['root'] . sprintf($config['file_thumb'], isset($config['file_icons'][$ext]) ? $config['file_icons'][$ext] : $config['file_icons']['default'])
:
($this->thumb == 'spoiler' ?
$config['root'] . $config['spoiler_image']
@@ -538,7 +541,10 @@
);
}
+ $ext = explode('.', $this->file);
+ $ext = $ext[1];
$built .= ')</span></p>' .
+
// Thumbnail
'<a href="' .
$config['uri_img'] .$this->file .
@@ -546,7 +552,7 @@
($this->thumb == 'file' ? ' class="file"' : '') .
'><img src="' .
($this->thumb == 'file' ?
- $config['root'] . $config['file_thumb']
+ $config['root'] . sprintf($config['file_thumb'], isset($config['file_icons'][$ext]) ? $config['file_icons'][$ext] : $config['file_icons']['default'])
:
($this->thumb == 'spoiler' ?
$config['root'] . $config['spoiler_image']