Discuz exports the user's email information

I want to export the user's email address today, but I can't do it. The filtering function in the DISCUZ background is indeed very powerful, but it cannot export emails. Maybe China has not paid attention to email. I researched it myself and shared it with you:

1. Open source\class\table\table_common_member.php and add this function after the fetch_all_username_by_uid to query 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. Find source\admincp\admincp_members.php and query elseif($operation == 'export') { and make the following changes:

discuz导出用户邮箱email信息 - WX20170330 172229@2x - Jake blog

The code is pasted here:

$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;

 

This site Original article All followed" Attribution—NonCommercial—ShareAlike 4.0 (CC BY-NC-SA 4.0) ”。 Please keep the following marks for sharing and interpretation:

Original author: Jake Tao Source: "Discuz exports user email information"

Praise 162
0 0 162

Further reading

Post a reply

Log in can only be commented on later
Share this page
Back to top