0b000, // used in heroku. 'SecretId' => 0b000, // used in SCF/CFC. 'SecretKey' => 0b000, // used in SCF/CFC. 'AccessKeyID' => 0b000, // used in FC. 'AccessKeySecret' => 0b000, // used in FC. 'HW_urn' => 0b000, // used in FG. 'HW_key' => 0b000, // used in FG. 'HW_secret' => 0b000, // used in FG. 'HerokuappId' => 0b000, // used in heroku. 'admin' => 0b000, 'adminloginpage' => 0b010, 'autoJumpFirstDisk' => 0b010, 'background' => 0b011, 'backgroundm' => 0b011, 'disableShowThumb' => 0b010, 'disableChangeTheme'=> 0b010, 'disktag' => 0b000, 'hideFunctionalityFile'=> 0b010, 'timezone' => 0b010, 'passfile' => 0b011, 'sitename' => 0b011, 'customScript' => 0b011, 'customCss' => 0b011, 'customTheme' => 0b011, 'theme' => 0b010, 'dontBasicAuth' => 0b010, 'referrer' => 0b011, 'Driver' => 0b100, 'client_id' => 0b100, 'client_secret' => 0b101, 'sharepointSite' => 0b101, 'shareurl' => 0b101, //'sharecookie' => 0b101, 'shareapiurl' => 0b101, 'siteid' => 0b100, 'refresh_token' => 0b100, 'token_expires' => 0b100, 'activeLimit' => 0b100, 'default_drive_id' => 0b100, 'default_sbox_drive_id'=> 0b100, 'diskname' => 0b111, 'diskDescription' => 0b111, 'domain_path' => 0b111, 'downloadencrypt' => 0b110, 'guestup_path' => 0b111, 'domainforproxy' => 0b111, 'public_path' => 0b111, ]; $timezones = array( '-12'=>'Pacific/Kwajalein', '-11'=>'Pacific/Samoa', '-10'=>'Pacific/Honolulu', '-9'=>'America/Anchorage', '-8'=>'America/Los_Angeles', '-7'=>'America/Denver', '-6'=>'America/Mexico_City', '-5'=>'America/New_York', '-4'=>'America/Caracas', '-3.5'=>'America/St_Johns', '-3'=>'America/Argentina/Buenos_Aires', '-2'=>'America/Noronha', '-1'=>'Atlantic/Azores', '0'=>'UTC', '1'=>'Europe/Paris', '2'=>'Europe/Helsinki', '3'=>'Europe/Moscow', '3.5'=>'Asia/Tehran', '4'=>'Asia/Baku', '4.5'=>'Asia/Kabul', '5'=>'Asia/Karachi', '5.5'=>'Asia/Calcutta', //Asia/Colombo '6'=>'Asia/Dhaka', '6.5'=>'Asia/Rangoon', '7'=>'Asia/Bangkok', '8'=>'Asia/Shanghai', '9'=>'Asia/Tokyo', '9.5'=>'Australia/Darwin', '10'=>'Pacific/Guam', '11'=>'Asia/Magadan', '12'=>'Asia/Kamchatka' ); function isCommonEnv($str) { global $EnvConfigs; if (isset($EnvConfigs[$str])) return ( $EnvConfigs[$str] & 0b100 ) ? false : true; else return null; } function isInnerEnv($str) { global $EnvConfigs; if (isset($EnvConfigs[$str])) return ( $EnvConfigs[$str] & 0b100 ) ? true : false; else return null; } function isShowedEnv($str) { global $EnvConfigs; if (isset($EnvConfigs[$str])) return ( $EnvConfigs[$str] & 0b010 ) ? true : false; else return null; } function isBase64Env($str) { global $EnvConfigs; if (isset($EnvConfigs[$str])) return ( $EnvConfigs[$str] & 0b001 ) ? true : false; else return null; } function main($path) { global $exts; global $constStr; global $slash; global $drive; $slash = '/'; if (strpos(__DIR__, ':')) $slash = '\\'; $_SERVER['php_starttime'] = microtime(true); $path = path_format($path); if (in_array($_SERVER['firstacceptlanguage'], array_keys($constStr['languages']))) { $constStr['language'] = $_SERVER['firstacceptlanguage']; } else { $prelang = splitfirst($_SERVER['firstacceptlanguage'], '-')[0]; foreach ( array_keys($constStr['languages']) as $lang) { if ($prelang == splitfirst($lang, '-')[0]) { $constStr['language'] = $lang; break; } } } if (isset($_COOKIE['language'])&&$_COOKIE['language']!='') $constStr['language'] = $_COOKIE['language']; if ($constStr['language']=='') $constStr['language'] = 'en-us'; $_SERVER['language'] = $constStr['language']; $_SERVER['timezone'] = getConfig('timezone'); if (isset($_COOKIE['timezone'])&&$_COOKIE['timezone']!='') $_SERVER['timezone'] = $_COOKIE['timezone']; if ($_SERVER['timezone']=='') $_SERVER['timezone'] = 0; $_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); if (getConfig('admin')=='') return install(); if (getConfig('adminloginpage')=='') { $adminloginpage = 'admin'; } else { $adminloginpage = getConfig('adminloginpage'); } if (isset($_GET[$adminloginpage])) { if (isset($_GET['preview'])) { $url = $_SERVER['PHP_SELF'] . '?preview'; } else { $url = path_format($_SERVER['PHP_SELF'] . '/'); } if (isset($_POST['password1'])) { $compareresult = compareadminsha1($_POST['password1'], $_POST['timestamp'], getConfig('admin')); if ($compareresult=='') { return adminform('admin', adminpass2cookie('admin', getConfig('admin')), $url); } else return adminform($compareresult); } else return adminform(); } if ( isset($_COOKIE['admin'])&&compareadminmd5($_COOKIE['admin'], 'admin', getConfig('admin')) ) { $_SERVER['admin']=1; $_SERVER['needUpdate'] = needUpdate(); } else { $_SERVER['admin']=0; } if (isset($_GET['setup'])) if ($_SERVER['admin']) { // setup Environments. 设置,对环境变量操作 return EnvOpt($_SERVER['needUpdate']); } else { $url = path_format($_SERVER['PHP_SELF'] . '/'); return output('', 302, [ 'Location' => $url ]); } $_SERVER['sitename'] = getConfig('sitename'); if (empty($_SERVER['sitename'])) $_SERVER['sitename'] = getconstStr('defaultSitename'); $_SERVER['base_disk_path'] = $_SERVER['base_path']; $disktags = explode("|", getConfig('disktag')); // echo 'count$disk:'.count($disktags); if (count($disktags)>1) { if ($path=='/'||$path=='') { $files['type'] = 'folder'; $files['childcount'] = count($disktags); $files['showname'] = 'root'; foreach ($disktags as $disktag) { $files['list'][$disktag]['type'] = 'folder'; $files['list'][$disktag]['name'] = $disktag; $files['list'][$disktag]['showname'] = getConfig('diskname', $disktag); } if ($_GET['json']) { // return a json return output(json_encode($files), 200, ['Content-Type' => 'application/json']); } if (getConfig('autoJumpFirstDisk')) return output('', 302, [ 'Location' => path_format($_SERVER['base_path'].'/'.$disktags[0].'/') ]); } else { $_SERVER['disktag'] = splitfirst( substr(path_format($path), 1), '/' )[0]; //$pos = strpos($path, '/'); //if ($pos>1) $_SERVER['disktag'] = substr($path, 0, $pos); if (!in_array($_SERVER['disktag'], $disktags)) { $tmp = path_format($_SERVER['base_path'] . '/' . $disktags[0] . '/' . $path); if (!!$_GET) { $tmp .= '?'; foreach ($_GET as $k => $v) { if ($v === true) $tmp .= $k . '&'; else $tmp .= $k . '=' . $v . '&'; } $tmp = substr($tmp, 0, -1); } return output('Please visit ' . $tmp . '.', 302, [ 'Location' => $tmp ]); //return message('Please visit from Home Page.', 'Error', 404); } $path = substr($path, strlen('/' . $_SERVER['disktag'])); if ($_SERVER['disktag']!='') $_SERVER['base_disk_path'] = path_format($_SERVER['base_disk_path'] . '/' . $_SERVER['disktag'] . '/'); } } else $_SERVER['disktag'] = $disktags[0]; // echo 'main.disktag:'.$_SERVER['disktag'].',path:'.$path.''; $_SERVER['list_path'] = getListpath($_SERVER['HTTP_HOST']); if ($_SERVER['list_path']=='') $_SERVER['list_path'] = '/'; $_SERVER['is_guestup_path'] = is_guestup_path($path); $_SERVER['ajax']=0; if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) if ($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest') $_SERVER['ajax']=1; // Add disk if (isset($_GET['AddDisk'])) { if ($_SERVER['admin']) { if (!class_exists($_GET['AddDisk'])) require 'disk' . $slash . $_GET['AddDisk'] . '.php'; $drive = new $_GET['AddDisk']($_GET['disktag']); return $drive->AddDisk(); } else { $url = $_SERVER['PHP_SELF']; if ($_GET) { $tmp = null; $tmp = ''; foreach ($_GET as $k => $v) { if ($k!='setup') { if ($v===true) $tmp .= '&' . $k; else $tmp .= '&' . $k . '=' . $v; } } $tmp = substr($tmp, 1); if ($tmp!='') $url .= '?' . $tmp; } return output('', 302, [ 'Location' => $url ]); } } if (!isreferhost()) return message('Must visit from designated host', 'NOT_ALLOWED', 403); // Show disks in root if ($files['showname'] == 'root') return render_list($path, $files); if (!driveisfine($_SERVER['disktag'], $drive)) return render_list(); // Operate if ($_SERVER['ajax']) { if ($_GET['action']=='del_upload_cache') { // del '.tmp' without login. 无需登录即可删除.tmp后缀文件 return $drive->del_upload_cache($path); } if ($_GET['action']=='upbigfile') { if (!$_SERVER['admin']) { if (!$_SERVER['is_guestup_path']) return output('Not_Guest_Upload_Folder', 400); if (strpos($_GET['upbigfilename'], '../')!==false) return output('Not_Allow_Cross_Path', 400); } $path1 = path_format($_SERVER['list_path'] . path_format($path)); if (substr($path1, -1)=='/') $path1=substr($path1, 0, -1); return $drive->bigfileupload($path1); } } if ($_SERVER['admin']) { $tmp = adminoperate($path); if ($tmp['statusCode'] > 0) { $path1 = path_format($_SERVER['list_path'] . path_format($path)); if ($path1!='/'&&substr($path1,-1)=='/') $path1 = substr($path1, 0, -1); savecache('path_' . $path1, '', $_SERVER['disktag'], 1); return $tmp; } } else { if ($_SERVER['ajax']) return output(getconstStr('RefreshtoLogin'),401); } $_SERVER['ishidden'] = passhidden($path); if (isset($_GET['thumbnails'])) { if ($_SERVER['ishidden']<4) { if (in_array(strtolower(substr($path, strrpos($path, '.') + 1)), $exts['img'])) { $path1 = path_format($_SERVER['list_path'] . path_format($path)); if ($path1!='/'&&substr($path1, -1)=='/') $path1=substr($path1, 0, -1); $thumb_url = $drive->get_thumbnails_url($path1); if ($thumb_url!='') { if ($_GET['location']) { $url = $thumb_url; $domainforproxy = ''; $domainforproxy = getConfig('domainforproxy', $_SERVER['disktag']); if ($domainforproxy!='') { $url = proxy_replace_domain($url, $domainforproxy); } return output('', 302, [ 'Location' => $url ]); } else return output($thumb_url); } return output('', 404); } else return output(json_encode($exts['img']), 400); } else return output('', 401); } // list folder if ($_SERVER['is_guestup_path'] && !$_SERVER['admin']) { $files = json_decode('{"type":"folder"}', true); } elseif ($_SERVER['ishidden']==4) { if (!getConfig('downloadencrypt', $_SERVER['disktag'])) { $files = json_decode('{"type":"folder"}', true); } else { $path1 = path_format($_SERVER['list_path'] . path_format($path)); if ($path1!='/'&&substr($path1,-1)=='/') $path1=substr($path1, 0, -1); $files = $drive->list_files($path1); if ($files['type']=='folder') $files = json_decode('{"type":"folder"}', true); } } else { $path1 = path_format($_SERVER['list_path'] . path_format($path)); if ($path1!='/'&&substr($path1,-1)=='/') $path1=substr($path1, 0, -1); $files = $drive->list_files($path1); } if ($_GET['json']) { // return a json return output(json_encode($files), 200, ['Content-Type' => 'application/json']); } // random file if (isset($_GET['random'])&&$_GET['random']!=='') { if ($_SERVER['ishidden']<4) { $tmp = []; foreach (array_keys($files['list']) as $filename) { if (strtolower(splitlast($filename, '.')[1])==strtolower($_GET['random'])) $tmp[$filename] = $files['list'][$filename]['url']; } $tmp = array_values($tmp); if (count($tmp)>0) { $url = $tmp[rand(0, count($tmp)-1)]; if (isset($_GET['url'])) return output($url, 200); $domainforproxy = ''; $domainforproxy = getConfig('domainforproxy', $_SERVER['disktag']); if ($domainforproxy!='') { $url = proxy_replace_domain($url, $domainforproxy); } return output('', 302, [ 'Location' => $url ]); } else return output('No ' . $_GET['random'] . 'file', 404); } else return output('Hidden', 401); } // is file && not preview mode, download file if ($files['type']=='file' && !isset($_GET['preview'])) { if ( $_SERVER['ishidden']<4 || (!!getConfig('downloadencrypt', $_SERVER['disktag'])&&$files['name']!=getConfig('passfile')) ) { $url = $files['url']; $domainforproxy = ''; $domainforproxy = getConfig('domainforproxy', $_SERVER['disktag']); if ($domainforproxy!='') { $url = proxy_replace_domain($url, $domainforproxy); } if ( strtolower(splitlast($files['name'], '.')[1])=='html' ) return output($files['content']['body'], $files['content']['stat']); else { if ($_SERVER['HTTP_RANGE']!='') $header['Range'] = $_SERVER['HTTP_RANGE']; $header['Location'] = $url; return output('', 302, $header); } } } // Show folder if ( $files['type']=='folder' || $files['type']=='file' ) { return render_list($path, $files); } else { if (!isset($files['error'])) { if (is_array($files)) $files['error']['message'] = json_encode($files, JSON_PRETTY_PRINT); else $files['error']['message'] = $files; $files['error']['code'] = 'unknownError'; $files['error']['stat'] = 500; } return message('
' . $files['error']['message'] . '
' . json_encode($ispassfile, JSON_PRETTY_PRINT) . ''; if ($ispassfile['type']=='file') { $arr = curl('GET', $ispassfile['url']); if ($arr['stat']==200) { $passwordf=explode("\n",$arr['body']); $password=$passwordf[0]; if ($password==='') { return ''; } else { $password=md5($password); savecache('path_' . $path1 . '/?password', $password, $_SERVER['disktag']); return $password; } } else { //return md5('DefaultP@sswordWhenNetworkError'); return md5( md5(time()).rand(1000,9999) ); } } else { savecache('path_' . $path1 . '/?password', 'null', $_SERVER['disktag']); if ($path !== '' ) { $path = substr($path,0,strrpos($path,'/')); return gethiddenpass($path,$passfile); } else { return ''; } } } elseif ($password==='null') { if ($path !== '' ) { $path = substr($path,0,strrpos($path,'/')); return gethiddenpass($path,$passfile); } else { return ''; } } else return $password; // return md5('DefaultP@sswordWhenNetworkError'); } function get_timezone($timezone = '8') { global $timezones; if ($timezone=='') $timezone = '8'; return $timezones[$timezone]; } function message($message, $title = 'Message', $statusCode = 200) { return output('
' . $message . '
', $statusCode); } function needUpdate() { global $slash; $current_version = file_get_contents(__DIR__ . $slash . 'version'); $current_ver = substr($current_version, strpos($current_version, '.')+1); $current_ver = explode(urldecode('%0A'),$current_ver)[0]; $current_ver = explode(urldecode('%0D'),$current_ver)[0]; $split = splitfirst($current_version, '.' . $current_ver)[0] . '.' . $current_ver; if (!($github_version = getcache('github_version'))) { $tmp = curl('GET', 'https://raw.githubusercontent.com/qkqpttgf/OneManager-php/master/version'); if ($tmp['stat']==0) return 0; $github_version = $tmp['body']; savecache('github_version', $github_version); } $github_ver = substr($github_version, strpos($github_version, '.')+1); $github_ver = explode(urldecode('%0A'),$github_ver)[0]; $github_ver = explode(urldecode('%0D'),$github_ver)[0]; if ($current_ver != $github_ver) { //$_SERVER['github_version'] = $github_version; $_SERVER['github_ver_new'] = splitfirst($github_version, $split)[0]; $_SERVER['github_ver_old'] = splitfirst($github_version, $_SERVER['github_ver_new'])[1]; return 1; } return 0; } function output($body, $statusCode = 200, $headers = ['Content-Type' => 'text/html'], $isBase64Encoded = false) { if (isset($_SERVER['Set-Cookie'])) $headers['Set-Cookie'] = $_SERVER['Set-Cookie']; $headers['Referrer-Policy'] = 'no-referrer'; //$headers['Referrer-Policy'] = 'same-origin'; $headers['X-Frame-Options'] = 'sameorigin'; return [ 'isBase64Encoded' => $isBase64Encoded, 'statusCode' => $statusCode, 'headers' => $headers, 'body' => $body ]; } function passhidden($path) { if ($_SERVER['admin']) return 0; $path = str_replace('+','%2B',$path); $path = str_replace('&','&', path_format(urldecode($path))); if (getConfig('passfile') != '') { $path = spurlencode($path,'/'); if (substr($path,-1)=='/') $path=substr($path,0,-1); $hiddenpass=gethiddenpass($path, getConfig('passfile')); if ($hiddenpass != '') { return comppass($hiddenpass); } else { return 1; } } else { return 0; } return 4; } function size_format($byte) { $i = 0; while (abs($byte) >= 1024) { $byte = $byte / 1024; $i++; if ($i == 3) break; } $units = array('B', 'KB', 'MB', 'GB', 'TB'); $ret = round($byte, 2); return ($ret . ' ' . $units[$i]); } function time_format($ISO) { if ($ISO=='') return date('Y-m-d H:i:s'); $ISO = str_replace('T', ' ', $ISO); $ISO = str_replace('Z', ' ', $ISO); return date('Y-m-d H:i:s',strtotime($ISO . " UTC")); } function adminform($name = '', $pass = '', $path = '') { $html = 'Driver | ' . getConfig('Driver', $disktag); if ($diskok && baseclassofdrive($disk_tmp)!='Aliyundrive') $html .= ' ' . getconstStr('ChangeDrivetype') . ''; $html .= ' |
' . $ext_env . ' | ' . getConfig($ext_env, $disktag) . ' |
' . ($disk_tmp->error['body']?$disk_tmp->error['stat'] . ' ' . $disk_tmp->error['body']:'Add this disk again.') . ' |
' . json_encode($files, JSON_PRETTY_PRINT) . ''; if (isset($_COOKIE['theme'])&&$_COOKIE['theme']!='') $theme = $_COOKIE['theme']; if ( !file_exists(__DIR__ . $slash .'theme' . $slash . $theme) ) $theme = ''; if ( $theme=='' ) { $tmp = getConfig('customTheme'); if ( $tmp!='' ) $theme = $tmp; } if ( $theme=='' ) { $theme = getConfig('theme'); if ( $theme=='' || !file_exists(__DIR__ . $slash .'theme' . $slash . $theme) ) $theme = 'classic.html'; } if (substr($theme,-4)=='.php') { @ob_start(); include 'theme/' . $theme; $html = ob_get_clean(); } else { if (file_exists(__DIR__ . $slash .'theme' . $slash . $theme)) { $file_path = __DIR__ . $slash .'theme' . $slash . $theme; $html = file_get_contents($file_path); } else { if (!($html = getcache('customTheme'))) { $file_path = $theme; $tmp = curl('GET', $file_path, false, [], 1); if ($tmp['stat']==302) { error_log1(json_encode($tmp)); $tmp = curl('GET', $tmp["returnhead"]["Location"]); } if (!!$tmp['body']) $html = $tmp['body']; savecache('customTheme', $html, '', 9999); } } $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $IconValues = json_decode($tmp[0], true); $html .= $tmp[1]; if (!$files) { //$html = '
'.json_encode($files, JSON_PRETTY_PRINT).'' . $html; $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } } if ($_SERVER['admin']) { $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); } while (strpos($html, '')) $html = str_replace('', getconstStr('Operate'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Create'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Encrypt'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('RefreshCache'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Setup'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Logout'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Rename'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Submit'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Delete'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Copy'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Move'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Folder'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('File'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Name'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Content'), $html); } else { $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } if (getConfig('adminloginpage')=='') { while (strpos($html, '')) $html = str_replace('', '', $html); while (strpos($html, '')) $html = str_replace('', '', $html); } else { $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } } while (strpos($html, '')) $html = str_replace('', '', $html); while (strpos($html, '')) $html = str_replace('', '', $html); } if ($_SERVER['ishidden']==4) { // 加密状态 if (!getConfig('dontBasicAuth')) { // use Basic Auth return output('Need password.', 401, ['WWW-Authenticate'=>'Basic realm="Secure Area"']); } /*$tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; }*/ $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); } $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } } else { while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); } } while (strpos($html, '')) $html = str_replace('', getconstStr('Download'), $html); if ($_SERVER['is_guestup_path']&&!$_SERVER['admin']) { $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); } while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } } else { while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); } } $DriverFile = scandir(__DIR__ . $slash . 'disk'); $Driver_arr = null; foreach ($DriverFile as $v1) { if ($v1!='.' && $v1!='..') { $v1 = splitlast($v1, '.php')[0]; $Driver_arr[] = $v1; } } if ($_SERVER['is_guestup_path']||( $_SERVER['admin']&&$files['type']=='folder'&&$_SERVER['ishidden']<4 )) { while (strpos($html, '')) $html = str_replace('', '', $html); while (strpos($html, '')) $html = str_replace('', '', $html); $now_driver = baseclassofdrive(); unset($Driver_arr[$now_driver]); while (strpos($html, '')) $html = str_replace('', '', $html); while (strpos($html, '')) $html = str_replace('', '', $html); foreach ($Driver_arr as $driver) { while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } } while (strpos($html, '')) $html = str_replace('', getconstStr('Calculate'), $html); } else { $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } foreach ($Driver_arr as $driver) { while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } } } if ($files['type']=='file') { while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); } $html = str_replace('', str_replace('%2523', '%23', str_replace('%26amp%3B','&',spurlencode(path_format($_SERVER['base_disk_path'] . '/' . $path), '/'))), $html); $html = str_replace('', path_format($_SERVER['base_disk_path'] . '/' . $path), $html); $ext = strtolower(substr($path, strrpos($path, '.') + 1)); if (in_array($ext, $exts['img'])) $ext = 'img'; elseif (in_array($ext, $exts['video'])) $ext = 'video'; elseif (in_array($ext, $exts['music'])) $ext = 'music'; //elseif (in_array($ext, $exts['pdf'])) $ext = 'pdf'; elseif ($ext=='pdf') $ext = 'pdf'; elseif (in_array($ext, $exts['office'])) $ext = 'office'; elseif (in_array($ext, $exts['txt'])) $ext = 'txt'; else $ext = 'Other'; $previewext = ['img', 'video', 'music', 'pdf', 'office', 'txt', 'Other']; $previewext = array_diff($previewext, [ $ext ]); foreach ($previewext as $ext1) { $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } } while (strpos($html, '')) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); } //while (strpos($html, '')) $html = str_replace('', $files['url'], $html); while (strpos($html, '')) $html = str_replace('', path_format($_SERVER['base_disk_path'] . '/' . $path), $html); while (strpos($html, '')) $html = str_replace('', path_format($_SERVER['base_disk_path'] . '/' . $path), $html); while (strpos($html, '')) $html = str_replace('', $files['name'], $html); //$html = str_replace('', urlencode($files['url']), $html); while (strpos($html, '')) $html = str_replace('', urlencode(path_format($_SERVER['base_disk_path'] . '/' . $path)), $html); $html = str_replace('', getconstStr('ClicktoEdit'), $html); $html = str_replace('', getconstStr('CancelEdit'), $html); $html = str_replace('', getconstStr('Save'), $html); while (strpos($html, '')) $html = str_replace('', htmlspecialchars(curl('GET', $files['url'], '', '', 0, 1)['body']), $html); //while (strpos($html, '')) $html = str_replace('', htmlspecialchars(get_content(spurlencode(path_format(urldecode($path) . '/' . $files['name']), '/'))['content']['body']), $html); $html = str_replace('', getconstStr('FileNotSupport'), $html); //$html = str_replace('', getconstStr('File'), $html); } elseif ($files['type']=='folder') { while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } while (strpos($html, '')) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); } $html = str_replace('', getconstStr('File'), $html); $html = str_replace('', getconstStr('ShowThumbnails'), $html); $html = str_replace('', getconstStr('CopyAllDownloadUrl'), $html); $html = str_replace('', getconstStr('EditTime'), $html); $html = str_replace('', getconstStr('Size'), $html); $filenum = 0; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $FolderList = $tmp[0]; foreach ($files['list'] as $file) { if ($file['type']=='folder') { if ($_SERVER['admin'] or !isHideFile($file['name'])) { $filenum++; $FolderListStr = str_replace('', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . encode_str_replace($file['name'])), $FolderList); $FolderListStr = str_replace('', $file['id'], $FolderListStr); $FolderListStr = str_replace('', str_replace('&','&', $file['showname']?$file['showname']:$file['name']), $FolderListStr); $FolderListStr = str_replace('', time_format($file['time']), $FolderListStr); $FolderListStr = str_replace('', size_format($file['size']), $FolderListStr); while (strpos($FolderListStr, '')) $FolderListStr = str_replace('', $filenum, $FolderListStr); $html .= $FolderListStr; } } } $html .= $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $FolderList = $tmp[0]; foreach ($files['list'] as $file) { if ($file['type']=='file') { if ($_SERVER['admin'] or !isHideFile($file['name'])) { $filenum++; $ext = strtolower(substr($file['name'], strrpos($file['name'], '.') + 1)); $FolderListStr = $FolderList; while (strpos($FolderListStr, '')) $FolderListStr = str_replace('', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . encode_str_replace($file['name'])), $FolderListStr); $FolderListStr = str_replace('', $ext, $FolderListStr); if (in_array($ext, $exts['music'])) $FolderListStr = str_replace('', 'audio', $FolderListStr); elseif (in_array($ext, $exts['video'])) $FolderListStr = str_replace('', 'iframe', $FolderListStr); else $FolderListStr = str_replace('', '', $FolderListStr); $FolderListStr = str_replace('', str_replace('&','&', $file['name']), $FolderListStr); $FolderListStr = str_replace('', $file['id'], $FolderListStr); //$FolderListStr = str_replace('', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . str_replace('&','&', $file['name'])), $FolderListStr); $FolderListStr = str_replace('', time_format($file['time']), $FolderListStr); $FolderListStr = str_replace('', size_format($file['size']), $FolderListStr); if (!!$IconValues) { foreach ($IconValues as $key1 => $value1) { if (isset($exts[$key1])&&in_array($ext, $exts[$key1])) { $FolderListStr = str_replace('', $value1, $FolderListStr); } if ($ext==$key1) { $FolderListStr = str_replace('', $value1, $FolderListStr); } //error_log1('file:'.$file['name'].':'.$key1); if (!strpos($FolderListStr, '')) break; } if (strpos($FolderListStr, '')) $FolderListStr = str_replace('', $IconValues['default'], $FolderListStr); } while (strpos($FolderListStr, '')) $FolderListStr = str_replace('', $filenum, $FolderListStr); $html .= $FolderListStr; } } } $html .= $tmp[1]; while (strpos($html, '')) $html = str_replace('', $filenum, $html); if ($files['childcount']>200) { while (strpos($html, '')) $html = str_replace('', '', $html); while (strpos($html, '')) $html = str_replace('', '', $html); $pagenum = $files['page']; if ($pagenum=='') $pagenum = 1; $maxpage = ceil($files['childcount']/200); if ($pagenum!=1) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); $html = str_replace('', getconstStr('PrePage'), $html); $html = str_replace('', $pagenum-1, $html); } else { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } //$html .= json_encode($files['folder']); if ($pagenum!=$maxpage) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); $html = str_replace('', getconstStr('NextPage'), $html); $html = str_replace('', $pagenum+1, $html); } else { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $MorePageListNow = str_replace('', $pagenum, $tmp[0]); $html .= $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $MorePageList = $tmp[0]; for ($page=1;$page<=$maxpage;$page++) { if ($page == $pagenum) { $MorePageListStr = $MorePageListNow; } else { $MorePageListStr = str_replace('', $page, $MorePageList); $MorePageListStr = str_replace('', $page, $MorePageListStr); } $html .= $MorePageListStr; } $html .= $tmp[1]; while (strpos($html, '')) $html = str_replace('', $maxpage, $html); } else { while (strpos($html, '')) { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } } } $html = str_replace('', $constStr['language'], $html); $title = $pretitle; if ($_SERVER['base_disk_path']!=$_SERVER['base_path']) { if (getConfig('diskname')!='') $diskname = getConfig('diskname'); else $diskname = $_SERVER['disktag']; $title .= ' - ' . $diskname; } $title .= ' - ' . $_SERVER['sitename']; $html = str_replace('', $title, $html); $keywords = $n_path; if ($p_path!='') $keywords .= ', ' . $p_path; if ($_SERVER['sitename']!='OneManager') $keywords .= ', ' . $_SERVER['sitename'] . ', OneManager'; else $keywords .= ', OneManager'; $html = str_replace('', $keywords, $html); if ($_GET['preview']) { $description = $n_path.', '.getconstStr('Preview');//'Preview of '. } elseif ($files['type']=='folder') { $description = $n_path.', '.getconstStr('List');//'List of '.$n_path.'. '; } //$description .= 'In '.$_SERVER['sitename']; $html = str_replace('', $description, $html); while (strpos($html, '')) $html = str_replace('', (substr($_SERVER['base_disk_path'],-1)=='/'?substr($_SERVER['base_disk_path'],0,-1):$_SERVER['base_disk_path']), $html); while (strpos($html, '')) $html = str_replace('', $_SERVER['base_path'], $html); while (strpos($html, '')) $html = str_replace('', str_replace('%23', '#', str_replace('&','&', path_format($path.'/'))), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Home'), $html); $html = str_replace('', getConfig('customCss'), $html); $html = str_replace('', getConfig('customScript'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Login'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Close'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('InputPassword'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('InputPasswordUWant'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Submit'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Success'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('GetUploadLink'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('UpFileTooLarge'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('UploadStart'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('UploadStartAt'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('LastUpload'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('ThisTime'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Upload'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('AverageSpeed'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('CurrentSpeed'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Expect'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('UploadErrorUpAgain'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('EndAt'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('UploadComplete'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('CopyUrl'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('UploadFail23'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('GetFileNameFail'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('UploadFile'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('UploadFolder'), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('FileSelected'), $html); while (strpos($html, '')) $html = str_replace('', (isset($_GET['preview'])?'?preview&':'?'), $html); $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); if (getConfig('background')) { $html .= str_replace('', getConfig('background'), $tmp[0]); } $html .= $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); if (getConfig('backgroundm')) { $html .= str_replace('', getConfig('backgroundm'), $tmp[0]); } $html .= $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; if ($tmp[1]!='') { $tmp = splitfirst($tmp[1], ''); $PathArrayStr = $tmp[0]; $tmp_url = $_SERVER['base_disk_path']; $tmp_path = str_replace('&','&', substr(urldecode($_SERVER['PHP_SELF']), strlen($tmp_url))); while ($tmp_path!='') { $tmp1 = splitfirst($tmp_path, '/'); $folder1 = $tmp1[0]; if ($folder1!='') { $tmp_url .= $folder1 . '/'; $PathArrayStr1 = str_replace('', ($folder1==$files['name']?'':$tmp_url), $PathArrayStr); $PathArrayStr1 = str_replace('', $folder1, $PathArrayStr1); $html .= $PathArrayStr1; } $tmp_path = $tmp1[1]; } $html .= $tmp[1]; } $tmp = splitfirst($html, ''); $html = $tmp[0]; if ($tmp[1]!='') { $tmp = splitfirst($tmp[1], ''); $PathArrayStr = $tmp[0]; $tmp_url = $_SERVER['base_path']; $tmp_path = str_replace('&','&', substr(urldecode($_SERVER['PHP_SELF']), strlen($tmp_url))); while ($tmp_path!='') { $tmp1 = splitfirst($tmp_path, '/'); $folder1 = $tmp1[0]; if ($folder1!='') { $tmp_url .= $folder1 . '/'; $PathArrayStr1 = str_replace('', ($folder1==$files['name']?'':$tmp_url), $PathArrayStr); $PathArrayStr1 = str_replace('', ($folder1==$_SERVER['disktag']?(getConfig('diskname')==''?$_SERVER['disktag']:getConfig('diskname')):$folder1), $PathArrayStr1); $html .= $PathArrayStr1; } $tmp_path = $tmp1[1]; } $html .= $tmp[1]; } $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $SelectLanguage = $tmp[0]; foreach ($constStr['languages'] as $key1 => $value1) { $SelectLanguageStr = str_replace('', $key1, $SelectLanguage); $SelectLanguageStr = str_replace('', $value1, $SelectLanguageStr); $SelectLanguageStr = str_replace('', ($key1==$constStr['language']?'selected="selected"':''), $SelectLanguageStr); $html .= $SelectLanguageStr; } $html .= $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $NeedUpdateStr = $tmp[0]; if (isset($_SERVER['needUpdate'])&&$_SERVER['needUpdate']) $NeedUpdateStr = str_replace('', getconstStr('NeedUpdate'), $NeedUpdateStr); else $NeedUpdateStr =''; $html .= $NeedUpdateStr . $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $current_url = path_format($_SERVER['PHP_SELF'] . '/'); if ($current_url !== $_SERVER['base_path']) { while (substr($current_url, -1) === '/') { $current_url = substr($current_url, 0, -1); } if (strpos($current_url, '/') !== FALSE) { $parent_url = substr($current_url, 0, strrpos($current_url, '/')); } else { $parent_url = $current_url; } $BackArrow = str_replace('', $parent_url.'/', $tmp[0]); } $html .= $BackArrow . $tmp[1]; $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); //if (!(isset($_SERVER['USER'])&&$_SERVER['USER']=='qcloud')) { if (!getConfig('disableShowThumb')) { $html .= str_replace('', getconstStr('OriginalPic'), $tmp[0]) . $tmp[1]; } else $html .= $tmp[1]; } $imgextstr = ''; foreach ($exts['img'] as $imgext) $imgextstr .= '\''.$imgext.'\', '; $html = str_replace('', $imgextstr, $html); $html = str_replace('', $_SERVER['sitename'], $html); $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $disktags = explode("|",getConfig('disktag')); if (count($disktags)>1) { $tmp1 = $tmp[1]; $tmp = splitfirst($tmp[0], ''); $MultiDiskArea = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $MultiDisks = $tmp[0]; foreach ($disktags as $disk) { $diskname = getConfig('diskname', $disk); if ($diskname=='') $diskname = $disk; $MultiDisksStr = str_replace('', path_format($_SERVER['base_path'].'/'.$disk.'/'), $MultiDisks); $MultiDisksStr = str_replace('', ($_SERVER['disktag']==$disk?' now':''), $MultiDisksStr); $MultiDisksStr = str_replace('', $diskname, $MultiDisksStr); $MultiDiskArea .= $MultiDisksStr; } $MultiDiskArea .= $tmp[1]; $tmp[1] = $tmp1; } $html .= $MultiDiskArea . $tmp[1]; $diskname = getConfig('diskname', $_SERVER['disktag']); if ($diskname=='') $diskname = $_SERVER['disktag']; //if (strlen($diskname)>15) $diskname = substr($diskname, 0, 12).'...'; while (strpos($html, '')) $html = str_replace('', $diskname, $html); $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); if (isset($files['list']['head.omf'])) { $headomf = str_replace('', get_content(spurlencode(path_format($path . '/head.omf'), '/'))['content']['body'], $tmp[0]); } $html .= $headomf . $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); if (isset($files['list']['head.md'])) { $headmd = str_replace('', get_content(spurlencode(path_format($path . '/head.md'), '/'))['content']['body'], $tmp[0]); $html .= $headmd . $tmp[1]; while (strpos($html, '')) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); } } else { $html .= $tmp[1]; $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } } $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html_aft = $tmp[1]; if ($files) { $listarea = $tmp[0]; } $html .= $listarea . $html_aft; } $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); if (isset($files['list']['readme.md'])) { $Readmemd = str_replace('', get_content(spurlencode(path_format($path . '/readme.md'),'/'))['content']['body'], $tmp[0]); $html .= $Readmemd . $tmp[1]; while (strpos($html, '')) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); } } else { $html .= $tmp[1]; $tmp[1] = 'a'; while ($tmp[1]!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } } $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); if (isset($files['list']['foot.omf'])) { $Footomf = str_replace('', get_content(spurlencode(path_format($path . '/foot.omf'),'/'))['content']['body'], $tmp[0]); } $html .= $Footomf . $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); if (isset($files['list']['head.md'])||isset($files['list']['readme.md'])) { $html .= $tmp[0] . $tmp[1]; } else $html .= $tmp[1]; if (getConfig('passfile')!='') { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= str_replace('', getconstStr('Encrypt'), $tmp[0]) . $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } else { $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= str_replace('', getconstStr('SetpassfileBfEncrypt'), $tmp[0]) . $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $html .= $tmp[1]; } $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); if ($path != '/') { $html .= str_replace('', getconstStr('ParentDir'), $tmp[0]) . $tmp[1]; } else $html .= $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); $MoveDirs = $tmp[0]; if ($files['type']=='folder') { foreach ($files['list'] as $file) { if ($file['type']=='folder') { $MoveDirsStr = str_replace('', str_replace('&','&', $file['name']), $MoveDirs); $MoveDirsStr = str_replace('', str_replace('&','&', $file['name']), $MoveDirsStr); $html .= $MoveDirsStr; } } } $html .= $tmp[1]; $tmp = splitfirst($html, ''); $html = $tmp[0]; $tmp = splitfirst($tmp[1], ''); if (!isset($_COOKIE['timezone'])) $html .= str_replace('', $_SERVER['timezone'], $tmp[0]); $html .= $tmp[1]; while (strpos($html, '')) $html = str_replace('', $_SERVER['timezone'], $html); while (strpos($html, '{{.RawData}}')) { $str = '['; $i = 0; foreach ($files['list'] as $file) if ($_SERVER['admin'] or !isHideFile($file['name'])) { $tmp = []; $tmp['name'] = $file['name']; $tmp['size'] = size_format($file['size']); $tmp['date'] = time_format($file['lastModifiedDateTime']); $tmp['@time'] = $file['date']; $tmp['@type'] = ($file['type']=='folder')?'folder':'file'; $str .= json_encode($tmp).','; } if ($str == '[') { $str = ''; } else $str = substr($str, 0, -1).']'; $html = str_replace('{{.RawData}}', base64_encode($str), $html); } // 最后清除换行 while (strpos($html, "\r\n\r\n")) $html = str_replace("\r\n\r\n", "\r\n", $html); //while (strpos($html, "\r\r")) $html = str_replace("\r\r", "\r", $html); while (strpos($html, "\n\n")) $html = str_replace("\n\n", "\n", $html); //while (strpos($html, PHP_EOL.PHP_EOL)) $html = str_replace(PHP_EOL.PHP_EOL, PHP_EOL, $html); $exetime = round(microtime(true)-$_SERVER['php_starttime'],3); //$ip2city = json_decode(curl('GET', 'http://ip.taobao.com/outGetIpInfo?ip=' . $_SERVER['REMOTE_ADDR'] . '&accessKey=alibaba-inc')['body'], true); //if ($ip2city['code']===0) $city = ' ' . $ip2city['data']['city']; $html = str_replace('', date("Y-m-d H:i:s") . " " . getconstStr('Week')[date("w")] . " " . $_SERVER['REMOTE_ADDR'] . $city . ' Runningtime:' . $exetime . 's Mem:' . size_format(memory_get_usage()), $html); } if ($_SERVER['admin']||!getConfig('disableChangeTheme')) { $theme_arr = scandir(__DIR__ . $slash . 'theme'); $selecttheme = '