首页 > 代码库 > destoon 屏蔽会员组,让个人,游客不显示
destoon 屏蔽会员组,让个人,游客不显示
include/post.fun.php 文件的group_select函数增加 排除参数 except
function group_select($name = ‘groupid‘, $title = ‘‘, $groupid = ‘‘, $extend = ‘‘,$except = ‘‘) {
global $GROUP;
if(!$GROUP) $GROUP = cache_read(‘group.php‘);
$select = ‘<select name="‘.$name.‘" ‘.$extend.‘><option value="http://www.mamicode.com/0">‘.$title.‘</option>‘;
$except = $except ? explode(‘,‘, $except) : array();
foreach($GROUP as $k=>$v) {
if(in_array($k, $except)) continue;
$select .= ‘<option value="http://www.mamicode.com/‘.$k.‘"‘.($k == $groupid ? ‘ selected‘ : ‘‘).‘>‘.$v[‘groupname‘].‘</option>‘;
}
$select .= ‘</select>‘;
return $select;
}
在现实会员组下拉框的地方 group_select(。。。。。,‘1,3,5‘)
例如 :echo group_select(‘groupid‘, ‘会员组‘, 0, ‘id="mgroupid"‘,‘1,3,5‘);
destoon 屏蔽会员组,让个人,游客不显示