php目录列表程序:files.photo.gallery

这是一款较为简洁和绚丽的php目录程序,支持图片EXIF信息的显示,例如照片拍摄设备类型,光圈值,GPS坐标,海拔高度等等,并且支持在线播放视频,音乐和内置显示某些程序设计语言文件代码。该程序更多适用于图片展示的个人使用,显示文件目录索引的功能该程序自然也能轻松胜任。该目录程序源码是开源的,全部功能完全免费使用不受限制,唯一需要注意的就是,使用者需要花费39USD用于去除弹出的授权窗口。除此之外PHP需要安装GD、mbstring、fileinfo和exif扩展。

下载及安装

该程序files.photo.gallery的安装文件仅仅只有一个index.php,下载index.php放到你需要的目录即可,可以把这个php文件进行重命名,如file.php。需要额外注意的是,PHP需要安装GD、mbstring、fileinfo和exif扩展,才能使该程序运行完整功能,通常情况下,php进行插件的扩展需要结合安装目录重新编译,各位读者可自行结合服务器运行环境自行搜索相关资料并解决,倘若日后有机会,我会补上相关代码及设置说明。

破解授权

屏蔽付费弹窗.js文件及修改版index.php下载地址详见Google Drive

1
2
3
4
5
6
1.破解方法:打开index.php,在最后面找到:<script src="<?php echo config::$assets ?>js/files.js"></script>
2.把它改成本地化:<script src="js/files.js"></script> 在线加载也可以:<script src="http://d.nat.ee/js/files.js"></script>
3.然后在index.php目录创建js目录,然后下载files.js文件到js目录里面。
4.files.js下载:https://cf.cdn.xiazai.de/meinv/js/files.js
#https://cdn.jsdelivr.net/gh/yyingc/js@v2.0/files.js
#https://cdn.jsdelivr.net/gh/KuiperSirius/files.photo.gallery@0.2.2/js/files.js

相关配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php 

//文件名:config.php
//详细设置说明可参考 https://tvv.tw/blog/archives/130.html 一文关于config.php的说明
// CONFIG / https://forum.photo.gallery/viewtopic.php?f=66&t=9964
// Uncomment the parameters you want to edit.
return array (
'root' => 'content', // root path relative to script.
'start_path' => 'content/Photo', // start path relative to script. If empty, root is start path
//'username' => '',
//'password' => '',
// 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).
//如果密码不用明文,要对密码进行加密,可使用PHP密码Hash哈希生成器:https://tinyfilemanager.github.io/docs/pwd.html
'load_images' => true,
'load_files_proxy_php' => true,
'load_images_max_filesize' => 100000000,
'load_svg_max_filesize' => 10000000,
'image_resize_enabled' => true,
'image_resize_cache' => true,
'image_resize_dimensions' => 320,
'image_resize_dimensions_retina' => 480,
'image_resize_quality' => 85,
'image_resize_function' => 'imagecopyresampled',
'image_resize_sharpen' => true,
'image_resize_memory_limit' => 128,
//'image_resize_max_pixels' => 30000000,
//'image_resize_min_ratio' => 1.5,
//'image_resize_cache_direct' => false,
'menu_enabled' => true,
'menu_show' => false,
'menu_max_depth' => 5,
'menu_sort' => 'name_asc',
'menu_cache_validate' => true,
'menu_load_all' => false,
//'menu_recursive_symlinks' => true,
'layout' => 'rows',
'image_cover' => true,
'sort' => 'name_asc',
'sort_dirs_first' => true,
//'cache' => true,
//'cache_key' => 0,
//'storage_path' => '_files',

// 排除文件或者目录
//'files_exclude' => '', // '/.(pdf|jpe?g)$/i',
//'dirs_exclude' => '', //'//Convert|/football|/node_modules(/|$)/i',
//'allow_symlinks' => true, // allow symlinks

//'history' => true,
'breadcrumbs' => true,
//'transitions' => true,
//'click' => 'popup',
//'code_max_load' => 100000,
//'code_allow_edit' => false,
//'popup_interval' => 5000,
//'topbar_sticky' => 'scroll',
//'check_updates' => true,
//'allow_tasks' => true,
//'get_mime_type' => false,
//'context_menu' => true,
//'prevent_right_click' => false,
//'license_key' => '',
);

扩展安装

fileinfo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/usr/local/php/bin/php -m  #查看php安装的模块

cd /root/lnmp1.7/src

tar -xvf php-7.2.34.tar.bz2

cd /root/lnmp1.7/src/php-7.2.34/ext/fileinfo

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config

make && make install

cd /usr/local/php/etc/ #切换php.ini所在目录
#安装成功后,php.ini文件底部添加
extension=fileinfo.so

#然后重启php-fpm
service php-fpm restart

exif

1
2
3
4
5
6
7
8
9
10
11
cd /root/lnmp1.7/src

tar -xvf php-7.2.34.tar.bz2

cd /root/lnmp1.7/src/php-7.2.34/ext/exif

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config

make && sudo make install