📄 masingle.php
字号:
<input type='radio' name='topped' value='1' $checked[1]> $lang[topped]1
<input type='radio' name='topped' value='2' $checked[2]> $lang[topped]2
<input type='radio' name='topped' value='3' $checked[3]> $lang[topped]3
";
} elseif($groupid==5){
$actiondb="<input type='radio' name='topped' value='0' $checked[0]>$lang[topped_2]
<input type='radio' name='topped' value='1' $checked[1]> $lang[topped]1
<input type='radio' name='topped' value='2' $checked[2]> $lang[topped]2
";
} else{
$actiondb="<input type='radio' name='topped' value='0' $checked[0]>$lang[topped_2]
<input type='radio' name='topped' value='1' $checked[1]> $lang[topped]1
<input type='radio' name='topped' value='2' $checked[2]> $lang[topped]2
<input type='radio' name='topped' value='3' $checked[3]> $lang[topped]3
";
}
require_once PrintEot('masingle');footer();
} else{
if($topped==3 && $groupid==5){
Showmsg('masigle_top');
}
if($ifmsg && $topped && $topped!=$tpc['topped']){
$message=array($tpc['author'],$winduid,$lang['topped_msg'],$timestamp,$reason,'',$windid);
writenewmsg($message,1);
}
$db->update("UPDATE pw_threads SET topped='$topped' WHERE tid='$tid'");
refreshto("thread.php?fid=$fid",'operate_success');
}
} elseif($action=="digest"){
$tpc=$db->get_one("SELECT fid,author,authorid,subject,digest FROM pw_threads WHERE tid='$tid'");
if($fid!=$tpc['fid']){
Showmsg('admin_forum_right');
}
if(empty($_POST['step'])){
$msginfo=$lang['digest_msg_1'].$lang['article_info']."\n".$lang['digest_msg_2'];
$checked[$tpc['digest']]='checked';
$actiondb="
<input type='radio' name='digest' value='0' $checked[0]>$lang[digest_2]
<input type='radio' name='digest' value='1' $checked[1]>$lang[digest]1
<input type='radio' name='digest' value='2' $checked[2]>$lang[digest]2";
require_once PrintEot('masingle');footer();
} else{
if(!$tpc['digest'] && $digest){
if($ifmsg){
$message=array($tpc['author'],$winduid,$lang['digest_msg_1'],$timestamp,$reason,'',$windid);
writenewmsg($message,1);
}
$reason=str_replace("\n","",$reason);
$newlog_forum.="<?die;?>|$lang[digest_3]|$fid||$tpc[subject]|$tpc[author]|$reason|+$msg_dtjhrvrc|+$db_dtjhmoney|$timestamp|$windid|$onlineip|\n";
dtchange($tpc['authorid'],$db_dtjhrvrc,0,$db_dtjhmoney);
$db->update("UPDATE pw_memberdata SET digests=digests+1 WHERE uid='$tpc[authorid]'");
} elseif($tpc['digest'] && !$digest){
if($ifmsg){
$message=array($tpc['author'],$winduid,$lang['digest_msg_3'],$timestamp,$lang['digest_msg_3'].$lang['article_info']."\n".$lang['digest_msg_4'],'',$windid);
writenewmsg($message,1);
}
$newlog_forum.="<?die;?>|$lang[digest_2]|$fid||$tpc[subject]|$tpc[author]|-|-$msg_dtjhrvrc|-$db_dtjhmoney|$timestamp|$windid|$onlineip|\n";
dtchange($tpc['authorid'],-$db_dtjhrvrc,0,-$db_dtjhmoney);
$db->update("UPDATE pw_memberdata SET digests=digests-1 WHERE uid='$tpc[authorid]'");
}
/*
* 管理日志
*/
writeover(R_P."data/bbscache/log_forum.php",$newlog_forum,"ab");
$db->update("UPDATE pw_threads SET digest='$digest' WHERE tid='$tid'");
refreshto("thread.php?fid=$fid&concle=1",'operate_success');
}
} elseif($action=="lock"){
$tpc=$db->get_one("SELECT fid,author,subject,locked,postdate FROM pw_threads WHERE tid='$tid'");
if($fid!=$tpc['fid']){
Showmsg('admin_forum_right');
}
if(empty($_POST['step'])){
$msginfo=$lang['lock_msg_1'].$lang['article_info'];
$checked[$tpc['locked']]='checked';
$actiondb="
<input type='radio' name='locked' value='0' $checked[0]>$lang[lock_2]
<input type='radio' name='locked' value='1' $checked[1]>$lang[lock]
<input type='radio' name='locked' value='2' $checked[2]>$lang[lock_1]";
require_once PrintEot('masingle');footer();
} else{
if(!$tpc['locked'] && $locked){
if($locked==2){
@unlink("htm_data/$fid/".date('ym',$postdate)."/$tid.html");
}
if($ifmsg){
$message=array($tpc['author'],$winduid,$lang['lock_msg_1'],$timestamp,$reason,'',$windid);
writenewmsg($message,1);
}
$reason=str_replace("\n","",$reason);
$newlog_forum.="<?die;?>|$lang[lock_3]|$fid||$tpc[subject]|$tpc[author]|$reason|-|-|$timestamp|$windid|$onlineip|\n";
} elseif($tpc['locked'] && !$locked){
if($ifmsg){
$reason=$lang['lock_msg_2'].$lang['article_info'];
$message=array($tpc['author'],$winduid,$lang['lock_msg_2'],$timestamp,addslashes($reason),'',$windid);
writenewmsg($message,1);
}
$reason=str_replace("\n","",$reason);
$newlog_forum.="<?die;?>|$lang[lock_2]|$fid||$tpc[subject]|$tpc[author]|$reason|-|-|$timestamp|$windid|$onlineip|\n";
} else{
$newlog_forum='';
}
/*
* 管理日志
*/
writeover(R_P."data/bbscache/log_forum.php",$newlog_forum,"ab");
$db->update("UPDATE pw_threads SET locked='$locked' WHERE tid='$tid'");
refreshto("thread.php?fid=$fid",'operate_success');
}
} elseif($action=="pushtopic"){
if(empty($_POST['step'])){
require_once PrintEot('masingle');footer();
} else{
$db->update("UPDATE pw_threads SET lastpost='$timestamp' WHERE tid='$tid'");
refreshto("thread.php?fid=$fid",'operate_success');
}
} elseif($action=="delatc"){
if(empty($delatc)){
Showmsg('mawhole_nodata');
}
if($foruminfo['f_score']!=''){
list($P_Prvrc,$P_Rrvrc,$P_Pmoney,$P_Rmoney,$P_Drvrc,$P_Dmoney,$P_DRrvrc)=explode("|",$foruminfo['f_score']);
is_numeric($P_Drvrc) && $db_dtdelrvrc=$P_Drvrc;
is_numeric($P_Dmoney) && $db_dtdelmoney=$P_Dmoney;
is_numeric($P_DRrvrc) && $db_dtdelrprvrc=$P_DRrvrc;
}
$deltpc=$pids='';
foreach($delatc as $value){
if($value=='tpc'){
$deltpc='1';
} else{
is_numeric($value) && $pids.=$value.',';
}
}
/*
* 删除回复未做回收站功能
*/
if($pids){
$pids=substr($pids,0,-1);
$authorarray=array();
$aids='';
$query=$db->query("SELECT fid,aid,author,authorid,subject FROM pw_posts WHERE pid IN($pids)");
while($posts=$db->fetch_array($query)){
if($posts['fid']!=$fid){
Showmsg('admin_forum_right');
}
if($posts['aid']){
$attachs= unserialize(stripslashes($posts['aid']));
foreach($attachs as $key=>$value){
@unlink("$attachpath/$value[attachurl]");
$db->update("DELETE FROM pw_attachs WHERE aid='$key'");
}
}
$authorarray[$posts[authorid]]=$posts['author'];
}
foreach($authorarray as $authorid=>$author){
dtchange($authorid,-$db_dtdelrprvrc,-1,-$db_dtdelmoney);
$msg_delrprvrc=floor($db_dtdelrprvrc/10);
$newlog_forum="<?die;?>|Delete Reply|$fid|$tid|$subject|$author|$lang[del_msg]|-$msg_delrprvrc|-$db_dtdelmoney|$timestamp|$windid|$onlineip|\n";
writeover(R_P."data/bbscache/log_forum.php",$newlog_forum,"ab");
}
$db->update("DELETE FROM pw_posts WHERE pid IN($pids)");
}
$rs=$db->get_one("SELECT count(*) AS count FROM pw_posts WHERE tid='$tid'");
$count=$rs['count'];
$count++;
if($deltpc){
@extract($db->get_one("SELECT t.author,t.authorid,t.subject,t.fid AS tfid,tm.aid FROM pw_threads t LEFT JOIN pw_tmsgs tm ON tm.tid=t.tid WHERE t.tid='$tid'"));
if($tfid!=$fid){
Showmsg('admin_forum_right');
}
if($windid!=$manager && $groupid!=3 && $groupid!=4){
$authordb=$db->get_one("SELECT groupid FROM pw_members WHERE uid='$authorid'");
if(($authordb['groupid']==3 || $authordb['groupid']==4) && $groupid!=3 && $groupid!=4){
Showmsg('modify_admin');
}
}
dtchange($authorid,-$db_dtdelrvrc,-1,-$db_dtdelmoney);
$msg_delrvrc=floor($db_dtdelrvrc/10);
$newlog_forum="<?die;?>|Delete Topic|$fid|$tid|$subject|$author|$lang[del_msg]|-$msg_delrvrc|-$db_dtdelmoney|$timestamp|$windid|$onlineip|\n";
writeover(R_P."data/bbscache/log_forum.php",$newlog_forum,"ab");
if($count==1){
if(!$db_recycle || $fid==$db_recycle){
if($aid){
$attachs= unserialize(stripslashes($aid));
foreach($attachs as $key=>$value){
@unlink("$attachpath/$value[attachurl]");
$db->update("DELETE FROM pw_attachs WHERE aid='$key'");
}
}
$db->update("DELETE FROM pw_tmsgs WHERE tid='$tid'");
$db->update("DELETE FROM pw_threads WHERE tid='$tid'");
@unlink("htm_data/$fid/".date('ym',$postdate)."/$tid.html");
} else{
$db->update("UPDATE pw_threads SET fid='$db_recycle',topped=0 WHERE tid='$tid'");
@unlink("htm_data/$fid/".date('ym',$postdate)."/$tid.html");
//****
$db->update("UPDATE pw_forums SET topic=topic+1,article=article+1 WHERE fid='$db_recycle'");
}
} else{
$count--;
@extract($db->get_one("SELECT * FROM pw_posts WHERE tid='$tid' ORDER BY postdate LIMIT 1"));
$db->update("DELETE FROM pw_posts WHERE pid='$pid'");
$subject && $subject="subject='$subject',";
/*
* 删除已回复的主题未做回收站功能
*/
$db->update("UPDATE pw_threads SET icon='$icon',$subject author='$author',authorid='$authorid',postdate='$postdate' WHERE tid='$tid'");
$db->update("UPDATE pw_tmsgs SET aid='$aid',userip='$userip',ifsign='$ifsign',buy='$buy',ipfrom='$ipfrom' ,alterinfo='$alterinfo',ifconvert='$ifconvert',content='$content' WHERE tid='$tid'");
}
}
$ifupload=getattachtype($tid);
$db->update("UPDATE pw_threads SET ifupload='$ifupload' WHERE tid='$tid'");
if($count){
if($count==1){
$lastinfo=$db->get_one("SELECT subject,postdate,author FROM pw_threads WHERE tid='$tid' ");
} else{
$lastinfo=$db->get_one("SELECT subject,postdate,author FROM pw_posts WHERE tid='$tid' ORDER BY postdate DESC LIMIT 1");
}
@extract($db->get_one("SELECT count(*) AS replies FROM pw_posts WHERE tid='$tid'"));
$db->update("UPDATE pw_threads SET replies='$replies' ,lastpost='$lastinfo[postdate]',lastposter='$lastinfo[author]' WHERE tid='$tid'");
}
updateforum($fid);
require_once(R_P.'require/postfunc.php');
lastinfo($fid);
if(!$topic && $foruminfo['allowhtm'] && $article<$db_readperpage ){
include_once R_P.'require/template.php';
refreshto("thread.php?fid=$fid",'enter_thread');
} else{
refreshto("thread.php?fid=$fid",'enter_thread');
}
}
function addcredit($uid,$cid,$addpoint){
global $db;
if($cid=='rvrc'){
$addpoint*=10;
$db->update("UPDATE pw_memberdata SET rvrc=rvrc+'$addpoint' WHERE uid='$uid'");
}elseif($cid=='money'){
$db->update("UPDATE pw_memberdata SET money=money+'$addpoint' WHERE uid='$uid'");
}elseif($cid=='credit'){
$db->update("UPDATE pw_memberdata SET credit=credit+'$addpoint' WHERE uid='$uid'");
}elseif(is_numeric($cid)){
$credit=$db->get_one("SELECT uid FROM pw_membercredit WHERE uid='$uid' AND cid='$cid'");
if($credit['uid']){
$db->update("UPDATE pw_membercredit SET value=value+'$addpoint' WHERE uid='$uid' AND cid='$cid'");
} else{
$db->update("INSERT INTO pw_membercredit VALUES('$uid','$cid','$addpoint')");
}
} else{
Showmsg('credit_error');
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -