本帖最后由 muye0128 于 2012-11-21 17:39 编辑
我也碰到这个问题,查找半天才发现问题的所在。
dzx2.5资料完善任务 默认是11项必填,被写死在 \source\class\task\task_profile.php 的 checkfield()
$fields = array('realname', 'gender', 'birthyear', 'birthmonth', 'birthday', 'bloodtype', 'affectivestatus',
'birthprovince','birthcity', 'resideprovince', 'residecity');
如果这11项里面有某项没有启用。就会出现只提示 几个逗号“,,,,”没有完成,不显示标题
解决方法是,将 checkfield() 做如下修改- function checkfield() {
- global $_G;
- /* 原始
- $fields = array('realname', 'gender', 'birthyear', 'birthmonth', 'birthday', 'bloodtype', 'affectivestatus',
- 'birthprovince','birthcity', 'resideprovince', 'residecity');
- */
- loadcache('profilesetting');
- /* 必须完善的用户资料为已经启用的用户栏目,或者 修改$fields 数组,设置几个必填的用户字段。 只是要注意,$fields 数组里面的字段都要启用才不会出错*/
- $fields = array_keys ($_G['cache']['profilesetting']);
- $fieldsnew = array();
- foreach($fields as $v) {
- if(isset($_G['cache']['profilesetting'][$v])) {
- $fieldsnew[$v] = $_G['cache']['profilesetting'][$v]['title'];
- }
- }
- if($fieldsnew) {
- space_merge($_G['member'], 'profile');
- $none = array();
- foreach($_G['member'] as $k => $v) {
- if(in_array($k, $fields, true) && !trim($v)) {
- $none[] = $fieldsnew[$k];
- }
- }
- $all = count($fields);
- $csc = intval(($all - count($none)) / $all * 100);
- return array($none, $csc);
- } else {
- return true;
- }
- }
复制代码 |