1、打开module\member\credit.inc.php
搜索:
default:
在上面增加:
//S 每日签到
case ‘qiandao’:
if($MOD[‘credit_qd’]) {
if($submit) {
$t = $db->get_one(“SELECT addtime FROM {$DT_PRE}qiandao WHERE username=’$_username’ ORDER BY addtime DESC”);
if($t && timetodate($DT_TIME, 3) == timetodate($t[‘addtime’], 3)){
dalert(‘您今天已经签到过了,请明天再来吧!’,$MOD[‘linkurl’].’credit.php?action=qiandao’);
} else {
$db->query(“INSERT INTO {$DT_PRE}qiandao (title,jiangli,username,ip,addtime) VALUES (‘$title’,'”.$MOD[‘credit_qdjl’].”‘,’$_username’,’$DT_IP’,’$DT_TIME’)”);
credit_add($_username, $MOD[‘credit_qdjl’]);
credit_record($_username, $MOD[‘credit_qdjl’], ‘system’, ‘签到奖励’, $DT_IP);
dmsg(‘签到成功’, $MOD[‘linkurl’].’credit.php?action=qiandao’);
}
}
} else {
message($L[‘feature_close’], ‘?’);
}
$condition = “username=’$_username'”;
$r = $db->get_one(“SELECT COUNT(*) AS num FROM {$DT_PRE}qiandao WHERE $condition”);
$pages = pages($r[‘num’], $page, $pagesize);
$qiandaos = array();
$result = $db->query(“SELECT * FROM {$DT_PRE}qiandao WHERE $condition ORDER BY itemid DESC LIMIT $offset,$pagesize”);
while($r = $db->fetch_array($result)) {
$r[‘addtime’] = timetodate($r[‘addtime’], 5);
$qiandaos[] = $r;
}
$head_title = “每日签到”;
break;
//E 每日签到
2、打开template\default\member\credit.htm
搜索:
{$DT[credit_name]}不足</span></a></td>
{/if}
在下面增加:
{if $MOD[credit_qd]}
<!–S 每日签到–>
<td class=”tab_nav”> </td>
<td class=”tab” id=”action_qiandao”><a href=”credit.php?action=qiandao”><span>每日签到</span></a></td>
<!–E 每日签到–>
{/if}
搜索:
<script type=”text/javascript”>s(‘credit’);m(‘action_less’);</script>
在下面增加:
<!–E 每日签到–>
{elseif $action == ‘qiandao’}
<form method=”post” action=”credit.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”>今日心情</td>
<td class=”tr”><input type=”text” name=”title” value=”按时签到是个好习惯^_^ 签到拿分走人” size=”80″ style=”padding:3px;”/></td>
</tr>
<tr>
<td class=”tl”>奖励方法</td>
<td class=”tr”>
– 每次签到获赠 <strong class=”f_blue”>{$MOD[credit_qdjl]}</strong> {$DT[credit_name]}<br/>
– 同一用户 24小时内计算一次<br/>
</td>
</tr>
<tr>
<td class=”tl”> </td>
<td class=”tr” height=”50″><input type=”submit” name=”submit” value=” 签 到 ” class=”btn”/</td>
</tr>
</table>
</form>
<div class=”bd”>
<table cellpadding=”1″ cellspacing=”0″ class=”tb”>
<tr>
<th>签到时间</th>
<th>奖励</th>
<th>签到IP</th>
<th>心情</th>
</tr>
{loop $qiandaos $k $v}
<tr onmouseover=”this.className=’on’;” onmouseout=”this.className=”;” align=”center”>
<td height=”30″ class=”px11″>{$v[addtime]}</td>
<td class=”px11 f_blue”>{$v[jiangli]}</td>
<td class=”px11 f_red”>{$v[ip]}</td>
<td>{$v[title]}</td>
</tr>
{/loop}
</table>
<div class=”pages”>{$pages}</div>
</div>
<script type=”text/javascript”>s(‘credit’);m(‘action_qiandao’);</script>
<!–E 每日签到–>
3、打开module\member\admin\template\setting.tpl.php
搜索:
<tr>
<td class=”tl”>企业单页被删除扣除</td>
<td>
<input type=”text” size=”5″ name=”setting[credit_del_page]” value=”<?php echo $credit_del_page;?>”/>
</td>
</tr>
在下面增加:
<!–S 每日签到–>
<tr>
<td class=”tl”>每日签到</td>
<td>
<input type=”radio” name=”setting[credit_qd]” value=”0″ <?php if(!$credit_qd) echo ‘checked’;?>/> 关闭
<input type=”radio” name=”setting[credit_qd]” value=”1″ <?php if($credit_qd) echo ‘checked’;?>/>开启
</td>
</tr>
<tr>
<td class=”tl”>签到奖励</td>
<td>
<input type=”text” size=”5″ name=”setting[credit_qdjl]” value=”<?php echo $credit_qdjl;?>”/>
</td>
</tr>
<!–E 每日签到–>
4、打开module\member\admin\menu.inc.php
搜索:
array(‘登录日志’, ‘?moduleid=2&file=loginlog’),
在下面增加:
array(‘签到管理’, ‘?moduleid=2&file=qiandao’),
5、复制file文件夹和module文件夹,包含文件到根目录覆盖相同目录
6、登陆后台-数据维护-数据库恢复-导入qiandao – utf8.sql 或者 qiandao – gbk.sql(根据自己程序的编码选择)
7、登陆后台-会员管理-模块设置-积分规则-设置好每日签到-开启,签到奖励积分
8、以上代码修改如果是utf8编码的请注意转码,本次发布新增的文件为utf8编码,需要其他编码的请自行转换。以上操作完成则安装完成,那么就发布测试看下效果吧!
评论前必须登录!
注册