destoon6.0积分兑换资金插件
此插件在destoon6.0版本測試沒問題,其他版本未測試。
效果如圖:
1、打開module\member\admin\template\setting.tpl.php文件
搜索:<div class="tt"><?php echo $DT['credit_name'];?>兌換</div>
<table cellpadding="2" cellspacing="1" class="tb">
在下面增加以下代碼:
[php]
<tr>
<td class="tl">會員<?php echo $DT['credit_name'];?>兌換<?php echo $DT['money_name'];?></td>
<td>
<input type="radio" name="setting[credit_dh]" value="0" <?php if(!$credit_dh) echo 'checked';?> onclick="Dh('jfdh');"/> 關閉
<input type="radio" name="setting[credit_dh]" value="1" <?php if($credit_dh) echo 'checked';?> onclick="Ds('jfdh');"/> 開啟
</td>
</tr>
<tbody id="jfdh" style="display:<?php echo $credit_dh ? '' : 'none';?>">
<tr>
<td class="tl">最少兌換<?php echo $DT['credit_name'];?></td>
<td><input name="setting[zsjf]" type="text" size="15" value="<?php echo $zsjf;?>"/></td>
</tr>
<tr>
<td class="tl">兌換比率</td>
<td><input name="setting[dhbl]" type="text" size="15" value="<?php echo $dhbl;?>"/><?php tips('例如填1表示1個'.$DT['credit_name'].'可兌換1個'.$DT['money_name']);?></td>
</tr>
</tbody>[/php]
2、打開module\member\record.inc.php文件
搜索:case 'pay':
在上面增加以下代碼:
[php]
case 'exchange':
if($MOD['credit_dh']) {
if($submit) {
$_credit >= $MOD['zsjf'] or message($L['credit_pass_ex_min']);
$amount = intval($amount);
if($amount >= $MOD['zsjf'] && $amount <= $_credit) {
credit_add($_username, -$amount);
credit_record($_username, -$amount, 'system', $L['credit_exchange_title'], $amount.$L['credit_exchange_title'].$amount*$MOD['dhbl'].$DT['money_name']);
money_add($_username, $amount*$MOD['dhbl']);
money_record($_username, $amount*$MOD['dhbl'],$L['in_site'], 'system', $L['credit_exchange_title'], $amount.$L['credit_exchange_title'].$amount*$MOD['dhbl'].$DT['money_name']);
dmsg($L['credit_msg_exchange'], '?');
} else {
message($L['credit_pass_ex_max'].$_credit);
}
}
} else {
message($L['feature_close'], '?');
}
$head_title = $L['credit_exchange_title'];
break;
[/php]
3、2、打開template\default\member\record.htm文件
搜索:<td class="tab" id="action_pay"><a href="record.php?action=pay"><span>信息付費</span></a></td>
在下面增加以下代碼:
[php]
{if $MOD[credit_exchange]}
<td class="tab_nav"> </td>
<td class="tab" id="action_exchange"><a href="record.php?action=exchange"><span>{$DT[credit_name]}兌換</span></a></td>
{/if}[/php]
搜索:{if $action == 'pay'}
替換為以下代碼:
[php]
{if $action == 'exchange'}
<form method="post" action="record.php" onsubmit="return check();" id="dform">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="submit" value="1"/>
<table cellspacing="1" cellpadding="6" class="tb">
<tr>
<td class="tl">可用{$DT[credit_name]}</td>
<td class="tr"><strong class="f_blue">{$_credit}</strong> {$DT[credit_name]}</td>
</tr>
<tr>
<td class="tl">兌換比率</td>
<td class="tr"><span class="f_blue">1</span> {$DT[credit_name]} 兌換 <span class="f_red">{$MOD[dhbl]}</span> {$DT[money_name]}</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 兌換額度</td>
<td class="tr"><input type="text" size="8`" name="amount"/> (兌換額度最少<span class="f_red">{$MOD[zsjf]}</span> {$DT[credit_name]}) <span id="damount" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"> </td>
<td class="tr" height="50"><input type="submit" value=" 確 定 " class="btn"/></td>
</tr>
</table>
</form>
<script type="text/javascript">
function check() {
m = parseInt(Dd('amount').value);
n = {$_credit};
if(m >= {$MOD[zsjf]} && m <= n) {
return confirm('確定要兌換'+m+'{$DT[credit_name]}嗎? 可換取'+(m*{$MOD[dhbl]})+'{$DT[money_name]}');
} else {
Dd('amount').value = '';
Dmsg('請填寫兌換額度', 'amount');
return false;
}
}
</script>
<script type="text/javascript">s('record');m('action_exchange');</script>
{elseif $action == 'pay'}[/php]
4、登錄后臺-會員管理-模塊設置-積分規則-積分兌換
會員積分兌換資金:開啟
填寫最少兌換積分和兌換比例,確定保存就可以了到前臺測試效果了
總結
以上是生活随笔為你收集整理的destoon6.0积分兑换资金插件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: destoon系统商城加淘宝客按钮方法
- 下一篇: 想要提高网页转换率?试试这16 个UI