程序压缩包中 有说明文档 注意看下
1.如果程序没什么改动 直接把压缩包中的文件 覆盖到相应目录就好了 就不用向下看了
2.如果程序有改动请看这里
(1)在admin/home.inc.php文件中
搜索 if(submitcheck('notesubmit', 1))
把下边这段代码 加再上边
复制内容到剪贴板
代码:
echo '<table width="80%" algin="left">
<tr>
<td>
<a href="shafa.php?action=set" target="_self" style="color:red;font-size:14px;">沙发插件设置</a>
</td>
</tr>
</table>';嘿嘿 这个其实作用就是 进入后台就直接显示 抢沙发软件的入口了 位置自己可以随便调 我是看这里方便
(2)
在include/newreply.inc.php文件中
搜索if($special == 3 && $thread['authorid'] != $discuz_uid && $thread['price'] > 0
把下边代码 加在上边
复制内容到剪贴板
代码:
/*抢沙发奖励*/
if($shafa['shafa_open'] == '1'){
if($shafa['shafa_fid']){
$fidstaus=0;
if(in_array($fid,explode(',',$shafa['shafa_fid']))){
$fidstaus=999;
}
}else{
$fidstaus=999;
}
//echo $fidstaus;exit;
if($fidstaus==999){
$extcreditstype=$shafa['shafa_e_style'];
$extcreditname='extcredits'.$extcreditstype;
if($thread['replies']=='0' && $shafa['shafa_e_1'] == '1' && $discuz_uid !=$thread['authorid']){
$reason = '抢到沙发 ';
$scores=$shafa['shafa_num_1'];
$sqladd =$extcreditname.'='.$extcreditname.'+'.$scores;
$db->query("UPDATE {$tablepre}members SET $sqladd WHERE uid='$discuz_uid'");
$db->query("UPDATE {$tablepre}posts SET rate=rate+".$scores.",ratetimes=ratetimes+1 WHERE pid='$pid'");
$db->query("insert into {$tablepre}ratelog
(pid, uid, username, extcredits, dateline, score, reason)
values
('$pid', '1', 'admin', '$extcreditstype', '$timestamp', '$scores', '$reason')");
}elseif($thread['replies']=='1' && $shafa['shafa_e_2'] == '1' && $discuz_uid !=$thread['authorid']){
$query = $db->query("select authorid from {$tablepre}posts where fid=".$fid." and tid=".$tid." order by pid limit 2");
while($poster = $db->fetch_array($query)) {
$res_post[]=$poster['authorid'];
}
if(!in_array($discuz_uid, $res_post)){
$reason = '抢到板凳 ';
$scores=$shafa['shafa_num_2'];
$sqladd =$extcreditname.'='.$extcreditname.'+'.$scores;
$db->query("UPDATE {$tablepre}members SET $sqladd WHERE uid='$discuz_uid'");
$db->query("UPDATE {$tablepre}posts SET rate=rate+".$scores.",ratetimes=ratetimes+1 WHERE pid='$pid'");
$db->query("insert into {$tablepre}ratelog
(pid, uid, username, extcredits, dateline, score, reason)
values
('$pid', '1', 'admin', '$extcreditstype', '$timestamp', '$scores', '$reason')");
}
}elseif($thread['replies']=='2' && $shafa['shafa_e_3'] == '1' && $discuz_uid !=$thread['authorid']){
$query = $db->query("select pid,authorid from {$tablepre}posts where fid=".$fid." and tid=".$tid." order by pid limit 3");
while($poster = $db->fetch_array($query)) {
$res_post[]=$poster['authorid'];
}
if(!in_array($discuz_uid, $res_post)){
$reason = '抢到地板 ';
$scores=$shafa['shafa_num_3'];
$sqladd =$extcreditname.'='.$extcreditname.'+'.$scores;
$db->query("UPDATE {$tablepre}members SET $sqladd WHERE uid='$discuz_uid'");
$db->query("UPDATE {$tablepre}posts SET rate=rate+".$scores.",ratetimes=ratetimes+1 WHERE pid='$pid'");
$db->query("insert into {$tablepre}ratelog
(pid, uid, username, extcredits, dateline, score, reason)
values
('$pid', '1', 'admin', '$extcreditstype', '$timestamp', '$scores', '$reason')");
}
}elseif($shafa['shafa_e'] == '1'){
$shafa_floor_num_array = explode(',',$shafa['shafa_floor_num']);
foreach($shafa_floor_num_array as $key => $value){
if($thread['replies'] == ($value-2)){
$reason = '指定楼层奖励 ';
$scores=$shafa['shafa_num'];
$sqladd =$extcreditname.'='.$extcreditname.'+'.$scores;
$db->query("UPDATE {$tablepre}members SET $sqladd WHERE uid='$discuz_uid'");
$db->query("UPDATE {$tablepre}posts SET rate=rate+".$scores.",ratetimes=ratetimes+1 WHERE pid='$pid'");
$db->query("insert into {$tablepre}ratelog
(pid, uid, username, extcredits, dateline, score, reason)
values
('$pid', '1', 'admin', '$extcreditstype', '$timestamp', '$scores', '$reason')");
}
}
}
}
}
/*抢沙发奖励*/ 这个作用就是 给后台设定的楼层加分了
(3)在post.php文件中搜索require_once DISCUZ_ROOT.'./include/post.func.php';
把下边代码加再上边
复制内容到剪贴板
代码:
require_once DISCUZ_ROOT.'./forumdata/plugin_cache/shafa_cache.php';作用就是包含我们后台设置好的配置文件
(4)直接把shafa.php 拷到论坛根目录
作用就是后台的界面显示,与设置文件