• dushu.tw 读书网、小说免费阅读网站

漂亮的单文件PHP目录列表程序

网站 举个栗子 75次浏览 已收录 0个评论 扫描二维码
漂亮的单文件PHP目录列表程序

最近get到一个类似h5ai的单文件列目录程序,风格简洁,h5适配好,拿来做文件分享和下载站很不错,跟大家安利一下。

演示地址:http://d.nat.ee/

官网地址:https://files.photo.gallery/

程序下载地址:

https://cdn.jsdelivr.net/npm/files.photo.gallery/index.php

如何去掉授权提示信息?

编辑文件末尾,把

<code><span class="pln"><script src="</span><span class="pun"><?</span><span class="pln">php echo config</span><span class="pun">::</span><span class="pln">$assets </span><span class="pun">?></span><span class="pln">js</span><span class="pun">/</span><span class="pln">files</span><span class="pun">.</span><span class="pln">js</span><span class="str">"></span><span class="tag"></script></span></code>

修改为:

<code><span class="tag"><script</span> <span class="atn">src</span><span class="pun">=</span><span class="atv">"http://d.nat.ee/js/files.js"</span><span class="tag">></script></span></code>

如果不想引用第三方地址,自己下载下来引用本地文件就好了。

<code><span class="tag"><script</span> <span class="atn">src</span><span class="pun">=</span><span class="atv">"js/files.js"</span><span class="tag">></script></span></code>

配置根目录、密码访问和排除不需要显示的目录:

<code><span class="com">// 根目录配置</span>
<span class="str">'root'</span> <span class="pun">=></span> <span class="str">'根目录路径'</span><span class="pun">,</span> <span class="com">// root path relative to script.</span>
<span class="str">'start_path'</span> <span class="pun">=></span> <span class="kwd">false</span><span class="pun">,</span> <span class="com">// start path relative to script. If empty, root is start path</span></code>
<code><span class="com">// 登录账号密码配置</span>
<span class="str">'username'</span> <span class="pun">=></span> <span class="str">'zhujizixun'</span><span class="pun">,</span>
<span class="str">'password'</span> <span class="pun">=></span> <span class="str">'12345678'</span><span class="pun">,</span> <span class="com">// Add password directly or use https://tinyfilemanager.github.io/docs/pwd.html to encrypt the password (encrypted password is more secure, as it prevents your password from being exposed directly in a file).</span></code>
<code><span class="com">// 排除文件或者目录</span>
<span class="str">'files_exclude'</span> <span class="pun">=></span> <span class="str">'/.(html|xml)$/i'</span><span class="pun">,</span> <span class="com">// '/.(pdf|jpe?g)$/i'</span>
<span class="str">'dirs_exclude'</span> <span class="pun">=></span> <span class="str">'//js|/_files(/|$)/i'</span><span class="pun">,</span> <span class="com">//'//Convert|/football|/node_modules(/|$)/i',</span>
<span class="str">'allow_symlinks'</span> <span class="pun">=></span> <span class="kwd">true</span><span class="pun">,</span> <span class="com">// allow symlinks</span></code>

举个栗子 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:漂亮的单文件PHP目录列表程序
喜欢 (0)
举个栗子
关于作者:
建筑工地上施工员,闲暇时弄个博客打发时间,
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到