您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程

ecshop导出会员,ecshop会员批量导出邮箱教程

春竹2024-01-19 23:40:56ecshop商城教程已有人查阅

导读ECSHOP批量导出会员邮箱_ECSHOP会员批量导出邮箱修改教程 一、编辑/admin/users.php,添加代码/*----------------

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'] = '导出邮箱';

本文标签:

很赞哦! ()

相关文章

留言与评论 (共有 条评论)
验证码:

本栏推荐

相关标签