댓글 본인만보기 적용관련 문의드립니다.

안녕하세요 언제나 고생많으십니다.

댓글을 본인만 보게 하고싶어서,
설정에 댓글보기권한에서 본인 댓글만 보기를 선택을해도
변함이 없기에(이부분 체크 부탁드릴게요ㅠ) 

우선 검색을해서 아래와같이 변경을 하였습니다.

/wp-content/plugins/kboard-comments/skin/default/list-template.php 파일에


<div class="comments-list-content" itemprop="description">
    <?php echo nl2br($comment->content)?>
</div>


이부분을


<?php
$content = new KBContent();
$content->initWithUID($content_uid);
?>
<?php if($comment->user_uid == get_current_user_id() || $content->member_uid == get_current_user_id() || $board->isAdmin()):?>
    <?php echo nl2br($comment->content)?>
<?php else:?>
    본인만 확인할 수 있습니다.
<?php endif?>
</div>


이렇게 변경을하였습니다
근데 댓글내용만을 가려주는방식이라

혹시 리스트 본인만 보기처럼
다른 댓글등록자 아이디나 날짜등
아예 다른이에 글이 나오지 않도록 할수는 없을까요ㅠㅠ

 

추가. 모바일쪽에서 코스모스팜에 접속하면 검색을 할수가없던거같은데ㅠ
모바일에서도 코스모스팜 검색할수있는 방법이 있을까요?ㅠ

워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
  • 안녕하세요~^^

    아래의 코드를 적용해보시겠어요?

    <div class="comments-list">
    	<?php
    	$content = new KBContent();
    	$content->initWithUID($content_uid);
    	?>
    	<ul>
    		<?php while($comment = $commentList->hasNext()): $commentURL->setCommentUID($comment->uid);?>
    		<li itemscope itemtype="http://schema.org/Comment" class="kboard-comments-item" data-username="<?php echo $comment->user_display?>" data-created="<?php echo $comment->created?>">
    			<?php if($comment->user_uid == get_current_user_id() || $content->member_uid == get_current_user_id() || $board->isAdmin()):?>
    			<div class="comments-list-username" itemprop="author">
    				<?php echo apply_filters('kboard_user_display', get_avatar($comment->user_uid, 24, '', $comment->user_display).' '.$comment->user_display, $comment->user_uid, $comment->user_display, 'kboard-comments', $commentBuilder)?>
    			</div>
    			<div class="comments-list-create" itemprop="dateCreated"><?php echo date('Y-m-d H:i', strtotime($comment->created))?></div>
    			<div class="comments-list-content" itemprop="description">
    				<?php if($comment->isReader()):?>
    					<?php echo nl2br($comment->content)?>
    				<?php else:?>
    					<?php if($comment->remaining_time_for_reading):?>
    						<div class="remaining_time_for_reading"><?php echo sprintf(__('You can read comments after %d minutes. <a href="%s">Login</a> and you can read it right away.', 'kboard-comments'), round($comment->remaining_time_for_reading/60), wp_login_url($_SERVER['REQUEST_URI']))?></div>
    					<?php elseif($comment->login_is_required_for_reading):?>
    						<div class="login_is_required_for_reading"><?php echo sprintf(__('You do not have permission to read this comment. Please <a href="%s">login</a>.', 'kboard-comments'), wp_login_url($_SERVER['REQUEST_URI']))?></div>
    					<?php else:?>
    						<div class="you_do_not_have_permission"><?php echo __('You do not have permission to read this comment.', 'kboard-comments')?></div>
    					<?php endif?>
    				<?php endif?>
    			</div>
    			
    			<div class="comments-list-controller">
    				<?php if($commentBuilder->isWriter()):?>
    				<div class="left">
    					<?php if($comment->isEditor()):?>
    					<button type="button" class="comments-button-action comments-button-delete" onclick="kboard_comments_delete('<?php echo $commentURL->getDeleteURL()?>');" title="<?php echo __('Delete', 'kboard-comments')?>"><?php echo __('Delete', 'kboard-comments')?></button>
    					<?php else:?>
    					<button type="button" class="comments-button-action comments-button-delete" onclick="kboard_comments_open_confirm('<?php echo $commentURL->getConfirmURL()?>');" title="<?php echo __('Delete', 'kboard-comments')?>"><?php echo __('Delete', 'kboard-comments')?></button>
    					<?php endif?>
    					<button type="button" class="comments-button-action comments-button-edit" onclick="kboard_comments_open_edit('<?php echo $commentURL->getEditURL()?>');" title="<?php echo __('Edit', 'kboard-comments')?>"><?php echo __('Edit', 'kboard-comments')?></button>
    					<button type="button" class="comments-button-action comments-button-reply kboard-reply" onclick="kboard_comments_reply(this, '#kboard-comment-reply-form-<?php echo $comment->uid?>', '#kboard-comments-form-<?php echo $content_uid?>');" title="<?php echo __('Reply', 'kboard-comments')?>"><?php echo __('Reply', 'kboard-comments')?></button>
    				</div>
    				<?php endif?>
    				
    				<div class="right">
    					<button type="button" class="comments-button-action comments-button-like" onclick="kboard_comment_like(this)" data-uid="<?php echo $comment->uid?>" title="<?php echo __('Like', 'kboard-comments')?>"><?php echo __('Like', 'kboard-comments')?> <span class="kboard-comment-like-count"><?php echo intval($comment->like)?></span></button>
    					<button type="button" class="comments-button-action comments-button-unlike" onclick="kboard_comment_unlike(this)" data-uid="<?php echo $comment->uid?>" title="<?php echo __('Unlike', 'kboard-comments')?>"><?php echo __('Unlike', 'kboard-comments')?> <span class="kboard-comment-unlike-count"><?php echo intval($comment->unlike)?></span></button>
    				</div>
    			</div>
    			
    			<hr>
    			<?php endif?>
    			
    			<!-- 답글 리스트 시작 -->
    			<?php $commentBuilder->buildTreeList('list-template.php', $comment->uid, $depth+1)?>
    			<!-- 답글 리스트 끝 -->
    			
    			<!-- 댓글 입력 폼 시작 -->
    			<form action="<?php echo $commentURL->getInsertURL()?>" method="post" id="kboard-comment-reply-form-<?php echo $comment->uid?>" class="comments-reply-form" onsubmit="return kboard_comments_execute(this);">
    				<input type="hidden" name="content_uid" value="<?php echo $comment->content_uid?>">
    				<input type="hidden" name="parent_uid" value="<?php echo $comment->uid?>">
    				<input type="hidden" name="member_uid" value="<?php echo $member_uid?>">
    			</form>
    			<!-- 댓글 입력 폼 끝 -->
    		</li>
    		<?php endwhile?>
    	</ul>
    </div>

     

    모바일에서도 코스모스팜 사이트에서 검색을 할 수 있도록 하겠습니다.

    모바일에서 어느 위치에 검색 입력 폼이 있으면 편하게 검색하실 수 있을지 알려주시면 반영하도록 하겠습니다.

    고맙습니다.

좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기