mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-25 16:00:22 +01:00
Show full filename on mouseover.
This commit is contained in:
parent
fe59a89ab3
commit
bae23a2c65
@ -120,6 +120,10 @@
|
||||
$config['body_truncate'] = 15;
|
||||
// Amount of characters to show on the index page
|
||||
$config['body_truncate_char'] = 2500;
|
||||
// Maximum filename length (will be truncated)
|
||||
$config['max_filename_len'] = 255;
|
||||
// Maximum filename length to display (the rest can be viewed upon mouseover)
|
||||
$config['max_filename_display'] = 30;
|
||||
|
||||
$config['threads_per_page'] = 10;
|
||||
$config['max_pages'] = 10;
|
||||
|
@ -352,7 +352,14 @@
|
||||
}
|
||||
if($config['show_filename']) {
|
||||
// Filename
|
||||
$built .= ', ' . $this->filename;
|
||||
$built .= ', ' .
|
||||
(strlen($this->filename) > $config['max_filename_display'] ?
|
||||
'<span title="' . $this->filename . '">' .
|
||||
substr($this->filename, 0, $config['max_filename_display']) . '…' .
|
||||
'</span>'
|
||||
:
|
||||
$this->filename
|
||||
);
|
||||
}
|
||||
|
||||
$built .= ')</span></p>' .
|
||||
@ -511,7 +518,14 @@
|
||||
}
|
||||
if($config['show_filename']) {
|
||||
// Filename
|
||||
$built .= ', ' . $this->filename;
|
||||
$built .= ', ' .
|
||||
(strlen($this->filename) > $config['max_filename_display'] ?
|
||||
'<span title="' . $this->filename . '">' .
|
||||
substr($this->filename, 0, $config['max_filename_display']) . '…' .
|
||||
'</span>'
|
||||
:
|
||||
$this->filename
|
||||
);
|
||||
}
|
||||
|
||||
$built .= ')</span></p>' .
|
||||
|
11
install.php
11
install.php
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
// Installation/upgrade file
|
||||
define('VERSION', 'v0.9.3-dev-7');
|
||||
define('VERSION', 'v0.9.3-dev-8');
|
||||
|
||||
require 'inc/functions.php';
|
||||
require 'inc/display.php';
|
||||
@ -102,8 +102,13 @@
|
||||
}
|
||||
|
||||
foreach($tables as &$table) {
|
||||
query("ALTER TABLE `{$table}` ENGINE = MYISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci");
|
||||
}
|
||||
query("ALTER TABLE `{$table}` ENGINE = MYISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci") or error(db_error());
|
||||
}
|
||||
case 'v0.9.3-dev-7':
|
||||
$boards = listBoards();
|
||||
foreach($boards as &$board) {
|
||||
query(sprintf("ALTER TABLE `posts_%s` CHANGE `filename` `filename` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL", $board['uri'])) or error(db_error());
|
||||
}
|
||||
case false:
|
||||
// Update version number
|
||||
file_write($config['has_installed'], VERSION);
|
||||
|
@ -202,7 +202,7 @@ CREATE TABLE IF NOT EXISTS `posts_b` (
|
||||
`filewidth` int(11) DEFAULT NULL,
|
||||
`fileheight` int(11) DEFAULT NULL,
|
||||
`filesize` int(11) DEFAULT NULL,
|
||||
`filename` varchar(30) DEFAULT NULL,
|
||||
`filename` text DEFAULT NULL,
|
||||
`filehash` text DEFAULT NULL,
|
||||
`password` varchar(20) DEFAULT NULL,
|
||||
`ip` varchar(45) NOT NULL,
|
||||
|
4
post.php
4
post.php
@ -413,8 +413,8 @@
|
||||
|
||||
$is_an_image = !in_array($post['extension'], $config['allowed_ext_files']);
|
||||
|
||||
// Just trim the filename if it's too long
|
||||
if(strlen($post['filename']) > 30) $post['filename'] = substr($post['filename'], 0, 27).'…';
|
||||
// Truncate filename if it is too long
|
||||
$post['filename'] = substr($post['filename'], 0, $config['max_filename_len']);
|
||||
// Move the uploaded file
|
||||
if(!@move_uploaded_file($_FILES['file']['tmp_name'], $post['file'])) error($config['error']['nomove']);
|
||||
|
||||
|
@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS `posts_{board}` (
|
||||
`filewidth` int(11) DEFAULT NULL,
|
||||
`fileheight` int(11) DEFAULT NULL,
|
||||
`filesize` int(11) DEFAULT NULL,
|
||||
`filename` varchar(30) DEFAULT NULL,
|
||||
`filename` text DEFAULT NULL,
|
||||
`filehash` text DEFAULT NULL,
|
||||
`password` varchar(20) DEFAULT NULL,
|
||||
`ip` varchar(45) NOT NULL,
|
||||
|
Loading…
Reference in New Issue
Block a user