本帖最后由 136468936 于 2010-2-26 11:40 编辑
★★★仿白社会打卡领工资免费发布!★★★
修复了不能使用QQ牧场的问题
-----------------------------------------------
请不要忘记修改TaskID!有3处:Space_feed.htm和space_feed.php及cleandk.php(任务文件)
手动修改方法:
1.修改style.css在最下面增加- /*By Comver!UCH插件制作、模板仿制:QQ136468936 ; 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="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 == 1}-->
- <!--注: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 1;
- }
复制代码
7.space_feed.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中的内容和cleandk.rar,修改taskid(3处)完毕!
***************
不会手动安装的,请下载原包。(再下cleandk.rar)
***************
Cleandk.rar使用方法:传到source\cron目录下,在后台的计划任务处设置一个新的计划,每天执行一次cleandk.php即可 --可解决只能打一次卡
抱歉,之前写错个数字,所以2.12之前改的再改改吧!~
有钱的给个哦。~
Taskid应该是设置“有奖任务”中的“领取每日访问大礼包”任务的ID,获取方法:在后台点击“有奖任务”,找到“领取每日访问大礼包”,点击编辑,这时看地址栏:http://*******/admincp.php?ac=task&op=edit&taskid=7,最后的那个7就是taskid。
================
我的开发的插件:
1.❤❤赚钱啦!社区网页游戏插件精简版插件❤❤
2.发布啦!★★★★ UCH2.0 本地视频认证!~正式发布!★★★★
3.★★★仿白社会打卡领工资免费发布!★★★ |