修改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电子商务
来源于香港公司注册管理专家
最近更新
常用插件
- ecshop注册推荐送现金插件
ecshop中的促销售功能还不是很完善,随着电子商务系统的发展和进步,...
- ecshop会员中心订单列表信
ecshop插件介绍: 1.前台我的订单:增加显示 收件人栏 和 发货快递单号栏...
- ecshop注册填写推荐人插件
ecshop注册填写推荐人插件,这个插件我们在注册的时候,就可以填写推...
- ecshop中nginx实现url的重写
上几章为了让ecshop很好的在nginx上运行。我们搭配了ecshop的nginx下的工作...
- ecshop导出会员邮件和手机
ecshop导出会员邮件和手机号插件,主要是用于ecshop系统中促销活动中。获...