commit
3442526cc2
85
common.php
85
common.php
|
@ -9,6 +9,7 @@ $Base64Env = [
|
||||||
//'adminloginpage',
|
//'adminloginpage',
|
||||||
'background',
|
'background',
|
||||||
'diskname',
|
'diskname',
|
||||||
|
//'disableShowThumb',
|
||||||
//'disktag',
|
//'disktag',
|
||||||
//'downloadencrypt',
|
//'downloadencrypt',
|
||||||
//'function_name', // used in heroku.
|
//'function_name', // used in heroku.
|
||||||
|
@ -18,6 +19,7 @@ $Base64Env = [
|
||||||
'sitename',
|
'sitename',
|
||||||
'customScript',
|
'customScript',
|
||||||
'customCss',
|
'customCss',
|
||||||
|
'customTheme',
|
||||||
//'theme',
|
//'theme',
|
||||||
//'Drive_ver',
|
//'Drive_ver',
|
||||||
//'Drive_custom',
|
//'Drive_custom',
|
||||||
|
@ -45,6 +47,7 @@ $CommonEnv = [
|
||||||
'adminloginpage',
|
'adminloginpage',
|
||||||
'background',
|
'background',
|
||||||
'disktag',
|
'disktag',
|
||||||
|
'disableShowThumb',
|
||||||
'function_name', // used in heroku.
|
'function_name', // used in heroku.
|
||||||
'hideFunctionalityFile',
|
'hideFunctionalityFile',
|
||||||
'timezone',
|
'timezone',
|
||||||
|
@ -52,6 +55,7 @@ $CommonEnv = [
|
||||||
'sitename',
|
'sitename',
|
||||||
'customScript',
|
'customScript',
|
||||||
'customCss',
|
'customCss',
|
||||||
|
'customTheme',
|
||||||
'theme',
|
'theme',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -64,6 +68,7 @@ $ShowedCommonEnv = [
|
||||||
'adminloginpage',
|
'adminloginpage',
|
||||||
'background',
|
'background',
|
||||||
//'disktag',
|
//'disktag',
|
||||||
|
'disableShowThumb',
|
||||||
//'function_name', // used in heroku.
|
//'function_name', // used in heroku.
|
||||||
'hideFunctionalityFile',
|
'hideFunctionalityFile',
|
||||||
'timezone',
|
'timezone',
|
||||||
|
@ -71,6 +76,7 @@ $ShowedCommonEnv = [
|
||||||
'sitename',
|
'sitename',
|
||||||
'customScript',
|
'customScript',
|
||||||
'customCss',
|
'customCss',
|
||||||
|
'customTheme',
|
||||||
'theme',
|
'theme',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -175,8 +181,6 @@ function main($path)
|
||||||
$_SERVER['timezone'] = getConfig('timezone');
|
$_SERVER['timezone'] = getConfig('timezone');
|
||||||
if (isset($_COOKIE['timezone'])&&$_COOKIE['timezone']!='') $_SERVER['timezone'] = $_COOKIE['timezone'];
|
if (isset($_COOKIE['timezone'])&&$_COOKIE['timezone']!='') $_SERVER['timezone'] = $_COOKIE['timezone'];
|
||||||
if ($_SERVER['timezone']=='') $_SERVER['timezone'] = 0;
|
if ($_SERVER['timezone']=='') $_SERVER['timezone'] = 0;
|
||||||
if (isset($_COOKIE['theme'])&&$_COOKIE['theme']!='') $_SERVER['theme'] = $_COOKIE['theme'];
|
|
||||||
else $_SERVER['theme'] = getConfig('theme');
|
|
||||||
$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);
|
$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);
|
||||||
|
|
||||||
if (getConfig('admin')=='') return install();
|
if (getConfig('admin')=='') return install();
|
||||||
|
@ -305,7 +309,7 @@ function main($path)
|
||||||
if (isset($_GET['thumbnails'])) {
|
if (isset($_GET['thumbnails'])) {
|
||||||
if ($_SERVER['ishidden']<4) {
|
if ($_SERVER['ishidden']<4) {
|
||||||
if (in_array(strtolower(substr($path, strrpos($path, '.') + 1)), $exts['img'])) {
|
if (in_array(strtolower(substr($path, strrpos($path, '.') + 1)), $exts['img'])) {
|
||||||
return get_thumbnails_url($path);
|
return get_thumbnails_url($path, $_GET['location']);
|
||||||
} else return output(json_encode($exts['img']),400);
|
} else return output(json_encode($exts['img']),400);
|
||||||
} else return output('',401);
|
} else return output('',401);
|
||||||
}
|
}
|
||||||
|
@ -364,7 +368,7 @@ function get_access_token($refresh_token)
|
||||||
error_log('failed to get share access_token. response' . json_encode($ret));
|
error_log('failed to get share access_token. response' . json_encode($ret));
|
||||||
throw new Exception($response['stat'].', failed to get share access_token.'.$response['body']);
|
throw new Exception($response['stat'].', failed to get share access_token.'.$response['body']);
|
||||||
}
|
}
|
||||||
error_log('Get access token:'.json_encode($ret, JSON_PRETTY_PRINT));
|
error_log('['.$_SERVER['disktag'].'] Get access token:'.json_encode($ret, JSON_PRETTY_PRINT));
|
||||||
savecache('access_token', $_SERVER['access_token']);
|
savecache('access_token', $_SERVER['access_token']);
|
||||||
$tmp = [];
|
$tmp = [];
|
||||||
$tmp['shareapiurl'] = $_SERVER['api_url'];
|
$tmp['shareapiurl'] = $_SERVER['api_url'];
|
||||||
|
@ -374,10 +378,10 @@ function get_access_token($refresh_token)
|
||||||
if ($response['stat']==200) $ret = json_decode($response['body'], true);
|
if ($response['stat']==200) $ret = json_decode($response['body'], true);
|
||||||
if (!isset($ret['access_token'])) {
|
if (!isset($ret['access_token'])) {
|
||||||
error_log($_SERVER['oauth_url'] . 'token'.'?client_id='. $_SERVER['client_id'] .'&client_secret='. $_SERVER['client_secret'] .'&grant_type=refresh_token&requested_token_use=on_behalf_of&refresh_token=' . $refresh_token);
|
error_log($_SERVER['oauth_url'] . 'token'.'?client_id='. $_SERVER['client_id'] .'&client_secret='. $_SERVER['client_secret'] .'&grant_type=refresh_token&requested_token_use=on_behalf_of&refresh_token=' . $refresh_token);
|
||||||
error_log('failed to get access_token. response' . json_encode($ret));
|
error_log('failed to get ['.$_SERVER['disktag'].'] access_token. response' . json_encode($ret));
|
||||||
throw new Exception($response['stat'].', failed to get access_token.'.$response['body']);
|
throw new Exception($response['stat'].', failed to get ['.$_SERVER['disktag'].'] access_token.'.$response['body']);
|
||||||
}
|
}
|
||||||
error_log('Get access token:'.json_encode($ret, JSON_PRETTY_PRINT));
|
error_log('['.$_SERVER['disktag'].'] Get access token:'.json_encode($ret, JSON_PRETTY_PRINT));
|
||||||
$_SERVER['access_token'] = $ret['access_token'];
|
$_SERVER['access_token'] = $ret['access_token'];
|
||||||
savecache('access_token', $_SERVER['access_token'], $ret['expires_in'] - 300);
|
savecache('access_token', $_SERVER['access_token'], $ret['expires_in'] - 300);
|
||||||
if (time()>getConfig('token_expires')) setConfig([ 'refresh_token' => $ret['refresh_token'], 'token_expires' => time()+7*24*60*60 ]);
|
if (time()>getConfig('token_expires')) setConfig([ 'refresh_token' => $ret['refresh_token'], 'token_expires' => time()+7*24*60*60 ]);
|
||||||
|
@ -777,13 +781,13 @@ function time_format($ISO)
|
||||||
return date('Y-m-d H:i:s',strtotime($ISO . " UTC"));
|
return date('Y-m-d H:i:s',strtotime($ISO . " UTC"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_thumbnails_url($path = '/')
|
function get_thumbnails_url($path = '/', $location = 0)
|
||||||
{
|
{
|
||||||
$path1 = path_format($path);
|
$path1 = path_format($path);
|
||||||
$path = path_format($_SERVER['list_path'] . path_format($path));
|
$path = path_format($_SERVER['list_path'] . path_format($path));
|
||||||
if ($path!='/'&&substr($path,-1)=='/') $path=substr($path,0,-1);
|
if ($path!='/'&&substr($path,-1)=='/') $path=substr($path,0,-1);
|
||||||
$thumb_url = getcache('thumb_'.$path);
|
$thumb_url = getcache('thumb_'.$path);
|
||||||
if ($thumb_url!='') return output($thumb_url);
|
if ($thumb_url=='') {
|
||||||
$url = $_SERVER['api_url'];
|
$url = $_SERVER['api_url'];
|
||||||
if ($path !== '/') {
|
if ($path !== '/') {
|
||||||
$url .= ':' . $path;
|
$url .= ':' . $path;
|
||||||
|
@ -793,7 +797,12 @@ function get_thumbnails_url($path = '/')
|
||||||
$files = json_decode(curl_request($url, false, ['Authorization' => 'Bearer ' . $_SERVER['access_token']])['body'], true);
|
$files = json_decode(curl_request($url, false, ['Authorization' => 'Bearer ' . $_SERVER['access_token']])['body'], true);
|
||||||
if (isset($files['url'])) {
|
if (isset($files['url'])) {
|
||||||
savecache('thumb_'.$path, $files['url']);
|
savecache('thumb_'.$path, $files['url']);
|
||||||
return output($files['url']);
|
$thumb_url = $files['url'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($thumb_url!='') {
|
||||||
|
if ($location) return output('', 302, [ 'Location' => $thumb_url ]);
|
||||||
|
else return output($thumb_url);
|
||||||
}
|
}
|
||||||
return output('', 404);
|
return output('', 404);
|
||||||
}
|
}
|
||||||
|
@ -989,6 +998,7 @@ function adminoperate($path)
|
||||||
$path1 = path_format($_SERVER['list_path'] . path_format($path));
|
$path1 = path_format($_SERVER['list_path'] . path_format($path));
|
||||||
if ($path1!='/'&&substr($path1,-1)=='/') $path1=substr($path1,0,-1);
|
if ($path1!='/'&&substr($path1,-1)=='/') $path1=substr($path1,0,-1);
|
||||||
savecache('path_' . $path1 . '/?password', '', 1);
|
savecache('path_' . $path1 . '/?password', '', 1);
|
||||||
|
savecache('customTheme', '', 1);
|
||||||
return message('<meta http-equiv="refresh" content="2;URL=./">', getconstStr('RefreshCache'), 302);
|
return message('<meta http-equiv="refresh" content="2;URL=./">', getconstStr('RefreshCache'), 302);
|
||||||
}
|
}
|
||||||
return $tmparr;
|
return $tmparr;
|
||||||
|
@ -1569,6 +1579,7 @@ function EnvOpt($needUpdate = 0)
|
||||||
}
|
}
|
||||||
$html .= '
|
$html .= '
|
||||||
</select>
|
</select>
|
||||||
|
'.getconstStr('EnvironmentsDescription')[$key].'
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
} elseif ($key=='theme') {
|
} elseif ($key=='theme') {
|
||||||
|
@ -1585,6 +1596,7 @@ function EnvOpt($needUpdate = 0)
|
||||||
}
|
}
|
||||||
$html .= '
|
$html .= '
|
||||||
</select>
|
</select>
|
||||||
|
'.getconstStr('EnvironmentsDescription')[$key].'
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
} /*elseif ($key=='domain_path') {
|
} /*elseif ($key=='domain_path') {
|
||||||
|
@ -1750,18 +1762,40 @@ function render_list($path = '', $files = '')
|
||||||
Github: https://github.com/qkqpttgf/OneManager-php
|
Github: https://github.com/qkqpttgf/OneManager-php
|
||||||
-->';
|
-->';
|
||||||
|
|
||||||
//$theme = getConfig('theme');
|
|
||||||
$theme = $_SERVER['theme'];
|
if (isset($_COOKIE['theme'])&&$_COOKIE['theme']!='') $theme = $_COOKIE['theme'];
|
||||||
|
if ( $theme=='' ) {
|
||||||
|
$tmp = getConfig('customTheme');
|
||||||
|
if ( $tmp!='' ) $theme = $tmp;
|
||||||
|
}
|
||||||
|
if ( $theme=='' ) {
|
||||||
|
$theme = getConfig('theme');
|
||||||
if ( $theme=='' || !file_exists('theme/'.$theme) ) $theme = 'classic.html';
|
if ( $theme=='' || !file_exists('theme/'.$theme) ) $theme = 'classic.html';
|
||||||
|
}
|
||||||
if (substr($theme,-4)=='.php') {
|
if (substr($theme,-4)=='.php') {
|
||||||
@ob_start();
|
@ob_start();
|
||||||
include 'theme/'.$theme;
|
include 'theme/'.$theme;
|
||||||
$html = ob_get_clean();
|
$html = ob_get_clean();
|
||||||
} else {
|
} else {
|
||||||
|
if (file_exists('theme/'.$theme)) {
|
||||||
$file_path = 'theme/'.$theme;
|
$file_path = 'theme/'.$theme;
|
||||||
$fp = fopen($file_path,"r");
|
$html = file_get_contents($file_path);
|
||||||
$html = fread($fp,filesize($file_path));
|
} else {
|
||||||
fclose($fp);
|
if (!($html = getcache('customTheme'))) {
|
||||||
|
$file_path = $theme;
|
||||||
|
$tmp = curl_request($file_path, false, [], 1);
|
||||||
|
if ($tmp['stat']==302) {
|
||||||
|
error_log(json_encode($tmp));
|
||||||
|
$tmp = curl_request($tmp["returnhead"]["Location"]);
|
||||||
|
}
|
||||||
|
if (!!$tmp['body']) $html = $tmp['body'];
|
||||||
|
savecache('customTheme', $html, 9999);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//$fp = fopen($file_path,"r");
|
||||||
|
//$html = fread($fp,filesize($file_path));
|
||||||
|
//fclose($fp);
|
||||||
|
|
||||||
$tmp = splitfirst($html, '<!--IconValuesStart-->');
|
$tmp = splitfirst($html, '<!--IconValuesStart-->');
|
||||||
$html = $tmp[0];
|
$html = $tmp[0];
|
||||||
|
@ -2009,6 +2043,7 @@ function render_list($path = '', $files = '')
|
||||||
//$FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . str_replace('&','&', $file['name'])), $FolderListStr);
|
//$FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . str_replace('&','&', $file['name'])), $FolderListStr);
|
||||||
$FolderListStr = str_replace('<!--lastModifiedDateTime-->', time_format($file['lastModifiedDateTime']), $FolderListStr);
|
$FolderListStr = str_replace('<!--lastModifiedDateTime-->', time_format($file['lastModifiedDateTime']), $FolderListStr);
|
||||||
$FolderListStr = str_replace('<!--size-->', size_format($file['size']), $FolderListStr);
|
$FolderListStr = str_replace('<!--size-->', size_format($file['size']), $FolderListStr);
|
||||||
|
if (!!$IconValues) {
|
||||||
foreach ($IconValues as $key1 => $value1) {
|
foreach ($IconValues as $key1 => $value1) {
|
||||||
if (isset($exts[$key1])&&in_array($ext, $exts[$key1])) {
|
if (isset($exts[$key1])&&in_array($ext, $exts[$key1])) {
|
||||||
$FolderListStr = str_replace('<!--IconValue-->', $value1, $FolderListStr);
|
$FolderListStr = str_replace('<!--IconValue-->', $value1, $FolderListStr);
|
||||||
|
@ -2020,6 +2055,7 @@ function render_list($path = '', $files = '')
|
||||||
if (!strpos($FolderListStr, '<!--IconValue-->')) break;
|
if (!strpos($FolderListStr, '<!--IconValue-->')) break;
|
||||||
}
|
}
|
||||||
if (strpos($FolderListStr, '<!--IconValue-->')) $FolderListStr = str_replace('<!--IconValue-->', $IconValues['default'], $FolderListStr);
|
if (strpos($FolderListStr, '<!--IconValue-->')) $FolderListStr = str_replace('<!--IconValue-->', $IconValues['default'], $FolderListStr);
|
||||||
|
}
|
||||||
while (strpos($FolderListStr, '<!--filenum-->')) $FolderListStr = str_replace('<!--filenum-->', $filenum, $FolderListStr);
|
while (strpos($FolderListStr, '<!--filenum-->')) $FolderListStr = str_replace('<!--filenum-->', $filenum, $FolderListStr);
|
||||||
$html .= $FolderListStr;
|
$html .= $FolderListStr;
|
||||||
}
|
}
|
||||||
|
@ -2080,6 +2116,8 @@ function render_list($path = '', $files = '')
|
||||||
}
|
}
|
||||||
$html .= $tmp[1];
|
$html .= $tmp[1];
|
||||||
|
|
||||||
|
while (strpos($html, '<!--MaxPageNum-->')) $html = str_replace('<!--MaxPageNum-->', $maxpage, $html);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
while (strpos($html, '<!--MorePageStart-->')) {
|
while (strpos($html, '<!--MorePageStart-->')) {
|
||||||
$tmp = splitfirst($html, '<!--MorePageStart-->');
|
$tmp = splitfirst($html, '<!--MorePageStart-->');
|
||||||
|
@ -2236,7 +2274,7 @@ function render_list($path = '', $files = '')
|
||||||
$folder1 = $tmp1[0];
|
$folder1 = $tmp1[0];
|
||||||
if ($folder1!='') {
|
if ($folder1!='') {
|
||||||
$tmp_url .= $folder1 . '/';
|
$tmp_url .= $folder1 . '/';
|
||||||
$PathArrayStr1 = str_replace('<!--PathArrayLink-->', $tmp_url, $PathArrayStr);
|
$PathArrayStr1 = str_replace('<!--PathArrayLink-->', ($folder1==$files['name']?'':$tmp_url), $PathArrayStr);
|
||||||
$PathArrayStr1 = str_replace('<!--PathArrayName-->', $folder1, $PathArrayStr1);
|
$PathArrayStr1 = str_replace('<!--PathArrayName-->', $folder1, $PathArrayStr1);
|
||||||
$html .= $PathArrayStr1;
|
$html .= $PathArrayStr1;
|
||||||
}
|
}
|
||||||
|
@ -2286,7 +2324,8 @@ function render_list($path = '', $files = '')
|
||||||
$tmp = splitfirst($html, '<!--ShowThumbnailsStart-->');
|
$tmp = splitfirst($html, '<!--ShowThumbnailsStart-->');
|
||||||
$html = $tmp[0];
|
$html = $tmp[0];
|
||||||
$tmp = splitfirst($tmp[1], '<!--ShowThumbnailsEnd-->');
|
$tmp = splitfirst($tmp[1], '<!--ShowThumbnailsEnd-->');
|
||||||
if (!(isset($_SERVER['USER'])&&$_SERVER['USER']=='qcloud')) {
|
//if (!(isset($_SERVER['USER'])&&$_SERVER['USER']=='qcloud')) {
|
||||||
|
if (!getConfig('disableShowThumb')) {
|
||||||
$html .= str_replace('<!--constStr@OriginalPic-->', getconstStr('OriginalPic'), $tmp[0]) . $tmp[1];
|
$html .= str_replace('<!--constStr@OriginalPic-->', getconstStr('OriginalPic'), $tmp[0]) . $tmp[1];
|
||||||
} else $html .= $tmp[1];
|
} else $html .= $tmp[1];
|
||||||
}
|
}
|
||||||
|
@ -2321,7 +2360,7 @@ function render_list($path = '', $files = '')
|
||||||
$html .= $MultiDiskArea . $tmp[1];
|
$html .= $MultiDiskArea . $tmp[1];
|
||||||
$diskname = getConfig('diskname');
|
$diskname = getConfig('diskname');
|
||||||
if ($diskname=='') $diskname = $_SERVER['disktag'];
|
if ($diskname=='') $diskname = $_SERVER['disktag'];
|
||||||
if (strlen($diskname)>10) $diskname = substr($diskname, 0, 7).'...';
|
if (strlen($diskname)>15) $diskname = substr($diskname, 0, 12).'...';
|
||||||
while (strpos($html, '<!--DiskNameNow-->')) $html = str_replace('<!--DiskNameNow-->', $diskname, $html);
|
while (strpos($html, '<!--DiskNameNow-->')) $html = str_replace('<!--DiskNameNow-->', $diskname, $html);
|
||||||
|
|
||||||
$tmp = splitfirst($html, '<!--HeadomfStart-->');
|
$tmp = splitfirst($html, '<!--HeadomfStart-->');
|
||||||
|
@ -2467,15 +2506,21 @@ function render_list($path = '', $files = '')
|
||||||
<option value="">'.getconstStr('Theme').'</option>';
|
<option value="">'.getconstStr('Theme').'</option>';
|
||||||
foreach ($theme_arr as $v1) {
|
foreach ($theme_arr as $v1) {
|
||||||
if ($v1!='.' && $v1!='..') $html .= '
|
if ($v1!='.' && $v1!='..') $html .= '
|
||||||
<option value="'.$v1.'" '.($v1==$_SERVER['theme']?'selected="selected"':'').'>'.$v1.'</option>';
|
<option value="'.$v1.'" '.($v1==$theme?'selected="selected"':'').'>'.$v1.'</option>';
|
||||||
}
|
}
|
||||||
|
//$tmp = getConfig('customTheme');
|
||||||
|
//if ($tmp!='') $html .= '
|
||||||
|
// <option value="" '.($tmp==$theme?'selected="selected"':'').'>customTheme</option>';
|
||||||
$html .= '
|
$html .= '
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function changetheme(str)
|
function changetheme(str)
|
||||||
{
|
{
|
||||||
document.cookie=\'theme=\'+str+\'; path=/\';
|
var expd = new Date();
|
||||||
|
expd.setTime(expd.getTime()+(2*60*60*1000));
|
||||||
|
var expires = "expires="+expd.toGMTString();
|
||||||
|
document.cookie=\'theme=\'+str+\'; path=/; \'+expires;
|
||||||
location.href = location.href;
|
location.href = location.href;
|
||||||
}
|
}
|
||||||
</script>';
|
</script>';
|
||||||
|
|
|
@ -68,11 +68,15 @@ $constStr = [
|
||||||
'adminloginpage' => 'if set, the Login button will not display, and the login page no longer \'?admin\', it is \'?{this value}\'.',
|
'adminloginpage' => 'if set, the Login button will not display, and the login page no longer \'?admin\', it is \'?{this value}\'.',
|
||||||
'customScript' => '<script> in all pages, e.g. http turn to https',
|
'customScript' => '<script> in all pages, e.g. http turn to https',
|
||||||
'customCss' => '<style> in <head>',
|
'customCss' => '<style> in <head>',
|
||||||
|
'customTheme' => 'an url of html',
|
||||||
'domain_path' => 'more custom domain, format is a1.com:/dirto/path1|b2.com:/path2',
|
'domain_path' => 'more custom domain, format is a1.com:/dirto/path1|b2.com:/path2',
|
||||||
'diskname' => 'The disk name you want show.',
|
'diskname' => 'The disk name you want show.',
|
||||||
'disktag' => 'A tag used in store config and url.',
|
'disktag' => 'A tag used in store config and url.',
|
||||||
|
'disableShowThumb' => 'if 1, the ShowThumbnail button will not display',
|
||||||
'downloadencrypt' => '0 or 1. if 1, the files in encrypt folder can be downloaded without password',
|
'downloadencrypt' => '0 or 1. if 1, the files in encrypt folder can be downloaded without password',
|
||||||
'background' => 'Set an url as background photo.',
|
'background' => 'Set an url as background photo.',
|
||||||
|
'theme' => 'Select theme.',
|
||||||
|
'timezone' => 'Set default timezone.',
|
||||||
'guestup_path' => 'Set guest upload dir, before set this, the files in this dir will show as normal.',
|
'guestup_path' => 'Set guest upload dir, before set this, the files in this dir will show as normal.',
|
||||||
'hideFunctionalityFile' => '0 or 1. if 1, some file will not show in list to guest, like readme.md',
|
'hideFunctionalityFile' => '0 or 1. if 1, some file will not show in list to guest, like readme.md',
|
||||||
'passfile' => 'The password of dir will save in this file.',
|
'passfile' => 'The password of dir will save in this file.',
|
||||||
|
@ -85,11 +89,15 @@ $constStr = [
|
||||||
'adminloginpage' => '如果设置,登录按钮及页面隐藏。管理登录的页面不再是\'?admin\',而是\'?此设置的值\'。',
|
'adminloginpage' => '如果设置,登录按钮及页面隐藏。管理登录的页面不再是\'?admin\',而是\'?此设置的值\'。',
|
||||||
'customScript' => '<script>,在所有页都会存在,例如放一个http跳转https',
|
'customScript' => '<script>,在所有页都会存在,例如放一个http跳转https',
|
||||||
'customCss' => '<style>,在<head>最后面',
|
'customCss' => '<style>,在<head>最后面',
|
||||||
|
'customTheme' => 'html格式的主题的url',
|
||||||
'domain_path' => '使用多个自定义域名时,指定每个域名看到的目录。格式为a1.com:/dirto/path1|b1.com:/path2,比private_path优先。',
|
'domain_path' => '使用多个自定义域名时,指定每个域名看到的目录。格式为a1.com:/dirto/path1|b1.com:/path2,比private_path优先。',
|
||||||
'diskname' => '这个盘你想显示什么名称。',
|
'diskname' => '这个盘你想显示什么名称。',
|
||||||
'disktag' => '一个标签,用于保存配置,多盘时会显示在url中。',
|
'disktag' => '一个标签,用于保存配置,多盘时会显示在url中。',
|
||||||
|
'disableShowThumb' => '如果填 1, ‘显示缩略’按钮将被隐藏。',
|
||||||
'downloadencrypt' => '0 或 1。如果 1, 那加密目录内的文件可以不需要密码就能下载。',
|
'downloadencrypt' => '0 或 1。如果 1, 那加密目录内的文件可以不需要密码就能下载。',
|
||||||
'background' => '设置一个url作为背景。',
|
'background' => '设置一个url作为背景。',
|
||||||
|
'theme' => '选择一个主题。',
|
||||||
|
'timezone' => '设置默认时区。',
|
||||||
'guestup_path' => '设置游客上传路径(图床路径),不设置这个值时该目录内容会正常列文件出来,设置后只有上传界面,不显示其中文件(登录后显示)。',
|
'guestup_path' => '设置游客上传路径(图床路径),不设置这个值时该目录内容会正常列文件出来,设置后只有上传界面,不显示其中文件(登录后显示)。',
|
||||||
'hideFunctionalityFile' => '0 或 1。如果 1, 某些文件不列表给游客看,但它的功能正常,比如readme.md',
|
'hideFunctionalityFile' => '0 或 1。如果 1, 某些文件不列表给游客看,但它的功能正常,比如readme.md',
|
||||||
'passfile' => '自定义密码文件的名字,可以是\'pppppp\',也可以是\'aaaa.txt\'等等;列目录时不会显示,只有知道密码才能查看或下载此文件。密码是这个文件的内容,可以空格、可以中文;',
|
'passfile' => '自定义密码文件的名字,可以是\'pppppp\',也可以是\'aaaa.txt\'等等;列目录时不会显示,只有知道密码才能查看或下载此文件。密码是这个文件的内容,可以空格、可以中文;',
|
||||||
|
|
|
@ -151,7 +151,7 @@
|
||||||
<ion-icon name="arrow-back"></ion-icon>
|
<ion-icon name="arrow-back"></ion-icon>
|
||||||
</a>
|
</a>
|
||||||
<!--BackArrowEnd-->
|
<!--BackArrowEnd-->
|
||||||
<h3 class="table-header"><!--Path--></h3>
|
<h3 class="table-header"><!--PathArrayStart--> / <a href="<!--PathArrayLink-->"><!--PathArrayName--></a><!--PathArrayEnd--></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="list-body-container">
|
<div class="list-body-container">
|
||||||
<!--EncryptedStart-->
|
<!--EncryptedStart-->
|
||||||
|
@ -480,7 +480,7 @@
|
||||||
location.href = location.href;
|
location.href = location.href;
|
||||||
}
|
}
|
||||||
<!--ListStart-->
|
<!--ListStart-->
|
||||||
var root = '<!--base_disk_path-->';
|
/*var root = '<!--base_disk_path-->';
|
||||||
function path_format(path) {
|
function path_format(path) {
|
||||||
path = '/' + path + '/';
|
path = '/' + path + '/';
|
||||||
while (path.indexOf('//') !== -1) {
|
while (path.indexOf('//') !== -1) {
|
||||||
|
@ -500,7 +500,7 @@
|
||||||
}
|
}
|
||||||
e.innerHTML += paths[paths.length - 1];
|
e.innerHTML += paths[paths.length - 1];
|
||||||
e.innerHTML = e.innerHTML.replace(/\s\/\s$/, '')
|
e.innerHTML = e.innerHTML.replace(/\s\/\s$/, '')
|
||||||
});
|
});*/
|
||||||
<!--IsFileStart-->
|
<!--IsFileStart-->
|
||||||
var $url = document.getElementById('url');
|
var $url = document.getElementById('url');
|
||||||
if ($url) {
|
if ($url) {
|
||||||
|
|
|
@ -252,6 +252,25 @@
|
||||||
</li>
|
</li>
|
||||||
<!--FileListEnd-->
|
<!--FileListEnd-->
|
||||||
|
|
||||||
|
<!--MorePageStart-->
|
||||||
|
<form action="" method="POST" id="nextpageform">
|
||||||
|
<input type="hidden" id="pagenum" name="pagenum" value="">
|
||||||
|
<li class="mdui-list-item th">
|
||||||
|
<div class="mdui-col-sm-6 mdui-left mdui-text-left">
|
||||||
|
<!--PrePageStart-->
|
||||||
|
<a onclick="nextpage(<!--PrePageNum-->);" class="mdui-btn mdui-btn-raised"><!--constStr@PrePage--></a>
|
||||||
|
<!--PrePageEnd-->
|
||||||
|
<!--NextPageStart-->
|
||||||
|
<a onclick="nextpage(<!--NextPageNum-->);" class="mdui-btn mdui-btn-raised"><!--constStr@NextPage--></a>
|
||||||
|
<!--NextPageEnd-->
|
||||||
|
</div>
|
||||||
|
<div class="mdui-col-sm-6 mdui-right mdui-text-right">
|
||||||
|
<div class="mdui-right mdui-text-right"><span class="mdui-chip-title">Page: <!--MorePageListStart--><!--MorePageListEnd--><!--MorePageListNowStart--><!--PageNum--><!--MorePageListNowEnd-->/<!--MaxPageNum--></span></div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</form>
|
||||||
|
<!--MorePageEnd-->
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -270,10 +289,18 @@
|
||||||
</div>
|
</div>
|
||||||
<!--FootomfEnd-->
|
<!--FootomfEnd-->
|
||||||
</div>
|
</div>
|
||||||
|
<!--ShowThumbnailsStart-->
|
||||||
<a href="javascript:thumb();" class="mdui-fab mdui-fab-fixed mdui-ripple mdui-color-theme-accent"><i class="mdui-icon material-icons">format_list_bulleted</i></a>
|
<a href="javascript:thumb();" class="mdui-fab mdui-fab-fixed mdui-ripple mdui-color-theme-accent"><i class="mdui-icon material-icons">format_list_bulleted</i></a>
|
||||||
|
<!--ShowThumbnailsEnd-->
|
||||||
<!--IsFolderEnd-->
|
<!--IsFolderEnd-->
|
||||||
<!--ListEnd-->
|
<!--ListEnd-->
|
||||||
<script>
|
<script>
|
||||||
|
<!--MorePageStart-->
|
||||||
|
function nextpage(num) {
|
||||||
|
document.getElementById('pagenum').value=num;
|
||||||
|
document.getElementById('nextpageform').submit();
|
||||||
|
}
|
||||||
|
<!--MorePageEnd-->
|
||||||
$ = mdui.JQ;
|
$ = mdui.JQ;
|
||||||
|
|
||||||
$.fn.extend({
|
$.fn.extend({
|
||||||
|
@ -314,7 +341,7 @@
|
||||||
a.click() // 模拟点击
|
a.click() // 模拟点击
|
||||||
a.remove();
|
a.remove();
|
||||||
}
|
}
|
||||||
|
<!--ShowThumbnailsStart-->
|
||||||
function thumb(){
|
function thumb(){
|
||||||
if($('.mdui-fab i').text() == "apps"){
|
if($('.mdui-fab i').text() == "apps"){
|
||||||
$('.mdui-fab i').text("format_list_bulleted");
|
$('.mdui-fab i').text("format_list_bulleted");
|
||||||
|
@ -325,17 +352,17 @@
|
||||||
$('.mdui-fab i').text("apps");
|
$('.mdui-fab i').text("apps");
|
||||||
$('.nexmoe-item').addClass('thumb');
|
$('.nexmoe-item').addClass('thumb');
|
||||||
$('.mdui-col-xs-12 i.mdui-icon').each(function(){
|
$('.mdui-col-xs-12 i.mdui-icon').each(function(){
|
||||||
if($(this).text() == "image" || $(this).text() == "ondemand_video"){
|
if($(this).text() == "image"){
|
||||||
var href = $(this).parent().parent().attr('href');
|
var thumbnails = $(this).parent().parent().attr('href');
|
||||||
var thumb =(href.indexOf('?') == -1)?'?t=220':'&t=220';
|
thumbnails = thumbnails.substr(0, thumbnails.length-8)+'?thumbnails&location';
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
$(this).parent().parent().parent().css("background","url("+href+thumb+") no-repeat center top");
|
$(this).parent().parent().parent().css("background","url("+thumbnails+") no-repeat center top");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
<!--ShowThumbnailsEnd-->
|
||||||
$(function(){
|
$(function(){
|
||||||
$('.file a').each(function(){
|
$('.file a').each(function(){
|
||||||
$(this).on('click', function () {
|
$(this).on('click', function () {
|
||||||
|
|
|
@ -110,7 +110,9 @@
|
||||||
<a href="<!--PathArrayLink-->"><!--PathArrayName--></a>
|
<a href="<!--PathArrayLink-->"><!--PathArrayName--></a>
|
||||||
<!--PathArrayEnd-->
|
<!--PathArrayEnd-->
|
||||||
<div class="mdui-toolbar-spacer"></div>
|
<div class="mdui-toolbar-spacer"></div>
|
||||||
|
<!--ShowThumbnailsStart-->
|
||||||
<a href="javascript:thumb();" id="thumb" class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: '切换显示'}"><i class="mdui-icon material-icons">format_list_bulleted</i></a>
|
<a href="javascript:thumb();" id="thumb" class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: '切换显示'}"><i class="mdui-icon material-icons">format_list_bulleted</i></a>
|
||||||
|
<!--ShowThumbnailsEnd-->
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
@ -339,20 +341,24 @@
|
||||||
<!--FileListEnd-->
|
<!--FileListEnd-->
|
||||||
|
|
||||||
<!--MorePageStart-->
|
<!--MorePageStart-->
|
||||||
|
<form action="" method="POST" id="nextpageform">
|
||||||
|
<input type="hidden" id="pagenum" name="pagenum" value="">
|
||||||
<li class="mdui-list-item th">
|
<li class="mdui-list-item th">
|
||||||
<div class="mdui-col-sm-6 mdui-left mdui-text-left">
|
<div class="mdui-col-sm-6 mdui-left mdui-text-left">
|
||||||
<!--PrePageStart-->
|
<!--PrePageStart-->
|
||||||
<a href="<?php echo preg_replace('/\/$/', '', "$root"); ?><?php e($path) ?>.page-<?php e($page-1) ?>/" class="mdui-btn mdui-btn-raised">上一页</a>
|
<a onclick="nextpage(<!--PrePageNum-->);" class="mdui-btn mdui-btn-raised"><!--constStr@PrePage--></a>
|
||||||
<!--PrePageEnd-->
|
<!--PrePageEnd-->
|
||||||
<!--NextPageStart-->
|
<!--NextPageStart-->
|
||||||
<a href="<?php echo preg_replace('/\/$/', '', "$root"); ?><?php e($path) ?>.page-<?php e($page+1) ?>/" class="mdui-btn mdui-btn-raised">下一页</a>
|
<a onclick="nextpage(<!--NextPageNum-->);" class="mdui-btn mdui-btn-raised"><!--constStr@NextPage--></a>
|
||||||
<!--NextPageEnd-->
|
<!--NextPageEnd-->
|
||||||
</div>
|
</div>
|
||||||
<div class="mdui-col-sm-6 mdui-right mdui-text-right">
|
<div class="mdui-col-sm-6 mdui-right mdui-text-right">
|
||||||
<div class="mdui-right mdui-text-right"><span class="mdui-chip-title">Page: <?php e($page);?>/<?php e($totalpage);?></span></div>
|
<div class="mdui-right mdui-text-right"><span class="mdui-chip-title">Page: <!--MorePageListStart--><!--MorePageListEnd--><!--MorePageListNowStart--><!--PageNum--><!--MorePageListNowEnd-->/<!--MaxPageNum--></span></div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
</form>
|
||||||
<!--MorePageEnd-->
|
<!--MorePageEnd-->
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -377,6 +383,12 @@
|
||||||
<script src="//cdn.jsdelivr.net/gh/mcstudios/glightbox/dist/js/glightbox.min.js"></script>
|
<script src="//cdn.jsdelivr.net/gh/mcstudios/glightbox/dist/js/glightbox.min.js"></script>
|
||||||
<script src="//cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
|
<script src="//cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
<!--MorePageStart-->
|
||||||
|
function nextpage(num) {
|
||||||
|
document.getElementById('pagenum').value=num;
|
||||||
|
document.getElementById('nextpageform').submit();
|
||||||
|
}
|
||||||
|
<!--MorePageEnd-->
|
||||||
var $$ = mdui.JQ;
|
var $$ = mdui.JQ;
|
||||||
$$(function() {
|
$$(function() {
|
||||||
$$('.file .iframe').each(function() {
|
$$('.file .iframe').each(function() {
|
||||||
|
@ -493,7 +505,7 @@ function downall() {
|
||||||
a.click() // 模拟点击
|
a.click() // 模拟点击
|
||||||
a.remove();
|
a.remove();
|
||||||
}
|
}
|
||||||
|
<!--ShowThumbnailsStart-->
|
||||||
function thumb(){
|
function thumb(){
|
||||||
if($('#thumb i').text() == "apps"){
|
if($('#thumb i').text() == "apps"){
|
||||||
$('#thumb i').text("format_list_bulleted");
|
$('#thumb i').text("format_list_bulleted");
|
||||||
|
@ -504,17 +516,20 @@ function thumb(){
|
||||||
$('#thumb i').text("apps");
|
$('#thumb i').text("apps");
|
||||||
$('.nexmoe-item').addClass('thumb');
|
$('.nexmoe-item').addClass('thumb');
|
||||||
$('.mdui-col-xs-12 i.mdui-icon').each(function(){
|
$('.mdui-col-xs-12 i.mdui-icon').each(function(){
|
||||||
if($(this).text() == "image" || $(this).text() == "ondemand_video"){
|
//if($(this).text() == "image" || $(this).text() == "ondemand_video"){
|
||||||
var href = $(this).parent().parent().attr('href');
|
if($(this).text() == "image"){
|
||||||
var thumb =(href.indexOf('?') == -1)?'?t=220':'&t=220';
|
var thumbnails = $(this).parent().parent().attr('href');
|
||||||
|
//var thumb =(href.indexOf('?') == -1)?'?t=220':'&t=220';
|
||||||
|
thumbnails = thumbnails.substr(0, thumbnails.length-8)+'?thumbnails&location';
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
$(this).parent().parent().parent().css("background","url("+href+thumb+") no-repeat center top");
|
//$(this).parent().parent().parent().css("background","url("+href+thumb+") no-repeat center top");
|
||||||
|
$(this).parent().parent().parent().css("background","url("+thumbnails+") no-repeat center top");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
<!--ShowThumbnailsEnd-->
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue