本帖最后由 qyl3qyl3 于 2010-02-03 11:10 编辑
错位问题,20楼有解决办法,不过每次刷新后还是显示为打卡领工资状态需要解决,另外打卡后不刷新页面无法显示出金币多少。做个备份对比下先
★★★仿白社会打卡领工资免费发布!★★★
-----------------------------------------------
。请不要忘记修改TaskID!有2处:Space_feed.htm和space_feed.php
手动修改方法:
1.修改style.css在最下面增加/*By Comver!UCH插件制作、模板仿制Q136468936 ; 136468936@qq.com*/
/* taskBox */
.sidebox{clear:both;border:1;}
.sidebox_r_top{height:1px;clear:both;overflow:hidden;border-top:1px solid #f4f4f4; }
.taskBox{padding:8px 12px;height:45px;margin:0; clear:both;overflow:hidden;}
.cashBox{ float:left; height:25px; }
.cashBox .i-cash{ display:block; float:left; width:25px; height:25px;background:url(images/taskImg.gif) no-repeat 0 -50px; }
.cashBox .helpLink{ color:#6899B9; cursor:help;}
.cashBox span.txt{ _padding-top:2px;padding-top:1px; line-height:20px; display:block;color:#444;}
.cashBox span.txt img{margin-right:5px;vertical-align: middle;}
.cashBox span.txt a{ color:#369;}
.dwagesBox{ float:right; width:100px;height:25px;}
.btn_getreward_true{background:url(image/btn_getreward_true.gif) no-repeat;width:100px;height:24px;display:block;cursor:hand;}
.btn_getreward_false{background:url(image/btn_getreward_false.gif) no-repeat;width:100px;height:24px;display:block;}
.btn_getreward_true span, .btn_getreward_flase span{display:none;width:0;height:0;}
.cashMedia{display:none;}
/******** space_feed 等级 ******/
.level_info{float:left;margin-right:5px;}
.level_box{clear:both;width:100%;margin:5px 0 0px 0;height:20px;}
.level_box{float:left;margin-right:5px;}
.level_box .level_info span{color:#444;}
.level_box .level_info em{padding:0;color:#369;font-weight:normal;font-style:normal;}
.level_box .level_info img {vertical-align: middle;margin-right:5px;}
.level_box .level_label { float:right; width:98px; margin: 2px 0 0;_margin: 0; height: 13px; border: 1px solid #8EB6CC; }
.level_box .level_label .percent { height: 11px; background: #C5DAE7; border: 1px solid #FFF; }
.level_box .level_label .label { position: relative; margin: -13px 0 0; line-height: 13px; font-size:9px; font-family:Verdana; text-align: center; }
复制代码2.修改space_feed.htm在
<div class="sidebox">
复制代码
下面增加<div class="taskBox">
<div class="cashBox">
<span class="txt"><img src="image/icon_money_b.gif"/>小金库:<a href="cp.php?ac=credit" id="mycredit" class="helpLink" target="_blank" title="我的积分数"><span id="mycredit"><!--{if $_SGLOBAL[supe_uid]}-->$space[credit]<!--{else}-->0<!--{/if}--></span></a></span>
</div>
<script language="javascript" type="text/javascript" src="source/script_task.js"></script>
<div class="dwagesBox">
<!--{if $_SGLOBAL[supe_uid] && $task_getreward}-->
<!--注:getpunchclock('8');中的8为Taskid,请记住修改!-->
<!--Powered By Comver-->
<div id="div_getreward"><a href="javascript:getpunchclock('8');playmedia('div_cashMedia')" id="dwages" title="打卡领工资(9:30之前打卡,工资会翻倍哦~)"><span class="btn_getreward_true"><span>打卡领工资</span></span></a></div>
<!--{else}-->
<div id="div_getreward"><span class="btn_getreward_false" title="今日工资已领(9:30之前打卡,工资会翻倍哦~)"><span> </span></span></div>
<!--{/if}-->
</div>
<div class="level_box">
<div class="level_info"><img src="image/icon_level_b.gif"/><span>等级:</span><em> <!--{eval echo getlevel($space[experience]);}--> 级</em></div>
<div class="level_label" title="升级还需<!--{eval echo getlevel($space[experience],1);}-->经验">
<div class="percent" style="width: <!--{eval echo getlevel($space[experience],2);}-->%;"></div>
<div class="label">{$space[experience]}/<!--{eval echo getlevel($space[experience],3);}--></div>
</div>
</div>
</div>
<div id="div_cashMedia" class="cashMedia"></div>
</div>
复制代码3.do_ajax.htm在本周期内,您还有 $rule[cyclenum] 次机会
</p>
<!--{/if}-->
</div>
<!--{/if}-->
复制代码后添加<!--{elseif $op == 'getpunchclock'}-->
<!--{if $rule[credit]}-->$rule[credit]<!--{/if}-->
复制代码
4.修改do_ajax.php在}
ssetcookie('reward_log', '');
}
复制代码后面增加} elseif($op == 'getpunchclock') {
$tid = intval($_GET['tid']);
$query = $_SGLOBAL['db']->query('SELECT * FROM '.tname('task')." WHERE taskid='$tid'");
if($task = $_SGLOBAL['db']->fetch_array($query))
{
//执行任务脚本
include_once(S_ROOT.'./source/task/'.$task['filename']);
//用户执行情况
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('usertask')." WHERE uid='$_SGLOBAL[supe_uid]' AND taskid='$tid'");
if($usertask = $_SGLOBAL['db']->fetch_array($query))
{
$allownext = 0;
$lasttime = $usertask['dateline'];
if($task['nexttype'] == 'day')
{
if(sgmdate('Ymd', $_SGLOBAL['timestamp']) == sgmdate('Ymd', $lasttime))
{
$task['done'] = 0;
}
}
}
if($task['done'])
{
$task['dateline'] = $_SGLOBAL['timestamp'];
$setarr = array(
'uid' => $_SGLOBAL['supe_uid'],
'username' => $_SGLOBAL['supe_username'],
'taskid' => $tid,
'credit' => $task['credit'],
'dateline' => $_SGLOBAL['timestamp'],
'isignore' => 0
);
inserttable('usertask', $setarr);
//更新任务完成数
$_SGLOBAL['db']->query("UPDATE ".tname('task')." SET num=num+1 WHERE taskid='$task[taskid]'");
//增加积分
if($task['credit'])
{
$_SGLOBAL['db']->query("UPDATE ".tname('space')." SET credit=credit+$task[credit] WHERE uid='$_SGLOBAL[supe_uid]'");
$query = $_SGLOBAL['db']->query("SELECT credit FROM ".tname('space')." WHERE uid='$_SGLOBAL[supe_uid]'");
$rule = $_SGLOBAL['db']->fetch_array($query);
}
//产生feed
if(ckprivacy('task', 1)) {
$fs = array(
'title_template' => $task['credit']?cplang('feed_task_credit'):cplang('feed_task'),
'title_data' => array(
'task'=>'<a href="cp.php?ac=task&taskid='.$task['taskid'].'">'.$task['name'].'</a>',
'credit' => $task['credit']
),
);
feed_add('task', $fs['title_template'], $fs['title_data']);
}
}
}
复制代码
5.space_feed.php中在//获取任务
include_once(S_ROOT.'./source/function_space.php');
复制代码后添加//By Comver
$task = gettask();
$task_getreward = getmytask(8); //8为TASKID号
复制代码
6.function_space.php中在?>前增添//获取打卡零工资执行情况 By Comver
function getmytask($tid)
{
global $space, $_SGLOBAL;
//用户执行情况
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('usertask')." WHERE uid='$_SGLOBAL[supe_uid]' AND taskid='$tid'");
if($usertask = $_SGLOBAL['db']->fetch_array($query))
{
$lasttime = $usertask['dateline'];
if(sgmdate('Ymd', $_SGLOBAL['timestamp']) == sgmdate('Ymd', $lasttime))
{
return 1;//Y
}
else
{
return 0; //n
}
}
return 0;
}
复制代码
7.function_common.php的?>前加//处理积分等级 By Comver!
function getlevel($experience,$id=0) {
global $_SCONFIG;
$starnum = 0;
$starnum = intval($experience/$_SCONFIG['starcredit']) + 1;
//echo 'starlevelnum'.$_SCONFIG['starlevelnum']."<BR>";
//echo 'starcredit'.$_SCONFIG['starcredit'];
//exit;
$level = 0;
if($_SCONFIG['starlevelnum'] < 2)
{
if($starnum > 10) $starnum = 10;
}
if($experience<$_SCONFIG['starcredit'])
{
$level = 0;
}
else
{
for($i = 10; $i > 0; $i--)
{
$nextlevel = pow(2, ($i-1))*$_SCONFIG['starcredit'];
if(($experience-$nextlevel) >=0)
{
$level = $i;
break;
}
}
}
switch($id)
{
case 0:
return $level;
break;
case 1:
return $_SCONFIG['starcredit']*pow(2, $level) - $experience; //还差经验值
break;
case 2:
return round($experience/($_SCONFIG['starcredit']*pow(2, $level)),2)*100; //百分数
break;
case 3:
return $_SCONFIG['starcredit']*pow(2, $level);//下一个等级
break;
}
}
复制代码
8.space_feed.htm中在</script>
<!--{eval my_checkupdate();}-->
<!--{eval my_showgift();}-->
<!--{template footer}-->
<!--{/if}-->
复制代码前面加上function getpunchclock(tid) {
if(tid) {
var x = new Ajax();
var obj = $('div_getreward');
obj.innerHTML = '<span class="btn_getreward_false" title="今日工资已领(9:30之前打卡,工资会翻倍哦~)"><span> </span></span>';
x.get('do.php?ac=ajax&op=getpunchclock&tid='+tid, function(s){
$('mycredit').innerHTML = s;
});
}
}
复制代码
9.上传new.rar中的内容,完毕!
***************
不会手动安装的,请下载原包。
下载 (11.4 KB)
昨天 00:52
2.3更新!暂时支持Gbk,UTF-8的用户请自行转码!欢迎各位测试下载!
有钱的给个哦。~ |