修改ecshop注册的时候发送红包
2009-09-27 11:45 来源:www.chinab4c.com 作者:ecshop专家
根据需求,要求在注册ecshop会员的时候,同时赠送红包.
1:将admin/templates/bonus_type.htm中。修改成
<td align="right">
{if $type.send_type neq 4}
{if $type.send_type eq 3}
<a href="bonus.php?act=gen_excel&tid={$type.type_id}">{$lang.report_form}</a> |
{/if}
{if $type.send_type neq 2}
<a href="bonus.php?act=send&id={$type.type_id}&send_by={$type.send_type}">
{$lang.send}</a> |
{/if}
{/if}
<a href="bonus.php?act=bonus_list&bonus_type={$type.type_id}">{$lang.view}</a> |
<a href="bonus.php?act=edit&type_id={$type.type_id}">{$lang.edit}</a> |
<a href="javascript:;" onclick="listTable.remove({$type.type_id},
'{$lang.drop_confirm}')">{$lang.remove}</a></span></td>
控制“注册用户类型,不能发放”
2:admin/templates/bonus_type_info.htm中,修改该函数
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;
}
编辑发放红包的时间
3:languages\zh_cn\admin\bonus.php,增加红包类型
$_LANG['send_by'][4] = '注册时候发放';
4:注册时候,发放红包,user.php中act=act_register
/*注册发送红包*/
$t = time();
$sql = "select type_id from ".$ecs->table('bonus_type')." where
send_type = 4 and send_start_date < $t and send_end_date >$t limit 1";//查询红包
$type_id = $db -> getOne($sql);
if($type_id){
$sql = "insert into ".$ecs->table('user_bonus')."values
('',$type_id,0,$_SESSION[user_id],0,0,1)";//发送红包给注册的用户
$db -> query($sql);
}
5:补充,bonus_type_info.htm中。红包类型选项,修改成以下,增加"注册红包发放的功能"
<tr>
<td class="label">{$lang.send_method}</td>
<td>
<input type="radio" name="send_type" value="0" {if $bonus_arr.send_type eq 0} checked="true" {/if} onClick="showunit(0)" />{$lang.send_by[0]}
<input type="radio" name="send_type" value="1" {if $bonus_arr.send_type eq 1} checked="true" {/if} onClick="showunit(1)" />{$lang.send_by[1]}
<input type="radio" name="send_type" value="2" {if $bonus_arr.send_type eq 2} checked="true" {/if} onClick="showunit(2)" />{$lang.send_by[2]}
<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)" />注册发放 </td>
</tr>
备注:
admin/bonus.php
admin/templates/bonus_type_info.htm
admin/templates/bonus_type.htm
user.php
languages\zh_cn\admin\bonus.php(将lanugages/bonus.php覆盖到语言包里面)
说明.给红包增加一个“注册用户”类型,send_type = 4
来源:中国B4C电子商务
来源于香港公司注册管理专家
最近更新
常用插件
- ecshop2.7.2新版本商品详细页
很早以前在ecshop2.7.1版本的时候,我们做过简单的ecshop商品页面运费查询...
- ecshop详细页面查询运费插
图片1 来源: 中国B4C电子商务上海汽车租赁www.shrentbus.cn...
- ecshop后台订单商品列表查
ecshop后台订单商品列表查询插件,可以通过名称。就把产品显示检索出...
- ecshop快递发货单打印商品
ecshop快递发货单打印商品信息,大家都知道ecshop快递单打印的时候,只能...
- ecshop二次开发售后维修卡
插件介绍: 本插件是用于专门从事电子,信息,软件等售后服务关键比...



