コード例 #1
0
ファイル: index.php プロジェクト: newmight2015/psmpsm
 function kboard_comments_list()
 {
     kboard_comments_system_update();
     $commentList = new KBCommentList();
     $action = $_POST['action'];
     $action2 = $_POST['action2'];
     if (($action == 'remove' || $action2 == 'remove') && $_POST['comment_uid']) {
         foreach ($_POST['comment_uid'] as $key => $value) {
             $commentList->delete($value);
         }
     }
     $commentList->order = 'DESC';
     $commentList->init();
     include_once 'pages/comments_list.php';
 }
コード例 #2
0
 /**
  * 댓글 리스트 트리를 생성한다.
  * @param string $template
  * @param int $parent_uid
  */
 public function buildTreeList($template, $parent_uid = '')
 {
     global $user_ID;
     $userdata = get_userdata($user_ID);
     $content_uid = $this->content_uid;
     $skin_path = $this->skin_path;
     $commentURL = new KBCommentUrl();
     $commentList = new KBCommentList();
     $commentBuilder = $this;
     if ($parent_uid) {
         $commentList->initWithParentUID($parent_uid);
     } else {
         $commentList->initWithUID($this->content_uid);
     }
     include KBOARD_COMMENTS_DIR_PATH . "/skin/{$this->skin}/{$template}";
 }
コード例 #3
0
 /**
  * 댓글 리스트 트리를 생성한다.
  * @param string $template
  * @param int $parent_uid
  */
 public function buildTreeList($template, $parent_uid = '')
 {
     global $user_ID;
     $userdata = $user_ID ? get_userdata($user_ID) : new stdClass();
     $content_uid = $this->content_uid;
     $skin_path = $this->skin_path;
     $commentURL = new KBCommentUrl();
     $commentList = new KBCommentList();
     $commentBuilder = $this;
     $member_uid = isset($userdata->ID) ? $userdata->ID : '';
     $member_display = isset($userdata->display_name) ? $userdata->display_name : '';
     if ($parent_uid) {
         $commentList->initWithParentUID($parent_uid);
     } else {
         $commentList->initWithUID($this->content_uid);
     }
     include KBOARD_COMMENTS_DIR_PATH . "/skin/{$this->skin}/{$template}";
 }
コード例 #4
0
ファイル: confirm.php プロジェクト: newmight2015/psmpsm
<?php

list($path) = explode(DIRECTORY_SEPARATOR . 'wp-content', dirname(__FILE__) . DIRECTORY_SEPARATOR);
include $path . DIRECTORY_SEPARATOR . 'wp-load.php';
$uid = intval($_GET['uid']);
if (!$uid) {
    die("<script>alert('" . __('No UID of comments.', 'kboard-comments') . "');window.close();</script>");
}
$commentList = new KBCommentList();
$comment = $commentList->getComment($uid);
if (!$comment->uid) {
    die("<script>alert('" . __('It is a comment does not exist.', 'kboard-comments') . "');window.close();</script>");
}
?>
<!DOCTYPE html>
<html lang="ko">
<head>
	<meta charset="UTF-8">
	<meta name="author" content="http://www.cosmosfarm.com/">
	<title>KBoard - <?php 
echo __('Password confirmation', 'kboard-comments');
?>
</title>
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
	<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
	<style>
		body { background-color: #f9f9f9; }
		label { font-size: 12px; }
		input { margin: 0; }
	</style>
	<script>
コード例 #5
0
ファイル: delete.php プロジェクト: newmight2015/psmpsm
list($path) = explode(DIRECTORY_SEPARATOR . 'wp-content', dirname(__FILE__) . DIRECTORY_SEPARATOR);
include $path . DIRECTORY_SEPARATOR . 'wp-load.php';
header("Content-Type: text/html; charset=UTF-8");
if (!stristr($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) {
    wp_die('KBoard : ' . __('This page is restricted from external access.', 'kboard-comments'));
}
$userdata = get_userdata($user_ID);
$uid = intval($_GET['uid']);
if (!$uid) {
    die("<script>alert('" . __('No UID of comments.', 'kboard-comments') . "');history.go(-1);</script>");
} else {
    if (!$userdata->id && !$_POST['password']) {
        die("<script>alert('" . __('Please Log in to continue.', 'kboard-comments') . "');history.go(-1);</script>");
    }
}
$commentList = new KBCommentList();
$comment = $commentList->getComment($uid);
if (!$comment->isEditor() && $comment->password != $_POST['password']) {
    die("<script>alert('" . __('You do not have permission.', 'kboard-comments') . "');history.go(-1);</script>");
}
$commentList->setContentUID($comment->content_uid);
$commentList->delete($uid);
if ($comment->password && $comment->password == $_POST['password']) {
    // 팝업창으로 비밀번호 확인 후 opener 윈도우를 새로고침 한다.
    echo '<script>';
    echo 'opener.window.location.reload();';
    echo 'window.close();';
    echo '</script>';
} else {
    // 삭제권한이 있는 사용자일 경우 팝업창은 없기 때문에 페이지 이동한다.
    header("Location:" . $_SERVER['HTTP_REFERER']);
コード例 #6
0
ファイル: KBContent.class.php プロジェクト: shiyoi/workplanhp
 /**
  * 게시글의 댓글 개수를 반환한다.
  * @param string $prefix
  * @param string $endfix
  * @return string
  */
 public function getCommentsCountOld($prefix = '(', $endfix = ')')
 {
     if ($this->uid && defined('KBOARD_COMMNETS_VERSION')) {
         $commentList = new KBCommentList($this->uid);
         $commentsCount = $commentList->getCount();
         if ($commentsCount) {
             return "{$prefix}{$commentsCount}{$endfix}";
         }
     }
     return '';
 }
コード例 #7
0
ファイル: insert.php プロジェクト: kimyj9501/SingMyStory
$parent_uid = isset($_POST['parent_uid']) ? intval($_POST['parent_uid']) : '';
$member_uid = isset($_POST['member_uid']) ? intval($_POST['member_uid']) : '';
if (!is_user_logged_in() && !$member_display) {
    die("<script>alert('" . __('Please enter a author.', 'kboard-comments') . "');history.go(-1);</script>");
} else {
    if (!is_user_logged_in() && !$password) {
        die("<script>alert('" . __('Please enter a password.', 'kboard-comments') . "');history.go(-1);</script>");
    } else {
        if (!$captcha->textCheck($captcha_text)) {
            die("<script>alert('" . __('The CAPTCHA code is not valid. Please enter the CAPTCHA code.', 'kboard-comments') . "');history.go(-1);</script>");
        } else {
            if (!$content_uid) {
                die("<script>alert('" . __('No document UID.', 'kboard-comments') . "');history.go(-1);</script>");
            } else {
                if (!$content) {
                    die("<script>alert('" . __('Type the content of the comment.', 'kboard-comments') . "');history.go(-1);</script>");
                }
            }
        }
    }
}
$document = new KBContent();
$document->initWithUID($content_uid);
$setting = new KBoardMeta($document->board_id);
if (!is_user_logged_in() && $setting->permission_comment_write == '1') {
    die('<script>alert("' . __('You do not have permission.', 'kboard-comments') . '");history.go(-1);</script>');
}
$commentList = new KBCommentList($content_uid);
$commentList->add($parent_uid, $member_uid, $member_display, $content, $password);
// 댓글 입력 완료 후 이전 페이지로 이동
header("Location:" . $referer);
コード例 #8
0
 /**
  * 댓글 삭제
  */
 public function delete()
 {
     global $user_ID;
     $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
     $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
     header("Content-Type: text/html; charset=UTF-8");
     if (!stristr($referer, $host)) {
         wp_die('KBoard : ' . __('This page is restricted from external access.', 'kboard-comments'));
     }
     $userdata = $user_ID ? get_userdata($user_ID) : new stdClass();
     $uid = isset($_GET['uid']) ? intval($_GET['uid']) : '';
     $password = isset($_POST['password']) ? $_POST['password'] : '';
     if (!$uid) {
         die("<script>alert('" . __('No UID of comments.', 'kboard-comments') . "');history.go(-1);</script>");
     } else {
         if ((!isset($userdata->ID) || !$userdata->ID) && !$password) {
             die("<script>alert('" . __('Please Log in to continue.', 'kboard-comments') . "');history.go(-1);</script>");
         }
     }
     $commentList = new KBCommentList();
     $comment = $commentList->getComment($uid);
     if (!$comment->isEditor() && $comment->password != $password) {
         die("<script>alert('" . __('You do not have permission.', 'kboard-comments') . "');history.go(-1);</script>");
     }
     $commentList->setContentUID($comment->content_uid);
     $commentList->delete($uid);
     if ($comment->password && $comment->password == $password) {
         // 팝업창으로 비밀번호 확인 후 opener 윈도우를 새로고침 한다.
         echo '<script>';
         echo 'opener.window.location.reload();';
         echo 'window.close();';
         echo '</script>';
     } else {
         // 삭제권한이 있는 사용자일 경우 팝업창은 없기 때문에 페이지 이동한다.
         header("Location:{$referer}");
     }
     exit;
 }
コード例 #9
0
ファイル: insert.php プロジェクト: newmight2015/psmpsm
include KBOARD_DIR_PATH . '/class/KBCaptcha.class.php';
header("Content-Type: text/html; charset=UTF-8");
if (!stristr($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) {
    wp_die('KBoard : ' . __('This page is restricted from external access.', 'kboard-comments'));
}
$userdata = get_userdata($user_ID);
$captcha = new KBCaptcha();
$content = $_POST['content'] ? $_POST['content'] : $_POST['comment_content'];
if (!$userdata->id && !$_POST['member_display']) {
    die("<script>alert('" . __('Please enter a author.', 'kboard-comments') . "');history.go(-1);</script>");
} else {
    if (!$userdata->id && !$_POST['password']) {
        die("<script>alert('" . __('Please enter a password.', 'kboard-comments') . "');history.go(-1);</script>");
    } else {
        if (!$captcha->textCheck($_POST['captcha'])) {
            die("<script>alert('" . __('The CAPTCHA code is not valid. Please enter the CAPTCHA code.', 'kboard-comments') . "');history.go(-1);</script>");
        } else {
            if (!$_POST['content_uid'] && !$_POST['parent_uid']) {
                die("<script>alert('" . __('No document UID.', 'kboard-comments') . "');history.go(-1);</script>");
            } else {
                if (!$content) {
                    die("<script>alert('" . __('Type the content of the comment.', 'kboard-comments') . "');history.go(-1);</script>");
                }
            }
        }
    }
}
$commentList = new KBCommentList($_POST['content_uid']);
$commentList->add($_POST['parent_uid'], $_POST['member_uid'], $_POST['member_display'], $content, $_POST['password']);
// 댓글 입력 완료 후 이전 페이지로 이동
header("Location:" . $_SERVER['HTTP_REFERER']);