php 标题图标 怎么写,phpwind教程:为列表页标题后面添加新的附件图标

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';

}

相关文章

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值