
如果需要看演示,请到PT小说小偷论坛查看。
这是我自已乱改的,修改前请作好备份!修改后以前发的附件是不会显示新添加的格式图标的,除非重发帖。
以添加“pdf”格式图标为例:
- 根目录thread.php
- 找到: $attachtype = array('1'=>'img','2'=>'txt','3'=>'zip','4'=>'pdf');
- 改成: $attachtype = array('1'=>'img','2'=>'txt','3'=>'zip','4'=>'pdf');
- libgetinfo.class.php
- 找到: $attachtype = array('img','txt','zip');
- 改成: $attachtype = array('img','txt','zip','pdf');
- requireupdateforum.php
- 找到: switch($type) { case 'img': $r=1;break; case 'txt': $r=2;break; case 'zip': $r=3;break;
- 后面添加: case 'pdf': return 4;
- requirepostupload.php
- 找到: $ifupload = ($rt['type'] == 'img' ? 1 : ($rt['type'] == 'txt' ? 2 : 4));
- 改成: if($rt['type'] == 'img'){$ifupload = 1;} else if($rt['type'] == 'txt'){$ifupload = 2;} else if($rt['type'] == 'pdf'){$ifupload = 4;} else{$ifupload = 3;}
- requirepostfunc.php
- 找到: $ifupload = 3; $type = 'zip';
- 修改成: if ($attach_ext == 'pdf') { $ifupload = 4; $type = 'pdf'; } else { $ifupload = 3; $type = 'zip'; }
根目录thread.php
找到: $attachtype = array('1'=>'img','2'=>'txt','3'=>'zip','4'=>'pdf');
改成: $attachtype = array('1'=>'img','2'=>'txt','3'=>'zip','4'=>'pdf');
libgetinfo.class.php
找到: $attachtype = array('img','txt','zip');
改成: $attachtype = array('img','txt','zip','pdf');
requireupdateforum.php
找到: switch($type) { case 'img': $r=1;break; case 'txt': $r=2;break; case 'zip': $r=3;break;
后面添加: case 'pdf': return 4;
requirepostupload.php
找到: $ifupload = ($rt['type'] == 'img' ? 1 : ($rt['type'] == 'txt' ? 2 : 4));
改成: if($rt['type'] == 'img'){$ifupload = 1;} else if($rt['type'] == 'txt'){$ifupload = 2;} else if($rt['type'] == 'pdf'){$ifupload = 4;} else{$ifupload = 3;}
requirepostfunc.php
找到: $ifupload = 3; $type = 'zip';
修改成: if ($attach_ext == 'pdf') { $ifupload = 4; $type = 'pdf'; } else { $ifupload = 3; $type = 'zip'; }
别忘了把图标放在images/wind/file文件夹!就是风格模板图片的file文件夹 以后要继续添加其它文件格式,只要修改以上这几处即可