ECSHOP导出会员_ECSHOP会员批量导出邮箱教程

ECSHOP教程 来源: ECSHOP教程网www.ecshop119.com 时间:2020-05-23 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" />
    &nbsp;{$lang.label_rank_name} <select name="user_rank"><option value="0">{$lang.all_option}</option>{html_options options=$user_ranks }</select>
    &nbsp;{$lang.label_pay_points_gt}&nbsp;<input type="text" name="pay_points_gt" size="8" />&nbsp;{$lang.label_pay_points_lt}&nbsp;<input type="text" name="pay_points_lt" size="10" />
    &nbsp;{$lang.label_user_name} &nbsp;<input type="text" name="keyword" /> <input type="submit" value="{$lang.button_search}" class="button" />
    &nbsp;<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'] = '导出邮箱';


转载请注明:ECSHOP模板屋-ECshop教程网http://www.ecshop119.com/ecshopjc-1037.html

ECSHOP
ecshop下载 ecshop安装教程 ecshop在线演示 ecshop后台测试
ECSHOP二次开发手册
ecshop教程 ecshop二次开发 ecshop模板教程 ecshop微信配置
ECSHOP商城网站建设
ecshop空间域名 ecshop商城建设 ecshop模板修改 ecshop开发定制
ECSHOP模板屋
ecshop开发团队 ecshop开发中心 ecshop模板制作 模板屋简介
服务支持:7X24小时 151 059 55077
ECShop二次开发
ecshop搭建
qqtelcodeback_top
温馨提示

确定取消
温馨提示

关闭