|
要做到所有人都可以查看附件,但下载要根据论坛设定的权限决定,只需要修改两处:
1.修改viewthread.php文件,取消对查看权限的限制。
查找以下代码:
if($post[\'attachment\']) {
if($allowgetattach && !$threadpay) {
$attachpids .= \\\",$post[pid]\\\";
$post[\'attachment\'] = 0;
if(preg_match_all(\\\"/\\[attach\\](\\d+)\\[\\/attach\\]/i\\\", $post[\'message\'], $matchaids)) {
$attachtags[$post[\'pid\']] = $matchaids[1];
}
} else {
$post[\'message\'] = preg_replace(\\\"/\\[attach\\](\\d+)\\[\\/attach\\]/i\\\", \'\', $post[\'message\']);
}
}
修改成:
if($post[\'attachment\']) {
if(!$threadpay) {
$attachpids .= \\\",$post[pid]\\\";
$post[\'attachment\'] = 0;
if(preg_match_all(\\\"/\\[attach\\](\\d+)\\[\\/attach\\]/i\\\", $post[\'message\'], $matchaids)) {
$attachtags[$post[\'pid\']] = $matchaids[1];
}
}
}
2.修改模板文件 viewthread_node.htm
查找以下代码:
|
|