A5下载 - 努力做内容最丰富最安全的下载站!

A5站长下载站

当前位置:A5下载 > 源码技巧 > Ecshop > ecshop会员注册送红包完善版,可批量赠送不同类型红包,可编辑时间!

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

时间:2015-04-16 13:41作者:zhao人气:146

A5源码直接上代码,啥也不说了!

前面的步骤和网上分享的大致一样,:

1、languageszh_cnadminbonus.php

找到:

$_LANG['send_by'][SEND_BY_PRINT] = '线下发放的红包';

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

$_LANG['send_by'][SEND_BY_REGISTER] = '注册送红包';

2、ecshopincludesinc _con stant.php

找到:

define('SEND_BY_PRINT', 3); // 线下发放

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

define('SEND_BY_REGISTER',4); // 注册送红包

3、ecshopadmin/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、ecshopuser.php

找到

/* 判断是否需要自动发送注册邮件 */

在其上面添加一段代码:

/*

* 注册送红包,可以批量赠送。完善版!

* A5源码:down.admin5.com;

* QQ:1206888777

*/

$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)

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

上图:

 

标签ecshop,会员,注册,红包,完善,批量,赠送,同类型,编

相关下载

查看所有评论+

网友评论

网友
您的评论需要经过审核才能显示

公众号