欢迎光临
我们一直在努力

ecshop会员注册送红包完善版,可批量赠送不同类型红包,可编辑时间!

直接上代码,啥也不说了!
前面的步骤和网上分享的大致一样,:
1、\languages\zh_cn\admin\bonus.php
找到:

[php]
$_LANG[‘send_by’][SEND_BY_PRINT] = ‘线下发放的红包’;
[/php]

在其下面添加一段添加代码:

[php]
$_LANG[‘send_by’][SEND_BY_REGISTER] = ‘注册送红包’;
[/php]

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
找到:

[html]
<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]}
[/html]

在其下面添加一段添加代码:

[html]
<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]}
[/html]

[html][/html]

找到:

[js]
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;
}
[/js]

修改为:

[js]
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;
}
[/js]

这里是为了修改时间可以编辑!

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

[php]
/*
* 注册送红包,可以批量赠送。完善版!
* z1988:www.z1988.com;
* QQ:773389925
*/
$reg_bonus_message= ”;
$sql = ‘SELECT type_id FROM ‘ . $ecs->table("bonus_type").’ WHERE send_type=4 and send_start_date <=’.time() .’ and send_end_date >=’. ( time()- 86400);
$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>)’;
}

[/php]

5、user.php找到

[php]
show_message(sprintf($_LANG[‘register_success’], $username . $ucdata)
[/php]

改为:

[php]
show_message(sprintf($_LANG[‘register_success’].$reg_bonus_message, $username . $ucdata)
[/php]

这样子注册后就会有提示了!

赞(0) 打赏
未经允许不得转载:程序开发爱好者 » ecshop会员注册送红包完善版,可批量赠送不同类型红包,可编辑时间!
分享到: 更多 (0)

网站设计及开发、微应用及微网站开发、微信公众平台开发、 HTML5手机网站开发、网络整合营销、APP开发、软件开发及企业电商服务

联系我们