public function single_row($item)
 {
     echo '<tr data-uid="' . $item->uid . '">';
     echo '<th scope="row" class="check-column">';
     echo '<input type="checkbox" name="uid[]" value="' . $item->uid . '">';
     echo '</th>';
     echo '<td class="kboard-content-list-board">';
     if ($item->board_id) {
         echo '<select class="kboard-id-select" name="board_id_' . $item->uid . '">';
         while ($this->board->hasNext()) {
             echo '<option value="' . $this->board->uid . '"' . ($item->board_id == $this->board->uid ? ' selected' : '') . '>' . $this->board->board_name . '</option>';
         }
         echo '</select>';
     } else {
         echo '답글입니다.';
     }
     echo '</td>';
     echo '<td class="kboard-content-list-title">';
     $url = new KBUrl();
     echo '<h4>' . mb_strimwidth(strip_tags($item->title), 0, 300, '...', 'UTF-8') . '</h4>';
     echo '<span class="row-actions"><span class="edit"> | <a href="' . $url->getDocumentRedirect($item->uid) . '" onclick="window.open(this.href);return false;">새창열기</a></span></span>';
     echo '<p>' . mb_strimwidth(strip_tags($item->content), 0, 300, '...', 'UTF-8') . '</p>';
     echo '</td>';
     echo '<td>';
     if ($item->member_uid) {
         echo '<a href="' . admin_url('/user-edit.php?user_id=' . $item->member_uid) . '">';
     }
     echo $item->member_display;
     if ($item->member_uid) {
         echo '</a>';
     }
     echo '</td>';
     echo '<td>';
     echo $item->view;
     echo '</td>';
     echo '<td>';
     echo $item->secret ? '예' : '아니오';
     echo '</td>';
     echo '<td>';
     echo $item->notice ? '예' : '아니오';
     echo '</td>';
     echo '<td>';
     echo date('Y-m-d H:i:s', strtotime($item->date));
     echo '</td>';
     echo '</tr>';
 }
Exemplo n.º 2
0
/kboard/rss.php</link>
		<description><?php 
echo __('WordPress KBoard feed', 'kboard');
?>
</description>
		<?php 
while ($content = $list->hasNext()) {
    $kboard = new KBoard($content->board_id);
    ?>
		<item>
			<title><![CDATA[<?php 
    echo $content->title;
    ?>
]]></title>
			<link><![CDATA[<?php 
    echo $url->getDocumentRedirect($content->uid);
    ?>
]]></link>
			<description><![CDATA[<?php 
    echo $content->content;
    ?>
]]></description>
			<author><![CDATA[<?php 
    echo $content->member_display;
    ?>
]]></author>
			<pubDate><?php 
    echo gmdate(DATE_RSS, strtotime($content->date));
    ?>
</pubDate>
			<category domain="<?php 
Exemplo n.º 3
0
 /**
  * 게시글을 등록/수정한다.
  */
 public function execute()
 {
     $this->parent_uid = isset($_POST['parent_uid']) ? intval($_POST['parent_uid']) : 0;
     $this->member_uid = isset($_POST['member_uid']) ? intval($_POST['member_uid']) : 0;
     $this->member_display = isset($_POST['member_display']) ? kboard_xssfilter(kboard_htmlclear(trim($_POST['member_display']))) : '';
     $this->title = isset($_POST['title']) ? kboard_xssfilter(kboard_htmlclear(trim($_POST['title']))) : '';
     $this->content = isset($_POST['kboard_content']) ? kboard_safeiframe(kboard_xssfilter(trim($_POST['kboard_content']))) : '';
     $this->date = isset($_POST['date']) ? kboard_xssfilter(kboard_htmlclear(trim($_POST['date']))) : '';
     $this->category1 = isset($_POST['category1']) ? kboard_xssfilter(kboard_htmlclear(trim($_POST['category1']))) : '';
     $this->category2 = isset($_POST['category2']) ? kboard_xssfilter(kboard_htmlclear(trim($_POST['category2']))) : '';
     $this->secret = isset($_POST['secret']) ? kboard_xssfilter(kboard_htmlclear(trim($_POST['secret']))) : '';
     $this->notice = isset($_POST['notice']) ? kboard_xssfilter(kboard_htmlclear(trim($_POST['notice']))) : '';
     $this->search = isset($_POST['wordpress_search']) ? intval($this->secret && $_POST['wordpress_search'] == 1 ? '2' : $_POST['wordpress_search']) : '3';
     $this->password = isset($_POST['password']) ? kboard_xssfilter(kboard_htmlclear(trim($_POST['password']))) : '';
     if ($this->uid && $this->date) {
         // 기존게시물 업데이트
         $this->updateContent();
         $this->setThumbnail($this->uid);
         $this->update_options($this->uid);
         $this->update_attach($this->uid);
         /*
          * 게시글 수정 액션 훅 실행
          */
         do_action('kboard_document_update', $this->uid, $this->board_id);
         return $this->uid;
     } else {
         if (!$this->uid && $this->title) {
             // captcha 코드 확인
             include_once 'KBCaptcha.class.php';
             $captcha = new KBCaptcha();
             $captcha_text = isset($_POST['captcha']) ? $_POST['captcha'] : '';
             if (!$captcha->textCheck($captcha_text)) {
                 die("<script>alert('" . __('The CAPTCHA code is not valid. Please enter the CAPTCHA code.', 'kboard') . "');history.go(-1);</script>");
             }
             // 신규게시물 등록
             $uid = $this->insertContent();
             if ($uid) {
                 $this->setThumbnail($uid);
                 $this->update_options($uid);
                 $this->update_attach($uid);
                 // 게시판 설정에 알림 이메일이 설정되어 있으면 메일을 보낸다.
                 $meta = new KBoardMeta($this->board_id);
                 if ($meta->latest_alerts) {
                     /*
                      * http://www.cosmosfarm.com/threads/document/3025
                      * 메일 제목에 게시글이 등록된 게시판 이름 추가해서 보낸다.
                      */
                     $board = new KBoard();
                     $board->setID($this->board_id);
                     $url = new KBUrl();
                     include_once 'KBMail.class.php';
                     $mail = new KBMail();
                     $mail->to = explode(',', $meta->latest_alerts);
                     $mail->title = '[' . __('KBoard new document', 'kboard') . '] ' . $board->board_name . ' - ' . $this->title;
                     $mail->content = $this->content;
                     $mail->url = $url->getDocumentRedirect($uid);
                     $mail->send();
                 }
                 /*
                  * 게시글 입력 액션 훅 실행
                  */
                 do_action('kboard_document_insert', $uid, $this->board_id);
             }
             return $uid;
         }
     }
     return '';
 }