ECSHOP导出会员_ECSHOP会员批量导出邮箱教程
ECSHOP批量导出会员邮箱_ECSHOP会员批量导出邮箱修改教程
一、编辑/admin/users.php,添加代码
/*------------------------------------------------------ */
//-- 导出邮箱
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'export')
{
$sql = "SELECT email FROM " . $ecs->table('users');
$emails = $db->getAll($sql);
$out = '';
foreach ($emails as $key => $val)
{
if (empty($val[email]))
{
continue;
}
else
{
$out .= "$val[email]\n"; //一行一个
/* 一行50个且分号隔开,方便复制群发。
if (($key+1) % 50 == 0)
{
$out .= "$val[email]\n";
}
else
{
$out .= "$val[email];";
}
*/
}
}
$contentType = 'text/plain';
$len = strlen($out);
header('Last-Modified: ' . gmdate('D, d M Y H:i:s',time()+31536000) .' GMT');
header('Pragma: no-cache');
header('Content-Encoding: none');
header('Content-type: ' . $contentType);
header('Content-Length: ' . $len);
header('Content-Disposition: attachment; filename="users_email.txt"');
echo $out;
exit;
}
二、编辑/admin/templates/users_list.htm,添加导出按钮
<div class="form-div">
<form action="javascript:searchUser()" name="searchForm">
<img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
{$lang.label_rank_name} <select name="user_rank"><option value="0">{$lang.all_option}</option>{html_options options=$user_ranks }</select>
{$lang.label_pay_points_gt} <input type="text" name="pay_points_gt" size="8" /> {$lang.label_pay_points_lt} <input type="text" name="pay_points_lt" size="10" />
{$lang.label_user_name} <input type="text" name="keyword" /> <input type="submit" value="{$lang.button_search}" class="button" />
<input type="button" name="export" value="{$lang.export}" onclick="location.href='users.php?act=export';" class="button" />
</form>
</div>
三、编辑/languages/zh_cn/admin/users.php,添加语言项
$_LANG['export'] = '导出邮箱';
文章转载:http://www.gehut.cn/