$id = intval($_GET['id']); } else { html_error_quit("错误的文编号"); } $articles = array(); $num = bbs_get_records_from_id($brdarr["NAME"], $id, $ftype, $articles); if ($num == 0) { html_error_quit("错误的文编号"); } @($action = $_GET["act"]); $msg = ""; $ret = false; if ($action == "delete") { @($act_attachnum = $_GET["attachnum"]); settype($act_attachnum, "integer"); $ret = bbs_attachment_del($board, $id, $act_attachnum); if (!is_array($ret)) { $msg = "错误: " . bbs_error_get_desc($ret); } else { $msg = "删除附件成功"; } } else { if ($action == "add") { if (!bbs_is_attach_board($brdarr) && !($currentuser["userlevel"] & BBS_PERM_SYSOP)) { html_error_quit("不能添加附件"); } if (isset($_FILES['attachfile'])) { @($errno = $_FILES['attachfile']['error']); } else { $errno = UPLOAD_ERR_PARTIAL; }
public function delAttach($num) { $ret = bbs_attachment_del($this->_board->NAME, $this->ID, $num); if (!is_array($ret)) { throw new ArchiveAttException(ECode::kbs2code($ret)); } return $ret; }