分类分类
更新时间:2026-10-06 15:43:32作者:zhao
pw论坛只有三种格式图标,在后面找了很久没找到,今天自已修改部分代码,修改方法如下:
为下文方便说明,现在规定下面2个单词定义
type指:附件类别名称,比如大家可以将后缀为bmp、png、jpg等的一类附件定义为img这样一个类别
ifupload指:一个type对应的一个唯一编号,比如下面例子中的img--->1,txt--->2
下面以添加music,pdf,torrent这三个类别文件图标为例
1、 修改根目录thread.php
找 到:
$attachtype = array('1'=>'img','2'=>'txt','3'=>'zip');
添 加相应格式图标进去:
添加格式:,'ifupload'=>'type'
如:
$attachtype = array('1'=>'img','2'=>'txt','3'=>'zip','5'=>'music','6'=>'pdf','4'=>'torrent');
2、 修改lib文件夹下的getinfo.class.php
找 到:
$attachtype = array('img','txt','zip');
添 加相应格式图标进去:
添 加格式:,'type'
如:
$attachtype = array('img','txt','zip','pdf','music','torrent');
3、 修改lib文件夹下的upload.class.php
找 到:
elseif ($upload['ext'] == 'txt') {
if (preg_match('/(onload|submit|post|form)/i', readover($source))) {
P_unlink($source);
uploadmsg('upload_content_error');
}
$upload['type'] = 'txt';
}
添 加相应的图标进去:
添 加格式:elseif ($upload['ext'] == '附件后缀')(多个后缀有的不同,详细看下面例子) {
$upload['type'] = 'type';
}
如:
elseif ($upload['ext'] == 'txt') {
if (preg_match('/(onload|submit|post|form)/i', readover($source))) {
P_unlink($source);
uploadmsg('upload_content_error');
}
$upload['type'] = 'txt';
}elseif ($upload['ext'] == 'pdf') {
$upload['type'] = 'pdf';
}elseif (in_array($upload['ext'], array('mp3','mp4','avi','rmvb'))) {
$upload['type'] = 'music';
}elseif (in_array($upload['ext'], array('torrent','bittorrent'))) {
$upload['type'] = 'torrent';
}
相关
摄像头远程监控看家2026官方最新版本生活服务36.4 MBv1.0.02026-10-06
下载公务员省考最新手机版学习办公57.5 MBv6.09.112026-10-06
下载野性蜂巢(Wild Hive)经营养成267.49 Mv1.66.42026-10-04
下载趣好卖app网上购物74.76 Mv5.2.52026-10-04
下载兔叽月记app医疗健康55.33 Mv1.5.22026-10-04
下载魔力弹神策略游戏33.56 Mv1.0.02026-10-04
下载大破坏幸存者策略游戏62.28 Mv1.0.32026-10-04
下载啃豆小仓拼豆app实用工具41.74 Mv1.32026-10-04
下载方块公国安卓移植版策略游戏1.58Gv1.2.202026-10-04
下载快车顺风车出行2026官方最新版本生活服务82.0 MBv1.1.22026-10-04
下载网约上门按摩2026官方最新版本生活服务73.9 MBv2.0.22026-10-04
下载道运考试通(道路考练工具)学习办公32.8 MBv6.0.12026-10-04
下载










