files.gallery是一款简洁漂亮的目录程序,直接上传index.php即可使用。支持音乐、图片、视频、文本代码等等在线预览。适合图片展示,目录索引等需求。
官网 DEMO
files.gallery

files.photo.gallery任意版本破解

复制下方代码在它加载的外部js文件之前找个地方直接粘贴就行了
语言包会自动修改成最新版本的,无需担心

!function(){const t=window.XMLHttpRequest;window.XMLHttpRequest=function(){const e=new t;return e.open=function(n,o,s,p,l){"GET"===n&&o.startsWith("<?php echo config::$assets ?>files.photo.gallery@")&&o.endsWith("/lang/zh.json")&&(arguments[1]=arguments[1].replace(/@[0-9\.]+\/lang/,"@latest/lang")),"POST"===n&&o.includes("auth.photo.gallery")&&(e.send=function(e){t.prototype.send.apply(this,["app=2&host=demo.files.gallery"])}),t.prototype.open.apply(this,arguments)},e}}();

修改

jsdelivr加载慢的可以找个镜像,把config里的assets值改了就行了
格式:https://cdn.jsdelivr.net/npm/

安装及应用

PHP扩展安装:GD、mbstring、fileinfo、exif
(宝塔默认已安装GD、mbstring扩展)

部分配置
约18行:根目录配置'root' => '',//留空默认

// 根目录配置
    'root' => '', // root path relative to script. 
    'start_path' => false, // start path relative to script. If empty, root is start path

约21行:授权登录

// 授权登录
    'username' => '',
    'password' => '', // 填写参数开启,留空关闭

约62行:排除文件或者目录

// 排除文件或者目录
    'files_exclude' => '', // '/\.(png|jpe?g)$/i'   /释:排除后缀png.jpeg.jpg
    'dirs_exclude' => '', //'/\/MI8|\/doc|\/222(\/|$)/i'    /释:排除目录MI8.doc.222
    'allow_symlinks' => true, // allow symlinks
Last modification:May 12, 2024
如果觉得我的文章对你有用,请随意赞赏