안녕하세요 댓글 작성자 ip보이기가 몇일전부터 안되네여

add_action('kboard_comments_field', 'my_kboard_comments_field', 10, 4);
function my_kboard_comments_field($field_html, $board, $content_uid, $commentBuilder){
	?>
	<input type="hidden" name="comment_option_ip" value="<?php echo kboard_user_ip()?>">
	<?php
}

얼마전 k보드 업데이트 이후 댓글 작성자 아이피 보기가 몇일전부터 안되고 있습니다.

 

지금 적용한 코드는 상위에 올려놨습니다.

저렇게 하니까 모든 게시판에 적용이 되서 사용하고 있었거든요 혹시 뭔가 문제가 있을까요?

지금 댓글 버전은 4.9 이고

케이보드는 5.9.2 입니다.

 

 

좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
  • 안녕하세요~^^

    올려주신 코드는 댓글에 아이피 정보를 저장하는 코드입니다.

    실제 표시가 되게 하시려면 댓글 스킨 쪽 파일을 수정해주셔야 합니다.

    이전에 비슷한 문의를 하셨었는데요.

    아래 링크를 참고해보시겠어요?

    https://www.cosmosfarm.com/threads/document/37543

    고맙습니다.

  • 링크를 참고 했는데요

    <?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)?>
    <?php if($board->isAdmin() && $comment->option->ip):?>(<?php echo $comment->option->ip?>)<?php endif?>

    이코드를 찾을수 없는데 

    한번 봐주시겠습니까?

     

    <div class="comments-list">
    	<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?>">
    			<div class="comments-list-username" itemprop="author">
    				<?php echo $comment->getUserDisplay()?>
    			</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 wpautop($comment->content)?>
    					
    					<?php if(isset($comment->attach->image1)):?>
    						<p class="comments-list-image1"><img src="<?php echo esc_url(site_url($comment->attach->image1[0]))?>" alt="<?php echo esc_attr($comment->attach->image1[1])?>"></p>
    					<?php endif?>
    					
    					<?php if(isset($comment->attach->file1)):?>
    						<p class="comments-list-file1"><?php echo __('Attachment', 'kboard-comments')?> : <a href="<?php echo $comment->attach->file1[2]?>" title="<?php echo __('Download', 'kboard-comments')?>"><?php echo $comment->attach->file1[1]?></a></p>
    					<?php endif?>
    				<?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>
    					<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>
    					<?php elseif($comment->password && !is_user_logged_in()):?>
    					<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>
    					<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>
    					<?php endif?>
    					<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?>', '<?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 $commentBuilder->buildTreeList('list-template.php', $comment->uid, $depth+1)?>
    			<!-- 답글 리스트 끝 -->
    			
    			<!-- 댓글 입력 폼 시작 -->
    			<form id="kboard-comment-reply-form-<?php echo $comment->uid?>" method="post" action="<?php echo $commentURL->getInsertURL()?>" class="comments-reply-form" enctype="multipart/form-data" 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>

     

     

    아참 그리고 댓글에 이미지 파일 첨부 못하게 하고 싶은데 이건 어떻게 해야 하나요?

  • KBoard 플러그인이 업데이트되면서 코드도 조금 바뀌었습니다.

    기존 kboard_user_display 필터 쪽 대신

    아래의 코드를 확인해주세요.

    <?php echo $comment->getUserDisplay()?>

     

    댓글 쪽의 사진, 첨부파일 필드를 안 보이게 하는 건

    아래 관련 링크를 참고 부탁드립니다.

    https://www.cosmosfarm.com/threads/document/29289

    고맙습니다.

  • 감사합니다 항상 코로나 감기 주의하시기 바랍니다 ^_^

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