<?
include_once("../inc/config.php");
include_once("../inc/publicfun.php");
include_once("../inc/ftbbsdbclass.php");
include_once("../conn.php");
include_once("../admin/check_master.php");
include_once("../admin/check_admin_qs.php");

$op=$_POST["op"];
$idList=$_POST["checkbox1"];

switch ($op){
case "选择删除":
    for($i=0; $i<count($idList); $i++){
	   $sql="select * from {$tablepre}ftblog_pl where id=".$idList[$i];
       $rs=mysql_query($sql);
       $myrow = mysql_fetch_array($rs);
       $numrows = mysql_num_rows($rs);
	   if ($numrows!=0){
	   $blogid=$myrow["blogid"];
	   mysql_query("update {$tablepre}ftblog set blogplnum=blogplnum-1 where blogplnum>0 and id=".$blogid);
	   mysql_query("delete from {$tablepre}ftblog_pl where id='".$idList[$i]."'");
	   }
    }
	break;
case "选择显示":
    for($i=0; $i<count($idList); $i++){
     mysql_query("update {$tablepre}ftblog_pl set plqs=0 where id=".$idList[$i]);
    }
	break;
case "取消显示":
    for($i=0; $i<count($idList); $i++){
     mysql_query("update {$tablepre}ftblog_pl set plqs=1 where id=".$idList[$i]);
    }
	break;
}
$db->close(); 
header("Location:".$_SERVER["HTTP_REFERER"]);
?>