📄 admin_ing.php
字号:
<?
//////////////////////////////////db connect
include "connect.php";
include "lib.php";
//////////////////////////////////Competence check
$chk_admin=chk_admin_return($bd);
$chk_root=chk_level_return(1);
if(!($chk_admin+$chk_root)){error($error.'错误读取.');}
//////////////////////////////////Reply writing confirmation
if($mode=="del" || $mode=="move"){
for($i=0;$i<$count;$i++){
if($check_button[$i]){
$data=selects("$board_table$bd","and no=$check_button[$i]");
$data2=selects("$board_table$bd","and abs=$data[abs] and step>$data[step]");
if($data2){$check_reply=1;}
}
}
if($check_reply && $mode=="del"){error($error.'已有回复,不能删除.');}
if($check_reply && $mode=="move"){error($error.'已有回复,不能移动.');}
}
////////////////////////////////////////////////////////////////////move or copy
if($mode=="move" || $mode=="copy"){
//////////////////////////////////Writing number to enter
$plus_article=sizeof($check_button);
//////////////////////////////////To check smallest abs of board to move
$min_abs=@mysql_fetch_array(@mysql_query("select min(abs) from $board_table$to where abs>-2147483648",$connect));
$min_abs=$min_abs["min(abs)"]-1-$plus_article;
//////////////////////////////////To check largest no of board to move
$max_no=@mysql_fetch_array(@mysql_query("select max(no) from $board_table$to",$connect));
$max_no=$max_no["max(no)"]+1+$plus_article;
//////////////////////////////////To check smallest category of board to move
$min_cat=@mysql_fetch_array(@mysql_query("select min(cat) from $board_table$to",$connect));
$min_cat=$min_cat["min(cat)"];
//////////////////////////////////to operate loop
for($i=0;$i<$count;$i++){
//////////////////////////////////only checked ;;;
if($check_button[$i]){
//////////////////////////////////To take out writing information
$article=selects("$board_table$bd","and no=$check_button[$i]");
//////////////////////////////////Appending 1st copy
if($article[attach_name]){
$attach_dir=time()."a".(double)microtime();
@mkdir("file/$attach_dir",0777);
@copy("file/$article[attach_dir]/$article[attach_name]","file/$attach_dir/$article[attach_name]");
}
//////////////////////////////////Appending 2nd copy
if($article[attach2_name]){
$attach2_dir=time()."b".(double)microtime();
@mkdir("file/$attach2_dir",0777);
@copy("file/$article[attach2_dir]/$article[attach2_name]","file/$attach2_dir/$article[attach2_name]");
}
//////////////////////////////////Value to copy
if(!$article[step]){$min_abs++;}
$max_no--;
$value="
'$max_no',
'$article[id]',
'$article[name]',
'$article[memo]',
'$article[home]',
'$article[mail]',
'$article[title]',
'$article[date]',
'$article[hit]',
'$article[pass]',
'$article[ip]',
'$min_cat',
'$min_abs',
'$article[step]',
'$article[level]',
'$article[secret]',
'$article[html]',
'$article[remail]',
'$article[attach_name]',
'$article[attach_size]',
'$attach_dir',
'$article[attach_hit]',
'$article[attach2_name]',
'$article[attach2_size]',
'$attach2_dir',
'$article[attach2_hit]',
'$article[link]',
'$article[link_hit]',
'$article[link2]',
'$article[link2_hit]',
'$article[image]',
'$article[vote]'";
//////////////////////////////////To put writing
input("$board_table$to","","$value");
//////////////////////////////////move comment
$query="select * from $com_table$bd where no=$check_button[$i]";
$result=mysql_query($query,$connect);
while($data=mysql_fetch_array($result))
{
input("$com_table$to","comno,id,no,name,memo,pass,ip,date","'','$data[id]','$max_no','$data[name]','$data[memo]','$data[pass]','$data[ip]','$data[date]'");
}
//////////////////////////////////checked end
}
//////////////////////////////////loop out
}
////////////////////////////////////////////////////////////////////When transfer or copy, end
}
////////////////////////////////////////////////////////////////////erase or move
if($mode=="del" || $mode=="move"){
//////////////////////////////////to operate loop
for($i=0;$i<$count;$i++){
//////////////////////////////////only checked ;;;
if($check_button[$i]){
//////////////////////////////////To take out writing information
$article=selects("$board_table$bd","and no=$check_button[$i]");
//////////////////////////////////Attached file delete
if($article[attach_name]){
@unlink("file/$article[attach_dir]/$article[attach_name]");
@rmdir("file/$article[attach_dir]");
}
//////////////////////////////////Attached file delete 2
if($article[attach2_name]){
@unlink("file/$article[attach2_dir]/$article[attach2_name]");
@rmdir("file/$article[attach2_dir]");
}
//////////////////////////////////Erase writing and comment
del("$board_table$bd","no=$check_button[$i]");
del("$com_table$bd","no=$check_button[$i]");
//////////////////////////////////Checked end
}
//////////////////////////////////loop out
}
////////////////////////////////////////////////////////////////////When delete or transfer, end
}
//////////////////////////////////move
mysql_close($connect);
go("naboard.php?bd=$bd");
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -