Giter Site home page Giter Site logo

bajins / directorylister Goto Github PK

View Code? Open in Web Editor NEW
39.0 2.0 16.0 4.46 MB

魔改DirectoryLister支持Markdown,各种优化修改

License: MIT License

PHP 99.38% Hack 0.62%
directory directory-lister php7 php directorylister directory-browser file-sharing file-manager wangpan yunpan

directorylister's Introduction

优化的DirectoryLister

GitHub

自定义修改

新旧式样手机效果对比

安装

下载后,解压并上传到已经搭建好 PHP环境 的服务器中,然后就可以上传文件和创建文件夹了!

文件结构

  • 假设你的虚拟主机是 /home/wwwroot/xxx.xx
├─ resources/
│   ├ themes/
│   │ └ bootstrap/
│   │    ├ css/                 # 样式文件夹
│   │    │  └ style.css         # 自定义样式文件
│   │    ├ fonts/               # 字体文件夹
│   │    ├ img/                 # 图片文件夹
│   │    ├ js/                  # JavaScript脚本文件夹
│   │    │  └ prism.js          # 自定义js脚本文件
│   │    ├ default_bulletin.php # 顶部公告栏文件
│   │    ├ default_footer.php   # 底部公共文件
│   │    ├ default_header.php   # 顶部公共文件(可以放网站流量统计代码)
│   │    └ index.php            # 网页主文件,其中可以修改顶部公告栏内容
│   │
│   ├ DirectoryLister.php       # 核心函数处理文件
│   ├ Parsedown.php             # Markdown解析依赖
│   ├ config.php                # 配置文件
│   └ fileTypes.php             # 文件类型定义图标文件
│
├ README.md                     # 该文件夹页面内的 说明简介文件
├ index.php                     # 入口文件
│
└ ......

注意事项:

不显示文件和目录

如果安装lnmp一键包上传DirectoryLister后,不显示文件和目录,那么可能是PHP函数scandir被禁用了,取消禁用即可。

sed -i 's/,scandir//g' /usr/local/php/etc/php.ini
# 取消scandir函数禁用
/etc/init.d/php-fpm restart
# 重启 PHP生效

程序放在网站子目录不显示README.md的解决方法

因为程序有个判断 README.md 路径的代码,而如果是正常使用域名或IP(即使加上),都是可以自适应的。

但是如果把程序放在子目录下,就会无法获取正确 README.md 路径,需要你手动修改下程序里的一句代码。

假设你将程序放在了子目录 zimulu 中(也就是 http://xxx.xx/zimulu 才能访问到程序网页)。

首先打开该文件: /resources/themes/bootstrap/index.php

找到第5行的: $suffix_array = explode('.', $_SERVER['HTTP_HOST']);

将其修改为: $suffix_array = explode('.', $_SERVER['HTTP_HOST']."/zimulu");

简介功能说明

可以在每个文件夹下面放一个 README.md 文件,这个文件里写着简介说明内容即可,格式参考自带的示例文件。

为了避免中文乱码,把 README.md 文件用UTF-8无BOM编码保存!

文件修改说明

修改网站中头部导航标题,去/resources/config.php这个文件里替换web_title的值为自己要改的。

修改网站顶部公告栏内容,去/resources/themes/bootstrap/default_bulletin.php这个文件里编辑。

网站头部公共文件:/resources/themes/bootstrap/default_header.php

网站底部公共文件:/resources/themes/bootstrap/default_footer.php

如果想要插入流量统计代码,那只需要把代码写到 default_header.php 文件内即可。


本程序基于逗比魔改并基于Directory Lister原版魔改

directorylister's People

Contributors

bajins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.