Example #1
0
 /**
  * function manage set threads flag
  *
  * @param int $op
  *     0 - nothing
  *     1 - delete
  *     2 - mark
  *     3 - unmark
  *     4 - del X records
  *     5 - put to announce
  *     6 - set X flag
  *     7 - unset X flag
  *     8 - no reply
  *     9 - cancel no reply
  */
 public function manage($op, $start = null)
 {
     $s = $this->FIRST->ID;
     if (null !== $start) {
         foreach ($this->_articles as $v) {
             if ($start == $v->ID) {
                 $s = $start;
                 break;
             }
         }
     }
     $code = null;
     $ret = bbs_threads_bmfunc($this->_board->BID, $this->GROUPID, $s, $op);
     switch ($ret) {
         case -1:
             $code = ECode::$BOARD_NONE;
             break;
         case -2:
             $code = ECode::$ARTICLE_NOMANAGE;
             break;
         case -3:
         case -10:
             $code = ECode::$SYS_ERROR;
             break;
         default:
             break;
     }
     if (!is_null($code)) {
         throw new ThreadsManageException($code);
     }
     return $ret;
 }
Example #2
0
if (isset($_GET["gid"])) {
    $gid = $_GET["gid"];
} else {
    html_error_quit("错误的参数");
}
if (isset($_GET["start"])) {
    $start = $_GET["start"];
} else {
    html_error_quit("错误的参数");
}
if (isset($_POST["operate"])) {
    $operate = $_POST["operate"];
    if ($operate == 99) {
        html_error_quit("系统错误");
    }
    $ret = bbs_threads_bmfunc($bid, $gid, $start, $operate);
    if ($ret >= 0) {
        if ($operate == 5) {
            $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}");
            }
        } else {
            html_success_quit("操作成功, {$ret} 条记录被修改。");
        }
    } else {