덧글에 ip 노출

http://www.cosmosfarm.com/threads/document/6668

위 링크 참고로

KBCommentList.class.php 파일

public function add($parent_uid, $user_uid, $user_display, $content, $password=''){
        global $wpdb;
        $content_uid = $this->content_uid;
        $parent_uid = intval($parent_uid);
        $user_uid = intval($user_uid);
        $user_display = addslashes(kboard_xssfilter(kboard_htmlclear(trim($user_display))));
        $content = addslashes(trim($content));
        $password = addslashes(kboard_xssfilter(kboard_htmlclear(trim($password))));
        $created = current_time('YmdHis');
        $ip = $_SERVER['REMOTE_ADDR'];
        
        $wpdb->query("INSERT INTO `{$wpdb->prefix}kboard_comments` (`content_uid`, `parent_uid`, `user_uid`, `user_display`, `content`, `created`, `password`, 'ip') VALUE ('$content_uid', '$parent_uid', '$user_uid', '$user_display', '$content', '$created', '$password', '$ip')");

 

index.php

function kboard_comments_activation_execute(){
    global $wpdb;
    
    $wpdb->query("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}kboard_comments` (
        `uid` bigint(20) unsigned NOT NULL auto_increment,
        `content_uid` bigint(20) unsigned NOT NULL,
        `parent_uid` bigint(20) unsigned default NULL,
        `user_uid` bigint(20) unsigned default NULL,
        `user_display` varchar(127) default NULL,
        `content` longtext NOT NULL,
        `created` char(14) NOT NULL,
        `password` varchar(127) default NULL,
        `ip` varchar(127) default NULL,

 

list-template.php

 

<div class="comments-list-username" itemprop="author"><?php echo $comment->user_display?></div>
            <div class="comments-list-create" itemprop="dateCreated"><?php echo date("Y-m-d H:i", strtotime($comment->created))?></div>
            <div class="comments-list-ip" itemprop="ip"><?php echo $comment->ip?></div>

 

위와 같이 추가해 봤습니다

그리고 <?php print_r($comment)?> 넣어서 테스트 했는데 아이피값이 보이지 않습니다

어딜 수정해야 할지 알수있을까요?

감사합니다

 

 

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