广州传奇网络

地址:广州市天河区东圃大马路富华楼C座

电话:13808825895

邮箱:gz020wbs@163.com

QQ:1564443073

网址:http://www.020wbs.com/

首页 > 二次开发Ecshop二次开发 > ecshop会员注册送红包,可批量赠送不同类型红包

二次开发Ecshop二次开发

二次开发Ecshop二次开发

ecshop会员注册送红包,可批量赠送不同类型红包

 前面的步骤和网上分享的大致一样,:
1、\languages\zh_cn\admin\bonus.php
找到:
$_LANG['send_by'][SEND_BY_PRINT] = '线下发放的红包';
在其下面添加一段添加代码:
$_LANG['send_by'][SEND_BY_REGISTER] = '注册送红包';

2、\ecshop\includes\inc _con stant.php
找到:
define('SEND_BY_PRINT', 3); // 线下发放
在其下面添加一段添加代码:
define('SEND_BY_REGISTER', 4); // 注册送红包

3、\ecshop\admin/templates/bonus_type_info.htm
找到:
<input type="radio" name="send_type" value="3" {if $bonus_arr.send_type eq 3} checked="true" {/if} onClick="showunit(3)" />{$lang.send_by[3]}
在其下面添加一段添加代码:
<input type="radio" name="send_type" value="4" {if $bonus_arr.send_type eq 4} checked="true" {/if} onClick="showunit(4)" />{$lang.send_by[4]}
找到:

function showunit(get_value)
{
gObj("1").style.display = (get_value == 2) ? "" : "none";
document.forms['theForm'].elements['selbtn1'].disabled = (get_value != 1 && get_value != 2 );
document.forms['theForm'].elements['selbtn2'].disabled = (get_value != 1 && get_value != 2 );
return;
}
修改为:

function showunit(get_value)
{
gObj("1").style.display = (get_value == 2) ? "" : "none";
document.forms['theForm'].elements['selbtn1'].disabled = (get_value != 1 && get_value != 2 && get_value != 4);
document.forms['theForm'].elements['selbtn2'].disabled = (get_value != 1 && get_value != 2 && get_value != 4);
return;
}
这里是为了修改时间可以编辑!


4、\ecshop\user.php
找到
/* 判断是否需要自动发送注册邮件 */
在其上面添加一段代码:

 

$sql = 'SELECT type_id FROM ' . $ecs->table("bonus_type").' WHERE send_type=4 ';
$reg_bonus = $db->getAll($sql);
if($reg_bonus){
foreach ($reg_bonus AS $val)
{
$sql = "INSERT INTO ".$ecs->table('user_bonus')."( bonus_type_id, bonus_sn, user_id, used_time, order_id, emailed)"."VALUES('$val[type_id]', 0, '".$_SESSION['user_id']."', 0, 0, 0)";
$db->query($sql);
}
$reg_bonus_message=' 您注册已赠送红包(<a href="user.php?act=bonus">点击查看</a>)';
}

5、user.php找到
show_message(sprintf($_LANG['register_success'], $username . $ucdata)
改为:
show_message(sprintf($_LANG['register_success'].$reg_bonus_message, $username . $ucdata)
这样子注册后就会有提示了!