今天想导出下用户的邮箱,但是怎么搞都搞不出。DISCUZ后台的筛选功能的确很强大,但是唯独导出不了email。可能是国内一直不重视邮件吧。自己研究了下,分享给大家:
1. 打开source\class\table\table_common_member.php,在fetch_all_username_by_uid后加上这个function,用于查询email
public function fetch_all_useremail_by_uid($uids) { $users = array(); if(($uids = dintval($uids, true))) { foreach($this->fetch_all($uids) as $uid => $value) { $users[$uid] = $value['email']; } } return $users; }
2. 找到source\admincp\admincp_members.php ,查询 elseif($operation == ‘export’) {,做以下修改:
代码贴在这里:
$alluseremail = C::t('common_member')->fetch_all_useremail_by_uid($uids); $profile = array_merge(array('uid'=>$uid, 'email'=>$alluseremail[$uid], 'username'=>$allusername[$uid]),$profile); $detail = "UID,"."Email,".$lang['username'].",".$subject."\n".$detail;