예제 #1
0
 /**
  * 게시글을 등록 한다.
  */
 public function write($board_id, $data, $type)
 {
     $status = false;
     $entry_id = parent::writeEntry($board_id, $data, $type);
     if ($entry_id != false || !is_wp_error($entry_id)) {
         $status = $this->updateChanger($board_id, $entry_id);
     }
     return $status;
 }
<?php

if (isset($_POST['entry_title'])) {
    $entry_title = sanitize_text_field($_POST['entry_title']);
} else {
    $entry_title = null;
}
if ($entry_title) {
    $Board = new kkbController();
    $Board->writeEntry($board_id, $_POST, 'admin');
}
$current_user = wp_get_current_user();
$hour_options = null;
$minute_options = null;
$second_options = null;
for ($i = 0; $i < 24; $i++) {
    if ($i == date('H', current_time('timestamp', 0))) {
        $hour_options .= '<option selected>' . $i . '</option>';
    } else {
        $hour_options .= '<option>' . $i . '</option>';
    }
}
for ($i = 0; $i < 60; $i++) {
    if ($i == date('i', current_time('timestamp', 0))) {
        $minute_options .= '<option selected>' . $i . '</option>';
    } else {
        $minute_options .= '<option>' . $i . '</option>';
    }
}
for ($i = 0; $i < 60; $i++) {
    if ($i == date('s', current_time('timestamp', 0))) {
예제 #3
0
    $return_args['kkb_mod'] = 'iframe';
}
$return_path = add_query_arg($return_args, get_the_permalink($post_id));
if (isset($_POST['g-recaptcha-response'])) {
    $cpt_response = sanitize_text_field($_POST['g-recaptcha-response']);
    $response = kingkongboard_captcha_initialize($board_id, $cpt_response);
} else {
    $response = true;
}
if ($response == false) {
    $result['status'] = 'failed';
    $result['message'] = __('자동글 방지에 체크하셔야 합니다.', 'kingkongboard');
} else {
    $Board = new kkbController();
    if ($_POST['write_type'] == 'write' || $_POST['write_type'] == 'reply') {
        $entry_id = $Board->writeEntry($board_id, $_POST, 'basic');
        if ($entry_id && is_numeric($entry_id)) {
            $upload = $Board->fileUploader($entry_id, $_POST, $_FILES);
            if ($upload) {
                if (is_array($upload)) {
                    $message = $upload['message'];
                    $result['status'] = 'failed';
                    $result['message'] = $message;
                } else {
                    $result['status'] = 'success';
                    $result['url'] = get_the_permalink($post_id);
                }
            } else {
                $result['status'] = 'success';
                $result['url'] = get_the_permalink($post_id);
            }