服务热线
最近某用户使用phpwind7.3.2程序开启WAP访问后用手机访问 www.xxx.com/wap/提示 “提示该版块为认证版块:您没有权限查看该版块的文章”。用超级管理员登陆之后也是如此提示。
结合网上一篇WAP帖子权限控制的文章:
1.打开:wap/global.php
查找函数:
function forumcheck($fid,$type) {
global $db,$groupid,$gp_allowrp;
$fm = $db->get_one("SELECT password,allowvisit,allowread,f_type,f_check,allowpost,allowrp FROM pw_forums WHERE fid='$fid'");
if (!$fm || $fm['f_type']=='former' && $groupid=='guest' || $fm['password']!='' || $fm['f_type']=='hidden' || $fm['allowvisit'] && @strpos($fm['allowvisit'],",$groupid,")===false || $fm['f_check']>'0') {
wap_msg('forum_right');
}
}
替换为:
function forumcheck($fid,$type) {
global $db,$groupid,$gp_allowrp;
$fm = $db->get_one("SELECT password,allowvisit,allowread,f_type,f_check,allowpost,allowrp FROM pw_forums WHERE fid='$fid'");
if (!$fm || $fm['f_type']=='former' && $groupid=='guest' || $fm['password']!='' || $fm['f_type']=='hidden' || $type == 'list' &&$fm['allowvisit'] && @strpos($fm['allowvisit'],",$groupid,")===false || $type == 'read' && $fm['allowread'] && @strpos($fm['allowread'],",$groupid,")===false || $fm['f_check']>'0') {
wap_msg('forum_right');
}
}
2.打开:wap/read.php
查找:
forumcheck($fid);
修改为:forumcheck($fid,'read');
3.打开:wap/list.php
查找:
forumcheck($fid);
修改为:
forumcheck($fid,'list');
需要注意的是其中修改的第一条:
分析其中的这一段代码可知:
if (!$fm || $fm['f_type']=='former' ;; $groupid=='guest' || $fm['password']!='' || $fm['f_type']=='hidden' || $type == 'list' ;;$fm['allowvisit'] ;; @strpos($fm['allowvisit'],",$groupid,")===false || $type == 'read' ;; $fm['allowread'] ;; @strpos($fm['allowread'],",$groupid,")===false || $fm['f_check']>'0' || wap_creditcheck())
这段代码的作用是
1.是游客$fm['f_type']=='former' ;; $groupid=='guest'
2.设置了版块密码$fm['password']!=''
3.是隐藏版块$fm['f_type']=='hidden'
4.版块权限->允许浏览版块,对应用户组没勾上(默认不勾的话就没这个条件了)$type == 'list' ;;$fm['allowvisit'] ;; @strpos($fm['allowvisit'],",$groupid,")===false
5.版块权限->允许浏览帖子,对应用户组没勾上$type == 'read' ;; $fm['allowread'] ;; @strpos($fm['allowread'],",$groupid,")===false
6.帖子需要审核$fm['f_check']>'0'
7.积分达不到要求wap_creditcheck())
也就是说上面七个条件如满足一个,就进不了版块,就会提示“该版块为认证版块:您没有权限查看该版块的文章”。
知道了这个问题之后,就好判断多了,把这7个条件依次删除,每次删除一个,然后测试时候正常,直到WAP能正常访问为止。 我们这个用户问题是条件6 贴子需要审核,也就是后台开启了帖子审核导致的恶,删除 $fm['f_check']>'0'这个代码或后台关闭帖子审核后就正常了。