📄 masingle.php
字号:
<?php
require_once('./global.php');
require_once('./header.php');
require_once(R_P.'require/forum.php');
require_once(R_P.'require/msg.php');
require_once(R_P.'require/updateforum.php');
/**
* 版块缓冲文件
*/
include_once(R_P.'data/bbscache/forum_cache.php');
$foruminfo=$db->get_one("SELECT * FROM pw_forums WHERE fid='$fid' AND type<>'category'");
if(!$foruminfo){
require_once(R_P.'require/url_error.php');
}
wind_forumcheck($foruminfo);
$secondurl="thread.php?fid=$fid";
/**
* 安全验证
*/
$groupid=='guest'&& Showmsg('not_login');
empty($action) && Showmsg('undefined_action');
/**
* 获取创始人和版主权限
*/
if($windid==$manager){
$admincheck=1;
} elseif($foruminfo['forumadmin'] && strpos($foruminfo['forumadmin'],','.$windid.',')!==false){
$admincheck=1;
} else{
$admincheck=0;
}
!$windid && $admincheck=0;
if(!$admincheck && $groupid!=5){
/*
* 获取用户组权限
*/
if($action=="banuser"){
$SYSTEM['banuser'] && $admincheck=1;
}elseif($action=="showping"){
$SYSTEM['markable'] && $SYSTEM['credittype'] && $admincheck=1;
} elseif($action=="delatc"){
$SYSTEM['modother'] && $admincheck=1;
} elseif($SYSTEM['typeadmin']){
$admincheck=1;
}
}
if(!$admincheck){
Showmsg('mawhole_right');
}
$actiondb='';
$msg_dtjhrvrc=$db_dtjhrvrc/10;
require_once GetLang('masigle');
if($action=="banuser"){
if(!$step){
$userdb=$db->get_one("SELECT username,groupid FROM pw_members WHERE uid='$uid'");
$username=$userdb['username'];
if($userdb['groupid']=='6'){
Showmsg('member_havebanned');
} elseif($userdb['groupid']!='-1'){
Showmsg('masigle_ban_fail');
}
require_once PrintEot('masingle');footer();
} else{
$userdb=$db->get_one("SELECT uid,groupid FROM pw_members WHERE uid='$uid'");
if(!$userdb){
$errorname=$username;
Showmsg('user_not_exists');
}
if($userdb['groupid']=='-1'){
if($limit>$SYSTEM['banmax']){
Showmsg('masigle_ban_limit');
}
if(!$SYSTEM['bantype'] && $type==2){
Showmsg('masigle_ban_right');
}
$db->update("UPDATE pw_members SET groupid='6' WHERE uid='$userdb[uid]'");
$db->update("REPLACE INTO pw_banuser VALUES('$uid','$type','$timestamp','$limit','".addslashes($windid)."','$reason')");
if($ifmsg){
if($type==1){
$msginfo=$lang['banuser_1'];
$msginfo=str_replace('_limit',$limit,$msginfo);
} else{
$msginfo=$lang['banuser_2'];
}
$message=array($username,$winduid,$lang['banuser_2'],$timestamp,addslashes($msginfo)."\n".$reason,'',$windid);
writenewmsg($message,1);
}
refreshto("profile.php?action=show&uid=$uid",'masigle_ban_success');
} elseif($userdb['groupid']=='6'){
Showmsg('member_havebanned');
} else{
Showmsg('masigle_ban_fail');
}
}
} elseif($action=="showping"){
if(!is_numeric($pid)){
@extract($db->get_one("SELECT fid AS tfid,author,authorid,postdate,subject,tm.ifmark,credit FROM pw_threads t LEFT JOIN pw_tmsgs tm ON tm.tid=t.tid LEFT JOIN pw_memberinfo m ON m.uid='$winddb[uid]' WHERE t.tid='$tid'"));
} else{
@extract($db->get_one("SELECT fid AS tfid,author,authorid,postdate,subject,ifmark,credit FROM pw_posts p LEFT JOIN pw_memberinfo m ON m.uid='$winddb[uid]' WHERE pid='$pid'"));
}
if($tfid!=$fid){
Showmsg('admin_forum_right');
}
if(!$author){
require_once(R_P.'require/url_error.php');
}
if ($windid==$author && $windid != $manager){
Showmsg('masigle_manager');
}
$creditselect='';
if(strpos($SYSTEM['credittype'],'rvrc')!==false){
$creditselect='<option value=rvrc>'.$lang['rvrc'].'</option>';
}
if(strpos($SYSTEM['credittype'],'money')!==false){
$creditselect.='<option value=money>'.$lang['money'].'</option>';
}
if(strpos($SYSTEM['credittype'],'credit')!==false){
$creditselect.='<option value=credit>'.$lang['credit'].'</option>';
}
!$SYSTEM['creditlimit'] && $SYSTEM['creditlimit']='0,0';
list($minper,$maxper)=explode(",",$SYSTEM['creditlimit']);
$cid && $cid!='rvrc' && $cid!='money' && $cid!='credit' && !is_numeric($cid) && Showmsg('credit_error');
if($cid=='rvrc'){
$name=$lang['rvrc'];
$unit=$lang['unit'];
} elseif($cid=='money'){
$name=$lang['money'];
$unit=$lang['unit'];
} elseif($cid=='credit'){
$name=$lang['credit'];
$unit=$lang['unit'];
} else{
$name=$unit='';
}
$query=$db->query("SELECT cid,name,unit FROM pw_credits");
while($creditdb=$db->fetch_array($query)){
$key=$creditdb['cid'];
if(strpos($SYSTEM['credittype'],','.$key.',')!==false){
$creditselect.="<option value='$key'>$creditdb[name]</option>";
}
if($key==$cid){
$name=$creditdb['name'];
$unit=$creditdb['unit'];
}
}
unset($creditdb);
if ($_POST['step'] != 1){
require_once PrintEot('masingle');footer();
}
if(strpos($SYSTEM['credittype'],$cid)===false){
Showmsg('masigle_credit_right');
}
if(!is_numeric($addpoint)){
Showmsg('member_credit_error');
}
if($addpoint>$maxper || $addpoint<$minper){
Showmsg('masigle_creditlimit');
}
if($SYSTEM['maxcredit']){
$creditdb=explode("\t",$credit);
if($creditdb[0]<$tdtime){
$creditdb[0]=$tdtime;
$creditdb[1]=abs($addpoint);
if($creditdb[1]>$SYSTEM['maxcredit'] && $windid != $manager){
$leavepoint=max(0,$SYSTEM['maxcredit']-$creditdb[1]);
Showmsg('masigle_point');
}
} else{
if($creditdb[1]+abs($addpoint)>$SYSTEM['maxcredit'] && $windid != $manager){
$leavepoint=max(0,$SYSTEM['maxcredit']-$creditdb[1]);
Showmsg('masigle_point');
} else{
$creditdb[0]=$timestamp;
$creditdb[1]+=abs($addpoint);
}
}
$newcreditdb=$creditdb[0]."\t".$creditdb[1];
$ifexists=$db->get_one("SELECT uid FROM pw_memberinfo WHERE uid='$winduid'");
if($ifexists){
$db->update("UPDATE pw_memberinfo SET credit='$newcreditdb' WHERE uid='$winduid'");
} else{
$db->update("INSERT INTO pw_memberinfo(uid,credit) VALUES('$winduid','$newcreditdb')");
}
}
addcredit($authorid,$cid,$addpoint);
if($db_autoban && $addpoint<0){
require_once(R_P.'require/autoban.php');
autoban($authorid);
}
if($ifmsg){
$msginfo=$lang['ping_msg_1'].$lang['article_info'];
$msginfo=str_replace('_addpoint',$addpoint,$msginfo);
$msginfo=str_replace('_name',$name,$msginfo);
$msginfo=str_replace('_unit',$unit,$msginfo);
$message=array($author,$winduid,$lang['ping_msg_2'],$timestamp,addslashes($msginfo)."\n".$reason,'',$windid);
writenewmsg($message,1);
}
$ifmark=$ifmark? $name.':'.$addpoint.'('.addslashes($windid).")\t".$ifmark : $name.':'.$addpoint.'('.addslashes($windid).')';
if(strlen($ifmark)>120){
$ifmark=substr($ifmark,0,120);
$ifmark=substr($ifmark,0,strrpos($ifmark,"\t"));
}
if(!is_numeric($pid)){
$db->update("UPDATE pw_threads SET ifmark=ifmark+'$addpoint' WHERE tid='$tid'");
$db->update("UPDATE pw_tmsgs SET ifmark='$ifmark' WHERE tid='$tid'");
} else{
$db->update("UPDATE pw_posts SET ifmark='$ifmark' WHERE pid='$pid'");
}
$markinfo='<?die;?>|'.$tid.'|'.$cid.'|'.$windid.'|'.$onlineip.'|'.$author.'|'.$addpoint.'|'.$timestamp.'|'.$reason."\n";
writeover(R_P."data/bbscache/credit_log.php",$markinfo,"ab");
$ifcheck=1;
if($foruminfo['allowhtm']){
require_once R_P.'require/template.php';
refreshto("read.php?tid=$tid",'enter_thread');
} else{
refreshto("read.php?tid=$tid",'enter_thread');
}
} elseif($action=="edit"){
if(empty($_POST['step'])){
$rs=$db->get_one("SELECT fid,titlefont FROM pw_threads WHERE tid=$tid");
if($fid!=$rs['fid']){
Showmsg('admin_forum_right');
}
$titledetail=explode("~",$rs['titlefont']);
$titlecolor=$titledetail[0];
$titlecolor ? $ifchecked[$titlecolor]='checked' : $ifchecked['none']='checked';
if($titledetail[1]=='1')$ifchecked[1]='checked';
if($titledetail[2]=='1')$ifchecked[2]='checked';
if($titledetail[3]=='1')$ifchecked[3]='checked';
require_once PrintEot('masingle');footer();
} else{
$titlefont="$title1~$title2~$title3~$title4~$title5~$title6~";
$query=$db->update("UPDATE pw_threads SET titlefont='$titlefont' WHERE tid=$tid");
refreshto("thread.php?fid=$fid",'operate_success');
}
} elseif($action=="headtopic"){
$tpc=$db->get_one("SELECT fid,author,subject,topped FROM pw_threads WHERE tid='$tid'");
if($fid!=$tpc['fid']){
Showmsg('admin_forum_right');
}
if($tpc['topped']==3 && $groupid==5){
Showmsg('masigle_top');
}
if(empty($_POST['step'])){
$msginfo=$lang['topped_msg'].$lang['article_info'];
$checked[$tpc['topped']]='checked';
if($groupid==3 || $groupid==4){
$actiondb="<input type='radio' name='topped' value='0' $checked[0]>$lang[topped_2]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -