Ejemplo n.º 1
0
function do_manage_function($board)
{
    global $bbsman_modes;
    $mode = intval($_POST['act']);
    $anncode = $bbsman_modes['ANNOUNCE'];
    if ($mode > 0 && $mode <= sizeof($bbsman_modes)) {
        for ($i = 0; $i < ARTCNT; $i++) {
            if (isset($_POST['art' . $i])) {
                if (intval($_POST['art' . $i])) {
                    $id = intval($_POST['art' . $i]);
                    $zhiding = 0;
                }
            } elseif (isset($_POST['ding' . $i])) {
                if (intval($_POST['ding' . $i])) {
                    $id = intval($_POST['ding' . $i]);
                    $zhiding = 1;
                }
            } else {
                continue;
            }
            if (!$id) {
                continue;
            }
            if ($mode == $bbsman_modes['ANNOUNCE']) {
                $ret = bbs_bmmanage($board, $id, $anncode, $zhiding);
                if ($ret == -9) {
                    html_error_quit('系统错误,无法修改精华区剪贴板。');
                    exit;
                }
                $anncode = $bbsman_modes['ANNOUNCEADD'];
                continue;
            }
            if ($zhiding && $mode != $bbsman_modes['UNDEL']) {
                if ($mode != $bbsman_modes['DEL'] && $mode != $bbsman_modes['ZHIDING'] && $mode != $bbsman_modes['NOREPLY']) {
                    continue;
                }
                if ($mode != $bbsman_modes['NOREPLY']) {
                    $mode = $bbsman_modes['DEL'];
                }
            }
            $ret = bbs_bmmanage($board, $id, $mode, $zhiding);
            switch ($ret) {
                case -1:
                case -2:
                case -3:
                case -9:
                    if ($mode != 6) {
                        html_error_quit('系统错误');
                    }
                    break;
                case -4:
                    html_error_quit('文章ID错误');
                    break;
                default:
            }
        }
    }
    if ($mode == $bbsman_modes["ANNOUNCE"]) {
        $ann_path = bbs_getannpath($board);
        if ($ann_path != FALSE) {
            if (!strncmp($ann_path, "0Announce/", 10)) {
                $ann_path = substr($ann_path, 9);
            }
            // 丝路功能问题多多 先不要用
            // header("Location: bbsipath.php?annpath={$ann_path}");
            header("Location: bbs0anbm.php?path={$ann_path}");
        }
    }
}
Ejemplo n.º 2
0
 /**
  * function manage set article flag
  *
  * @param int $op
  *     0: do nth;
  *     1: del;
  *     2: mark;
  *     3: digest;
  *     4: noreplay;
  *     5: zhiding;
  *     7-9: % X #
  */
 public function manage($op, $top = false)
 {
     $code = null;
     $ret = bbs_bmmanage($this->_board->NAME, $this->ID, $op, $top ? 1 : 0);
     switch ($ret) {
         case -1:
             $code = ECode::$BOARD_NONE;
             break;
         case -2:
             $code = ECode::$ARTICLE_NOMANAGE;
             break;
         case -3:
         case -9:
             $code = ECode::$SYS_ERROR;
             break;
         case -4:
             $code = ECode::$ARTICLE_NONE;
             break;
         default:
             break;
     }
     if (!is_null($code)) {
         throw new ArticleManageException($code);
     }
     if ($top || $op == 5) {
         touch('boards/' . $this->_board->NAME . '/.DIR');
     }
 }