diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-11-19 00:22:48 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-11-19 00:22:48 +1100 |
| commit | 0279cfd3fbb489d35a42facef749878c3a4c9e46 (patch) | |
| tree | 9e28de395add1ac6ea84e3b8003518ac716faf03 /post.php | |
| parent | f25365dec55a9dc93ad7f3f79b6ee46ff8343614 (diff) | |
Ability to customize filenames, replacing the standard UNIX timestamp + random
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -311,7 +311,10 @@ if($post['has_file']) { $post['extension'] = strtolower(substr($post['filename'], strrpos($post['filename'], '.') + 1)); - $post['file_id'] = time() . rand(100, 999); + if(isset($config['filename_func'])) + $post['file_id'] = $config['filename_func']($post); + else + $post['file_id'] = time() . rand(100, 999); $post['file'] = $board['dir'] . $config['dir']['img'] . $post['file_id'] . '.' . $post['extension']; $post['thumb'] = $board['dir'] . $config['dir']['thumb'] . $post['file_id'] . '.' . ($config['thumb_ext'] ? $config['thumb_ext'] : $post['extension']); } |
