코멘트에서요

코멘트에서요

QA

코멘트에서요

답변 1

본문

   아래가 코멘트 출력부분인데

 

 <?php
    $cmt_amt = count($list);
    for ($i=0; $i<$cmt_amt; $i++) {
        $comment_id = $list[$i]['wr_id'];
        $cmt_depth = strlen($list[$i]['wr_comment_reply']) * 50;
        $comment = $list[$i]['content'];
        /*
        if (strstr($list[$i]['wr_option'], "secret")) {
            $str = $str;
        }
        */
        $comment = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $comment);
        $cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
     ?>

 

상단 소스중 빨간색부분이 코멘트출력내용부분입니다..

이부분을 회원에게는 보여주고 비회원에게는 로그인후 확인가능합니다. 라고 표현해주고 싶은데 이럴땐 어찌해야할지 소스부탁드립니다.

 

몇일전에 질문을 잘못올려서 답변주신분이 있는데 감사한데 못써먹엇네요 ㅠㅠ

이 질문에 댓글 쓰기 :

답변 1


<?php
    $cmt_amt = count($list);
    for ($i=0; $i<$cmt_amt; $i++) {
        $comment_id = $list[$i]['wr_id'];
        $cmt_depth = strlen($list[$i]['wr_comment_reply']) * 50;
        if ($is_member)
            $comment = $list[$i]['content'];
        else 
            $comment="로그인 후 확인가능합니다";

        /*
        if (strstr($list[$i]['wr_option'], "secret")) {
            $str = $str;
        }
        */
        $comment = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $comment);
        $cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
 ?>

이렇게 해보세요~

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 91
© SIRSOFT
현재 페이지 제일 처음으로