Tiny File Manager在windows服务器下乱码修改
Tiny File Manager网址为
https://tinyfilemanager.github.io/
https://github.com/prasathmani/tinyfilemanager
Windows下乱码修改
function fm_convert_win($filename)
{
if (FM_IS_WIN && function_exists('iconv')) {
//$filename = iconv(FM_ICONV_INPUT_ENC, 'UTF-8//IGNORE', $filename);
$filename = mb_convert_encoding($filename,"UTF-8","UTF-8,GBK");
}
return $filename;
}
头部修改
/**
* Show nav block
* @param string $path
*/
function fm_show_nav_path($path)
{
global $lang, $sticky_navbar;
$isStickyNavBar = $sticky_navbar ? 'fixed-top' : '';
?>
<nav class="navbar navbar-expand-lg navbar-light bg-white mb-4 main-nav <?php echo $isStickyNavBar ?>">
<!--a class="navbar-brand" href=""> <?php //echo lng('AppTitle') ?> </a-->
<?php
$path = fm_clean_path($path);
$root_url = "<a href='?p='><i class='fa fa-home' aria-hidden='true' title='" . FM_ROOT_PATH . "'></i></a>";
$sep = '<i class="bread-crumb"> / </i>';
if ($path != '') {
$exploded = explode('/', $path);
$count = count($exploded);
$array = array();
$parent = '';
for ($i = 0; $i < $count; $i++) {
$parent = trim($parent . '/' . $exploded[$i], '/');
$parent_enc = urlencode($parent);
$array[] = "<a href='?p={$parent_enc}'>" . fm_enc(fm_convert_win($exploded[$i])) . "</a>";
}
$root_url .= $sep . implode($sep, $array);
}
echo $root_url ;
?>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<?php
echo '<div class="col-xs-6 col-sm-5">文件及目录列表</div>';
?>
<div class="col-xs-6 col-sm-7 text-right">
<ul class="navbar-nav mr-auto float-right">
<?php if (!FM_READONLY): ?>
<li class="nav-item mr-2">
<div class="input-group input-group-sm mr-1" style="margin-top:4px;">
<input type="text" class="form-control" placeholder="<?php echo lng('Search') ?>" aria-label="<?php echo lng('Search') ?>" aria-describedby="search-addon2" id="search-addon">
<div class="input-group-append">
<span class="input-group-text" id="search-addon2"><i class="fa fa-search"></i></span>
</div>
</div>
</li>
<li class="nav-item">
<a title="<?php echo lng('Upload') ?>" class="nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&upload"><i class="fa fa-cloud-upload" aria-hidden="true"></i> <?php echo lng('Upload') ?></a>
</li>
<li class="nav-item">
<a title="<?php echo lng('NewItem') ?>" class="nav-link" href="#createNewItem" data-toggle="modal" data-target="#createNewItem"><i class="fa fa-plus-square"></i> <?php echo lng('NewItem') ?></a>
</li>
<?php endif; ?>
<?php if (FM_USE_AUTH): ?>
<li class="nav-item avatar dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink-5" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-user-circle"></i> <?php if(isset($_SESSION[FM_SESSION_ID]['logged'])) { echo $_SESSION[FM_SESSION_ID]['logged']; } ?></a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink-5">
<?php if (!FM_READONLY): ?>
<a title="<?php echo lng('Settings') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&settings=1"><i class="fa fa-cog" aria-hidden="true"></i> <?php echo lng('Settings') ?></a>
<?php endif ?>
<a title="<?php echo lng('Help') ?>" class="dropdown-item nav-link" href="?p=<?php echo urlencode(FM_PATH) ?>&help=2"><i class="fa fa-exclamation-circle" aria-hidden="true"></i> <?php echo lng('Help') ?></a>
<a title="<?php echo lng('Logout') ?>" class="dropdown-item nav-link" href="?logout=1"><i class="fa fa-sign-out" aria-hidden="true"></i> <?php echo lng('Logout') ?></a>
</div>
</li>
<?php endif; ?>
</ul>
</div>
</div>
</nav>
<?php
}
默认语言
//Default Configuration
$CONFIG = '{"lang":"zh-CN","error_reporting":false,"show_hidden":true,"hide_Cols":false,"calc_folder":false}';
上传限制
// max upload file size
define('MAX_UPLOAD_SIZE', '2048000');
......
......
@set_time_limit(6000);
date_default_timezone_set($default_timezone);
登录密码
// Auth with login/password (set true/false to enable/disable it)
// Is independent from IP white- and blacklisting
$use_auth = true;
// Users: array('Username' => 'Password', 'Username2' => 'Password2', ...)
// Generate secure password hash - https://tinyfilemanager.github.io/docs/pwd.html
$auth_users = array(
//'admin' => '$2y$10$/K.hjNr84lLNDt8fTXjoI.DBp6PpeyoJ.mGwrrLuCZfAwfSAGqhOW', //admin@123
//'user' => '$2y$10$Fg6Dz8oH9fPoZ2jJan5tZuv6Z4Kp7avtQ9bDfrdRntXtPeiMAZyGO' //12345
'admin' => password_hash('admin@123', PASSWORD_DEFAULT),
'user' => password_hash('12345', PASSWORD_DEFAULT)
);
// Readonly users (username array)
$readonly_users = array(
'user'
);
时区修改
// Default timezone for date() and time() - http://php.net/manual/en/timezones.php
//$default_timezone = 'Etc/UTC'; // UTC
$default_timezone = 'Etc/PRC';
//或者'Etc/GMT-8'
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。