Merge pull request #700 from qkqpttgf/fixCustomTheme

fix customTheme
pull/695/merge
qkqpttgf 2023-08-21 18:14:53 +08:00 committed by GitHub
commit e7fa472f74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 502 additions and 550 deletions

View File

@ -105,43 +105,37 @@ $timezones = array(
'12' => 'Asia/Kamchatka' '12' => 'Asia/Kamchatka'
); );
function isCommonEnv($str) function isCommonEnv($str) {
{
global $EnvConfigs; global $EnvConfigs;
if (isset($EnvConfigs[$str])) return ($EnvConfigs[$str] & 0b0100) ? false : true; if (isset($EnvConfigs[$str])) return ($EnvConfigs[$str] & 0b0100) ? false : true;
else return null; else return null;
} }
function isInnerEnv($str) function isInnerEnv($str) {
{
global $EnvConfigs; global $EnvConfigs;
if (isset($EnvConfigs[$str])) return ($EnvConfigs[$str] & 0b0100) ? true : false; if (isset($EnvConfigs[$str])) return ($EnvConfigs[$str] & 0b0100) ? true : false;
else return null; else return null;
} }
function isShowedEnv($str) function isShowedEnv($str) {
{
global $EnvConfigs; global $EnvConfigs;
if (isset($EnvConfigs[$str])) return ($EnvConfigs[$str] & 0b0010) ? true : false; if (isset($EnvConfigs[$str])) return ($EnvConfigs[$str] & 0b0010) ? true : false;
else return null; else return null;
} }
function isBase64Env($str) function isBase64Env($str) {
{
global $EnvConfigs; global $EnvConfigs;
if (isset($EnvConfigs[$str])) return ($EnvConfigs[$str] & 0b0001) ? true : false; if (isset($EnvConfigs[$str])) return ($EnvConfigs[$str] & 0b0001) ? true : false;
else return null; else return null;
} }
function isSwitchEnv($str) function isSwitchEnv($str) {
{
global $EnvConfigs; global $EnvConfigs;
if (isset($EnvConfigs[$str])) return ($EnvConfigs[$str] & 0b1000) ? true : false; if (isset($EnvConfigs[$str])) return ($EnvConfigs[$str] & 0b1000) ? true : false;
else return null; else return null;
} }
function main($path) function main($path) {
{
global $exts; global $exts;
global $constStr; global $constStr;
global $slash; global $slash;
@ -535,8 +529,7 @@ function main($path)
} }
} }
function get_content($path) function get_content($path) {
{
global $drive; global $drive;
$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);
@ -545,8 +538,7 @@ function get_content($path)
return $file; return $file;
} }
function driveisfine($tag, &$drive = null) function driveisfine($tag, &$drive = null) {
{
global $slash; global $slash;
$disktype = getConfig('Driver', $tag); $disktype = getConfig('Driver', $tag);
if (!$disktype) return false; if (!$disktype) return false;
@ -556,8 +548,7 @@ function driveisfine($tag, &$drive = null)
else return false; else return false;
} }
function baseclassofdrive($d = null) function baseclassofdrive($d = null) {
{
global $drive; global $drive;
if (!$d) $dr = $drive; if (!$d) $dr = $drive;
else $dr = $d; else $dr = $d;
@ -565,8 +556,7 @@ function baseclassofdrive($d = null)
return $dr->show_base_class(); return $dr->show_base_class();
} }
function extendShow_diskenv($drive) function extendShow_diskenv($drive) {
{
if (!$drive) return []; if (!$drive) return [];
return $drive->ext_show_innerenv(); return $drive->ext_show_innerenv();
} }
@ -597,15 +587,13 @@ function no_return_curl($method, $url, $data = '') {
curl_close($ch); curl_close($ch);
} }
function adminpass2cookie($name, $pass, $timestamp) function adminpass2cookie($name, $pass, $timestamp) {
{
return md5($name . ':' . md5($pass) . '@' . $timestamp) . "(" . $timestamp . ")"; return md5($name . ':' . md5($pass) . '@' . $timestamp) . "(" . $timestamp . ")";
} }
function adminpass2storage($name, $pass, $timestamp, $rand) { function adminpass2storage($name, $pass, $timestamp, $rand) {
return md5($timestamp . '/' . $pass . '^' . $name . '*' . $rand) . "(" . $rand . ")"; return md5($timestamp . '/' . $pass . '^' . $name . '*' . $rand) . "(" . $rand . ")";
} }
function compareadminmd5($name, $pass, $cookie, $storage = 'default') function compareadminmd5($name, $pass, $cookie, $storage = 'default') {
{
$c = splitfirst($cookie, '('); $c = splitfirst($cookie, '(');
$c_md5 = $c[0]; $c_md5 = $c[0];
$c_time = substr($c[1], 0, -1); $c_time = substr($c[1], 0, -1);
@ -624,8 +612,7 @@ function compareadminmd5($name, $pass, $cookie, $storage = 'default')
return false; return false;
} }
function compareadminsha1($adminsha1, $timestamp, $pass) function compareadminsha1($adminsha1, $timestamp, $pass) {
{
if (!is_numeric($timestamp)) return 'Timestamp not Number'; if (!is_numeric($timestamp)) return 'Timestamp not Number';
if (abs(time() - $timestamp) > 5 * 60) { if (abs(time() - $timestamp) > 5 * 60) {
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
@ -635,8 +622,7 @@ function compareadminsha1($adminsha1, $timestamp, $pass)
else return 'Error password'; else return 'Error password';
} }
function proxy_replace_domain($url, $domainforproxy, &$header) function proxy_replace_domain($url, $domainforproxy, &$header) {
{
global $drive; global $drive;
$tmp = splitfirst($url, '//'); $tmp = splitfirst($url, '//');
$http = $tmp[0]; $http = $tmp[0];
@ -658,14 +644,14 @@ function proxy_replace_domain($url, $domainforproxy, &$header)
function bchexdec($hex) { function bchexdec($hex) {
$len = strlen($hex); $len = strlen($hex);
$dec = 0;
for ($i = 1; $i <= $len; $i++) for ($i = 1; $i <= $len; $i++)
$dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i)))); $dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i))));
return $dec; return $dec;
} }
function isHideFile($name) function isHideFile($name) {
{
$FunctionalityFile = [ $FunctionalityFile = [
'head.md', 'head.md',
'readme.md', 'readme.md',
@ -683,20 +669,17 @@ function isHideFile($name)
return false; return false;
} }
function getcache($str, $disktag = '') function getcache($str, $disktag = '') {
{
$cache = filecache($disktag); $cache = filecache($disktag);
return $cache->fetch($str); return $cache->fetch($str);
} }
function savecache($key, $value, $disktag = '', $exp = 1800) function savecache($key, $value, $disktag = '', $exp = 1800) {
{
$cache = filecache($disktag); $cache = filecache($disktag);
return $cache->save($key, $value, $exp); return $cache->save($key, $value, $exp);
} }
function filecache($disktag) function filecache($disktag) {
{
$dir = sys_get_temp_dir(); $dir = sys_get_temp_dir();
if (!is_writable($dir)) { if (!is_writable($dir)) {
$tmp = __DIR__ . '/tmp/'; $tmp = __DIR__ . '/tmp/';
@ -732,8 +715,7 @@ function calcDownKey($filename, $key = '') {
} }
} }
function findIndexPath($rootpath, $path = '') function findIndexPath($rootpath, $path = '') { // find the path of the first 'index.php' that not in rootpath.
{// find the path of the first 'index.php' that not in rootpath.
global $slash; global $slash;
if (substr($rootpath, -1) == $slash) $rootpath = substr($rootpath, 0, -1); if (substr($rootpath, -1) == $slash) $rootpath = substr($rootpath, 0, -1);
if (substr($path, 0, 1) == $slash) $path = substr($path, 1); if (substr($path, 0, 1) == $slash) $path = substr($path, 1);
@ -753,8 +735,7 @@ function findIndexPath($rootpath, $path = '')
return ''; return '';
} }
function sortConfig(&$arr) function sortConfig(&$arr) {
{
ksort($arr); ksort($arr);
if (isset($arr['disktag'])) { if (isset($arr['disktag'])) {
@ -787,15 +768,13 @@ function chkTxtCode($str) {
return false; return false;
} }
function getconstStr($str) function getconstStr($str) {
{
global $constStr; global $constStr;
if ($constStr[$str][$constStr['language']] != '') return $constStr[$str][$constStr['language']]; if ($constStr[$str][$constStr['language']] != '') return $constStr[$str][$constStr['language']];
return $constStr[$str]['en-us']; return $constStr[$str]['en-us'];
} }
function getListpath($domain) function getListpath($domain) {
{
$domain_path1 = getConfig('domain_path', $_SERVER['disktag']); $domain_path1 = getConfig('domain_path', $_SERVER['disktag']);
$public_path = getConfig('public_path', $_SERVER['disktag']); $public_path = getConfig('public_path', $_SERVER['disktag']);
$tmp_path = ''; $tmp_path = '';
@ -816,8 +795,7 @@ function getListpath($domain)
return spurlencode($public_path, '/'); return spurlencode($public_path, '/');
} }
function path_format($path) function path_format($path) {
{
$path = '/' . $path; $path = '/' . $path;
while (strpos($path, '//') !== FALSE) { while (strpos($path, '//') !== FALSE) {
$path = str_replace('//', '/', $path); $path = str_replace('//', '/', $path);
@ -825,8 +803,7 @@ function path_format($path)
return $path; return $path;
} }
function spurlencode($str, $split='') function spurlencode($str, $split = '') {
{
$str = str_replace(' ', '%20', $str); $str = str_replace(' ', '%20', $str);
$tmp = ''; $tmp = '';
if ($split != '') { if ($split != '') {
@ -843,8 +820,7 @@ function spurlencode($str, $split='')
return $tmp; return $tmp;
} }
function base64y_encode($str) function base64y_encode($str) {
{
$str = base64_encode($str); $str = base64_encode($str);
while (substr($str, -1) == '=') $str = substr($str, 0, -1); while (substr($str, -1) == '=') $str = substr($str, 0, -1);
while (strpos($str, '+') !== false) $str = str_replace('+', '-', $str); while (strpos($str, '+') !== false) $str = str_replace('+', '-', $str);
@ -852,8 +828,7 @@ function base64y_encode($str)
return $str; return $str;
} }
function base64y_decode($str) function base64y_decode($str) {
{
while (strpos($str, '_') !== false) $str = str_replace('_', '/', $str); while (strpos($str, '_') !== false) $str = str_replace('_', '/', $str);
while (strpos($str, '-') !== false) $str = str_replace('-', '+', $str); while (strpos($str, '-') !== false) $str = str_replace('-', '+', $str);
while (strlen($str) % 4) $str .= '='; while (strlen($str) % 4) $str .= '=';
@ -862,13 +837,11 @@ function base64y_decode($str)
return $str; return $str;
} }
function error_log1($str) function error_log1($str) {
{
error_log($str); error_log($str);
} }
function is_guestup_path($path) function is_guestup_path($path) {
{
if (getConfig('guestup_path', $_SERVER['disktag']) != '') { if (getConfig('guestup_path', $_SERVER['disktag']) != '') {
$a1 = path_format(path_format(urldecode($_SERVER['list_path'] . path_format($path))) . '/'); $a1 = path_format(path_format(urldecode($_SERVER['list_path'] . path_format($path))) . '/');
$a2 = path_format(path_format(getConfig('guestup_path', $_SERVER['disktag'])) . '/'); $a2 = path_format(path_format(getConfig('guestup_path', $_SERVER['disktag'])) . '/');
@ -877,13 +850,11 @@ function is_guestup_path($path)
return 0; return 0;
} }
function array_value_isnot_null($arr) function array_value_isnot_null($arr) {
{
return $arr !== ''; return $arr !== '';
} }
function curl($method, $url, $data = '', $headers = [], $returnheader = 0, $location = 0) function curl($method, $url, $data = '', $headers = [], $returnheader = 0, $location = 0) {
{
//if (!isset($headers['Accept'])) $headers['Accept'] = '*/*'; //if (!isset($headers['Accept'])) $headers['Accept'] = '*/*';
//if (!isset($headers['Referer'])) $headers['Referer'] = $url; //if (!isset($headers['Referer'])) $headers['Referer'] = $url;
//if (!isset($headers['Content-Type'])) $headers['Content-Type'] = 'application/x-www-form-urlencoded'; //if (!isset($headers['Content-Type'])) $headers['Content-Type'] = 'application/x-www-form-urlencoded';
@ -906,8 +877,10 @@ function curl($method, $url, $data = '', $headers = [], $returnheader = 0, $loca
if ($location) curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); if ($location) curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
//$response['body'] = curl_exec($ch); //$response['body'] = curl_exec($ch);
if ($returnheader) { if ($returnheader) {
$tmpres = splitlast(curl_exec($ch), "\r\n\r\n"); $tmpresult = curl_exec($ch);
$result['body'] = $tmpres[1]; //error_log1($tmpresult);
$tmpres = splitlast($tmpresult, "\r\n\r\n");
$response['body'] = $tmpres[1];
$returnhead = $tmpres[0]; $returnhead = $tmpres[0];
//echo "HEAD:" . $returnhead; //echo "HEAD:" . $returnhead;
foreach (explode("\r\n", $returnhead) as $head) { foreach (explode("\r\n", $returnhead) as $head) {
@ -923,8 +896,7 @@ function curl($method, $url, $data = '', $headers = [], $returnheader = 0, $loca
return $response; return $response;
} }
function clearbehindvalue($path,$page1,$maxpage,$pageinfocache) function clearbehindvalue($path, $page1, $maxpage, $pageinfocache) {
{
for ($page = $page1 + 1; $page < $maxpage; $page++) { for ($page = $page1 + 1; $page < $maxpage; $page++) {
$pageinfocache['nextlink_' . $path . '_page_' . $page] = ''; $pageinfocache['nextlink_' . $path . '_page_' . $page] = '';
} }
@ -932,8 +904,7 @@ function clearbehindvalue($path,$page1,$maxpage,$pageinfocache)
return $pageinfocache; return $pageinfocache;
} }
function comppass($pass) function comppass($pass) {
{
if ($_POST['password1'] !== '') if (md5($_POST['password1']) === $pass) { if ($_POST['password1'] !== '') if (md5($_POST['password1']) === $pass) {
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
$_SERVER['Set-Cookie'] = 'password=' . $pass . '; expires=' . date(DATE_COOKIE, strtotime('+1hour')); $_SERVER['Set-Cookie'] = 'password=' . $pass . '; expires=' . date(DATE_COOKIE, strtotime('+1hour'));
@ -954,8 +925,7 @@ function comppass($pass)
return 4; return 4;
} }
function encode_str_replace($str) function encode_str_replace($str) {
{
$str = str_replace('%', '%25', $str); $str = str_replace('%', '%25', $str);
if (strpos($str, '&amp;')) $str = str_replace('&amp;', '&amp;amp;', $str); if (strpos($str, '&amp;')) $str = str_replace('&amp;', '&amp;amp;', $str);
$str = str_replace('+', '%2B', $str); $str = str_replace('+', '%2B', $str);
@ -963,8 +933,7 @@ function encode_str_replace($str)
return $str; return $str;
} }
function gethiddenpass($path,$passfile) function gethiddenpass($path, $passfile) {
{
$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);
$password = getcache('path_' . $path1 . '/?password', $_SERVER['disktag']); $password = getcache('path_' . $path1 . '/?password', $_SERVER['disktag']);
@ -1007,15 +976,13 @@ function gethiddenpass($path,$passfile)
// return md5('DefaultP@sswordWhenNetworkError'); // return md5('DefaultP@sswordWhenNetworkError');
} }
function get_timezone($timezone = '8') function get_timezone($timezone = '8') {
{
global $timezones; global $timezones;
if ($timezone == '') $timezone = '8'; if ($timezone == '') $timezone = '8';
return $timezones[$timezone]; return $timezones[$timezone];
} }
function message($message, $title = 'Message', $statusCode = 200, $wainstat = 0) function message($message, $title = 'Message', $statusCode = 200, $wainstat = 0) {
{
$html = ' $html = '
<html lang="' . $_SERVER['language'] . '"> <html lang="' . $_SERVER['language'] . '">
<html> <html>
@ -1080,8 +1047,7 @@ function message($message, $title = 'Message', $statusCode = 200, $wainstat = 0)
return output($html, $statusCode); return output($html, $statusCode);
} }
function needUpdate() function needUpdate() {
{
global $slash; global $slash;
$current_version = file_get_contents(__DIR__ . $slash . 'version'); $current_version = file_get_contents(__DIR__ . $slash . 'version');
$current_ver = substr($current_version, strpos($current_version, '.') + 1); $current_ver = substr($current_version, strpos($current_version, '.') + 1);
@ -1107,8 +1073,7 @@ function needUpdate()
return 0; return 0;
} }
function output($body, $statusCode = 200, $headers = ['Content-Type' => 'text/html'], $isBase64Encoded = false) function output($body, $statusCode = 200, $headers = ['Content-Type' => 'text/html'], $isBase64Encoded = false) {
{
if (isset($_SERVER['Set-Cookie'])) $headers['Set-Cookie'] = $_SERVER['Set-Cookie']; if (isset($_SERVER['Set-Cookie'])) $headers['Set-Cookie'] = $_SERVER['Set-Cookie'];
if (baseclassofdrive() == 'Aliyundrive' || baseclassofdrive() == 'BaiduDisk') $headers['Referrer-Policy'] = 'no-referrer'; if (baseclassofdrive() == 'Aliyundrive' || baseclassofdrive() == 'BaiduDisk') $headers['Referrer-Policy'] = 'no-referrer';
//$headers['Referrer-Policy'] = 'same-origin'; //$headers['Referrer-Policy'] = 'same-origin';
@ -1121,8 +1086,7 @@ function output($body, $statusCode = 200, $headers = ['Content-Type' => 'text/ht
]; ];
} }
function passhidden($path) function passhidden($path) {
{
if ($_SERVER['admin']) return 0; if ($_SERVER['admin']) return 0;
//$path = str_replace('+','%2B',$path); //$path = str_replace('+','%2B',$path);
//$path = str_replace('&amp;','&', path_format(urldecode($path))); //$path = str_replace('&amp;','&', path_format(urldecode($path)));
@ -1141,8 +1105,7 @@ function passhidden($path)
return 4; return 4;
} }
function size_format($byte) function size_format($byte) {
{
$i = 0; $i = 0;
while (abs($byte) >= 1024) { while (abs($byte) >= 1024) {
$byte = $byte / 1024; $byte = $byte / 1024;
@ -1154,16 +1117,14 @@ function size_format($byte)
return ($ret . ' ' . $units[$i]); return ($ret . ' ' . $units[$i]);
} }
function time_format($ISO) function time_format($ISO) {
{
if ($ISO == '') return date('Y-m-d H:i:s'); if ($ISO == '') return date('Y-m-d H:i:s');
$ISO = str_replace('T', ' ', $ISO); $ISO = str_replace('T', ' ', $ISO);
$ISO = str_replace('Z', ' ', $ISO); $ISO = str_replace('Z', ' ', $ISO);
return date('Y-m-d H:i:s', strtotime($ISO . " UTC")); return date('Y-m-d H:i:s', strtotime($ISO . " UTC"));
} }
function adminform($name = '', $pass = '', $storage = '', $path = '') function adminform($name = '', $pass = '', $storage = '', $path = '') {
{
$html = '<html> $html = '<html>
<head> <head>
<title>' . getconstStr('AdminLogin') . '</title> <title>' . getconstStr('AdminLogin') . '</title>
@ -1244,8 +1205,7 @@ function adminform($name = '', $pass = '', $storage = '', $path = '')
return output($html, $statusCode); return output($html, $statusCode);
} }
function adminoperate($path) function adminoperate($path) {
{
global $drive; global $drive;
if ($_SERVER['REQUEST_METHOD'] == 'POST') if (!driveisfine($_SERVER['disktag'], $drive)) return output($_SERVER['disktag'] ? 'disk [ ' . $_SERVER['disktag'] . ' ] error.' : 'Not in drive', 403); if ($_SERVER['REQUEST_METHOD'] == 'POST') if (!driveisfine($_SERVER['disktag'], $drive)) return output($_SERVER['disktag'] ? 'disk [ ' . $_SERVER['disktag'] . ' ] error.' : 'Not in drive', 403);
$path1 = path_format($_SERVER['list_path'] . '/' . $path); $path1 = path_format($_SERVER['list_path'] . '/' . $path);
@ -1351,8 +1311,7 @@ function adminoperate($path)
return $tmparr; return $tmparr;
} }
function splitfirst($str, $split) function splitfirst($str, $split) {
{
$len = strlen($split); $len = strlen($split);
$pos = strpos($str, $split); $pos = strpos($str, $split);
if ($pos === false) { if ($pos === false) {
@ -1369,8 +1328,7 @@ function splitfirst($str, $split)
return $tmp; return $tmp;
} }
function splitlast($str, $split) function splitlast($str, $split) {
{
$len = strlen($split); $len = strlen($split);
$pos = strrpos($str, $split); $pos = strrpos($str, $split);
if ($pos === false) { if ($pos === false) {
@ -1387,8 +1345,7 @@ function splitlast($str, $split)
return $tmp; return $tmp;
} }
function children_name($children) function children_name($children) {
{
$tmp = []; $tmp = [];
foreach ($children as $file) { foreach ($children as $file) {
$tmp[strtolower($file['name'])] = $file; $tmp[strtolower($file['name'])] = $file;
@ -1396,8 +1353,7 @@ function children_name($children)
return $tmp; return $tmp;
} }
function EnvOpt($needUpdate = 0) function EnvOpt($needUpdate = 0) {
{
global $constStr; global $constStr;
global $EnvConfigs; global $EnvConfigs;
global $timezones; global $timezones;
@ -1597,7 +1553,7 @@ output:
return changeAuthKey(); return changeAuthKey();
} }
if ($_GET['setup'] === 'platform') { if ($_GET['setup'] === 'platform') {
$frame .= ' $frame = '
<table border=1 width=100%> <table border=1 width=100%>
<form name="common" action="" method="post"> <form name="common" action="" method="post">
<input name="_admin" type="hidden" value="">'; <input name="_admin" type="hidden" value="">';
@ -1661,7 +1617,7 @@ output:
$disktag = $_GET['disktag']; $disktag = $_GET['disktag'];
$disk_tmp = null; $disk_tmp = null;
$diskok = driveisfine($disktag, $disk_tmp); $diskok = driveisfine($disktag, $disk_tmp);
$frame .= ' $frame = '
<table width=100%> <table width=100%>
<tr> <tr>
<td> <td>
@ -1802,7 +1758,7 @@ output:
</script>'; </script>';
} else { } else {
if (count($disktags) > 1) { if (count($disktags) > 1) {
$frame .= ' $frame = '
<script src="https://www.unpkg.com/sortablejs@1.14.0/Sortable.min.js"></script> <script src="https://www.unpkg.com/sortablejs@1.14.0/Sortable.min.js"></script>
<style> <style>
.sortable-ghost { .sortable-ghost {
@ -2209,8 +2165,7 @@ output:
return message($html, getconstStr('Setup')); return message($html, getconstStr('Setup'));
} }
function render_list($path = '', $files = []) function render_list($path = '', $files = []) {
{
global $exts; global $exts;
global $constStr; global $constStr;
global $slash; global $slash;
@ -2302,15 +2257,15 @@ function render_list($path = '', $files = [])
} else { } else {
if (!($html = getcache('customTheme'))) { if (!($html = getcache('customTheme'))) {
$file_path = $theme; $file_path = $theme;
$tmp = curl('GET', $file_path, '', [], 1); $tmp = curl('GET', $file_path, '', [], 1, 1);
if ($tmp['stat']==302) { //error_log1($file_path . " =+= " . json_encode($tmp));
error_log1(json_encode($tmp)); if ($tmp['stat'] == 200) {
$tmp = curl('GET', $tmp["returnhead"]["Location"]); $html = $tmp['body'];
}
if (!!$tmp['body']) $html = $tmp['body'];
savecache('customTheme', $html, '', 9999); savecache('customTheme', $html, '', 9999);
} else {
$html = "<pre>" . json_encode($tmp, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "</pre>";
}
} }
} }
$tmp = splitfirst($html, '<!--IconValuesStart-->'); $tmp = splitfirst($html, '<!--IconValuesStart-->');
@ -2389,7 +2344,6 @@ function render_list($path = '', $files = [])
while (strpos($html, '<!--constStr@File-->')) $html = str_replace('<!--constStr@File-->', getconstStr('File'), $html); while (strpos($html, '<!--constStr@File-->')) $html = str_replace('<!--constStr@File-->', getconstStr('File'), $html);
while (strpos($html, '<!--constStr@Name-->')) $html = str_replace('<!--constStr@Name-->', getconstStr('Name'), $html); while (strpos($html, '<!--constStr@Name-->')) $html = str_replace('<!--constStr@Name-->', getconstStr('Name'), $html);
while (strpos($html, '<!--constStr@Content-->')) $html = str_replace('<!--constStr@Content-->', getconstStr('Content'), $html); while (strpos($html, '<!--constStr@Content-->')) $html = str_replace('<!--constStr@Content-->', getconstStr('Content'), $html);
} else { } else {
$tmp[1] = 'a'; $tmp[1] = 'a';
while ($tmp[1] != '') { while ($tmp[1] != '') {
@ -2811,7 +2765,6 @@ function render_list($path = '', $files = [])
$html .= $tmp[1]; $html .= $tmp[1];
while (strpos($html, '<!--MaxPageNum-->')) $html = str_replace('<!--MaxPageNum-->', $maxpage, $html); 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-->');
@ -2820,7 +2773,6 @@ function render_list($path = '', $files = [])
$html .= $tmp[1]; $html .= $tmp[1];
} }
} }
} }
$html = str_replace('<!--constStr@language-->', $constStr['language'], $html); $html = str_replace('<!--constStr@language-->', $constStr['language'], $html);