⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 del_ing.php

📁 php写的论坛,代码精简到极点 请相看说明文件。是从英文翻译过来的:)
💻 PHP
字号:
<?
//////////////////////////////////ready
include"connect.php";
include"lib.php";

//////////////////////////////////check
chk_bd($bd);
if(!$mode){error($error.'读取错误');}

//////////////////////////////////To bring member information
if($HTTP_COOKIE_VARS[$member_cookie]){$id=$HTTP_COOKIE_VARS[$member_cookie];}
$member=member_info($id);

//////////////////////////////////Bring writing information and then To check whether there is reply writing
if($mode=="article"){
$article=selects($board_table.$bd,"and no=$no");
$check_article=selects($board_table.$bd,"and abs=$article[abs] and step>$article[step]");
if($check_article){error($error.'已有回复,不能删除');}
}

//////////////////////////////////In case comment, to bring comment information
if($mode=="comment"){
$article=selects($com_table.$bd,"and comno=$comno");
}

//////////////////////////////////password check - if password being & password right , ok
$pass=@mysql_fetch_array(@mysql_query("select password('$pass')",$connect));$pass=$pass[0];
if($pass && $article[pass] && $pass==$article[pass]){$ok=1;}else{$ok=0;}

//////////////////////////////////check
$chk_admin=chk_admin_return($bd);
$chk_root=chk_level_return(1);
if($article[id] && $HTTP_COOKIE_VARS[$member_cookie] && $article[id]==$HTTP_COOKIE_VARS[$member_cookie]){$chk_my=1;}else{$chk_my=0;}
$chk_all=$chk_admin+$chk_root+$chk_my+$ok;

//////////////////////////////////Competence check result
if(!$chk_all){error($error.'Delete error\\n\\nPassword is inexact or it is no competence');}

if($mode=="article"){
//////////////////////////////////point-1
if($article[id] && $article[step]){
@mysql_query("update $member_table set reply=reply-1 where id='$article[id]'",$connect);
}
elseif($article[id] && !$article[step]){
@mysql_query("update $member_table set article=article-1 where id='$article[id]'",$connect);
}

//////////////////////////////////Appended file delete 1
if($article[attach_name]){
@unlink("file/$article[attach_dir]/$article[attach_name]");
@rmdir("file/$article[attach_dir]");
}

//////////////////////////////////Appended file delete 2
if($article[attach2_name]){
@unlink("file/$article[attach2_dir]/$article[attach2_name]");
@rmdir("file/$article[attach2_dir]");
}

//////////////////////////////////article delete
del("$board_table$bd","no=$no");

//////////////////////////////////All comment delete of writing
del("$com_table$bd","no=$no");
}

//////////////////////////////////comment delete
if($mode=="comment"){
del("$com_table$bd","comno=$comno");
if($article[id]){
@mysql_query("update $member_table set comment=comment-1 where id='$article[id]'",$connect);
}
}

//////////////////////////////////finish~~~  the end~~
mysql_close($connect);
if($mode=="article"){go("naboard.php?bd=$bd");}
if($mode=="comment"){go("memo.php?bd=$bd&no=$no&add_hit=no");}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -