From 5b5df9d5ee88b2081ef25511cb734c9bca6423e2 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Fri, 13 Mar 2020 23:04:17 +0800 Subject: [PATCH] Add files via upload --- theme/onemoe.php | 1206 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1206 insertions(+) create mode 100644 theme/onemoe.php diff --git a/theme/onemoe.php b/theme/onemoe.php new file mode 100644 index 0000000..a76d5c0 --- /dev/null +++ b/theme/onemoe.php @@ -0,0 +1,1206 @@ + + + + + <?php echo $pretitle;?> - <?php echo $_SERVER['sitename'];?> + + + + + + + + + + +
+ + + +
  • + +   + +
    + +
    + +

    + +

    +1) { ?> +
    +
    +
    +
    +'.$diskname.' +'; + } ?> +
    +
    +
    +
    + +
    +
    +
    + + + + + +

    +
    +
    + +
    +
    + + +
    +
    +' . $files['error']['message'] . '
    '; + $statusCode=404; + } else { + if (isset($files['file'])) { +?> +
    +
    + +   +
    +
    +document.getElementById(\'url\').offsetWidth) this.style.width=\'100%\';" /> +'; + } elseif (in_array($ext, $exts['video'])) { + //echo ''; + $DPvideo=$files['@microsoft.graph.downloadUrl']; + echo '
    +'; + } elseif (in_array($ext, $exts['music'])) { + echo ' +'; + } elseif (in_array($ext, ['pdf'])) { + /*echo ' + +';*/ + $pdfurl = $files['@microsoft.graph.downloadUrl']; + echo '
    +'; + } elseif (in_array($ext, $exts['office'])) { + echo ' +'; + } elseif (in_array($ext, $exts['txt'])) { + $txtstr = htmlspecialchars(curl_request($files['@microsoft.graph.downloadUrl'])['body']); +?> +
    + +
    + +     + + + +'; ?> +
    + + +
    +'; + }*/ else { + echo ''.getconstStr('FileNotSupport').''; + } ?> +
    +
    + + + + + + + + + + + + + + +'; + foreach ($files['children'] as $file) { + // Files + if (isset($file['file'])) { + if ($_SERVER['admin'] or (substr($file['name'],0,1) !== '.' and $file['name'] !== getConfig('passfile') ) ) { + if (strtolower($file['name']) === 'head.md') $head = $file; + if (strtolower($file['name']) === 'readme.md') $readme = $file; + if (strtolower($file['name']) === 'index.html' && !$_SERVER['admin']) { + $html = curl_request(fetch_files(spurlencode(path_format($path . '/' .$file['name']),'/'))['@microsoft.graph.downloadUrl'])['body']; + return output($html,200); + } + $filenum++; ?> + + + + + + +
       
    + +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • + + + +
    + +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • + + + + + + + + + + + + + + + + + + + + + + + +
    +200) { + $pagenum = $files['folder']['page']; + $maxpage = ceil($files['folder']['childCount']/200); + $prepagenext = ' + + + + + + + + +
    '; + if ($pagenum!=1) { + $prepagenum = $pagenum-1; + $prepagenext .= ' + '.getconstStr('PrePage').''; + } + $prepagenext .= ' + '; + for ($page=1;$page<=$maxpage;$page++) { + if ($page == $pagenum) { + $prepagenext .= ' + ' . $page . ' '; + } else { + $prepagenext .= ' + ' . $page . ' '; + } + } + $prepagenext = substr($prepagenext,0,-1); + $prepagenext .= ' + '; + if ($pagenum!=$maxpage) { + $nextpagenum = $pagenum+1; + $prepagenext .= ' + '.getconstStr('NextPage').''; + } + $prepagenext .= ' +
    + '; + echo $prepagenext; + } + if ($_SERVER['admin']) { ?> +
    +
    + + +
    +
    + +
    + +
    +
    +
    +
    + + +
    +'; + } + if ($readme) { + echo ' +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +'; + } + } + } else { + echo ' +
    +
    +
    + + +
    +
    +
    '; + $statusCode = 401; + } + } ?> +
    +
    +
    + + + +
    + + + + + + +
    + + + +
    + + + + + + + + + +