• 목록
  • 아래로
  • 위로

그누보드 5에 php 7.4쓰고있습니다

 

<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$c_list = array();

$c_is_admin = $is_admin;

$c_is_comment_write = false;
if ($member['mb_level'] >= $board['bo_comment_level'])
    $c_is_comment_write = true;

// 코멘트 출력
//$sql = " select * from {$write_table} where wr_parent = '{$list[$i][wr_id]}' and wr_is_comment = 1 order by wr_comment desc, wr_comment_reply ";
$sql = " select * from $write_table where wr_parent = '{$list[$i][wr_id]}' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";

$result = sql_query($sql);
for ($c_i=0; $row=sql_fetch_array($result); $c_i++)
{
    $c_list[$c_i] = $row;

    //$c_list[$c_i]['name'] = get_sideview($row['mb_id'], cut_str($row['wr_name'], 20, ''), $row['wr_email'], $row['wr_homepage']);

    $tmp_name = get_text(cut_str($row['wr_name'], $config['cf_cut_name'])); // 설정된 자리수 만큼만 이름 출력
    
    if($row['mb_id'] == "admin") {
        $tmp_name = "<img src='".G5_DATA_URL."/member/ico_admin.png"."' />";
    }

    if ($board['bo_use_sideview'])
        $c_list[$c_i]['name'] = get_sideview($row['mb_id'], $tmp_name, $row['wr_email'], $row['wr_homepage']);
    else
        $c_list[$c_i]['name'] = '<span class="'.($row['mb_id']?'member':'guest').'">'.$tmp_name.'</span>';

    // 공백없이 연속 입력한 문자 자르기 (way 보드 참고. way.co.kr)
    //$c_list[$c_i]['content'] = eregi_replace("[^ \n<>]{130}", "\\0\n", $row['wr_content']);

    $c_list[$c_i]['content'] = $c_list[$c_i]['content1']= '비밀글 입니다.';
    if (!strstr($row['wr_option'], 'secret') ||
        $c_is_admin ||
        ($list[$i]['mb_id']==$member['mb_id'] && $member['mb_id']) ||
        ($row['mb_id']==$member['mb_id'] && $member['mb_id'])) {
        $c_list[$c_i]['content1'] = $row['wr_content'];
        $c_list[$c_i]['content'] = conv_content($row['wr_content'], 0, 'wr_content');
        $c_list[$c_i]['content'] = search_font($stx, $c_list[$c_i]['content']);
    } else {
        $ss_name = 'ss_secret_comment_'.$bo_table.'_'.$c_list[$c_i]['wr_id'];

        if(!get_session($ss_name))
            $c_list[$c_i]['content'] = '<a href="/password.php?w=sc&amp;bo_table='.$bo_table.'&amp;wr_id='.$c_list[$c_i]['wr_id'].$qstr.'" class="s_cmt">댓글내용 확인</a>';
        else {
            $c_list[$c_i]['content'] = conv_content($row['wr_content'], 0, 'wr_content');
            $c_list[$c_i]['content'] = search_font($stx, $c_list[$c_i]['content']);
        }
    }

    $c_list[$c_i]['datetime'] = substr($row['wr_datetime'],2,14);

    // 관리자가 아니라면 중간 IP 주소를 감춘후 보여줍니다.
    $c_list[$c_i]['ip'] = $row['wr_ip'];
    if (!$c_is_admin)
        $c_list[$c_i]['ip'] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $row['wr_ip']);

    $c_list[$c_i]['is_reply'] = false;
    $c_list[$c_i]['is_edit'] = false;
    $c_list[$c_i]['is_del']  = false;
    if ($c_is_comment_write || $c_is_admin)
    {
        if ($member['mb_id'])
        {
            if ($row['mb_id'] == $member['mb_id'] || $c_is_admin)
            {
                $c_list[$c_i]['del_link']  = './delete_comment.php?bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;token='.$token.'&amp;page='.$page.$qstr;
                $c_list[$c_i]['is_edit']   = true;
                $c_list[$c_i]['is_del']    = true;
            }
        }
        else
        {
            if (!$row['mb_id']) {
                $c_list[$c_i]['del_link'] = './password.php?w=x&amp;bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;page='.$page.$qstr;
                $c_list[$c_i]['is_del']   = true;
            }
        }

        if (strlen($row['wr_comment_reply']) < 5)
            $c_list[$c_i]['is_reply'] = true;
    }

    // 05.05.22
    // 답변있는 코멘트는 수정, 삭제 불가
    if ($c_i > 0 && !$c_is_admin)
    {
        if ($row['wr_comment_reply'])
        {
            $tmp_comment_reply = substr($row['wr_comment_reply'], 0, strlen($row['wr_comment_reply']) - 1);
            if ($tmp_comment_reply == $c_list[$c_i-1]['wr_comment_reply'])
            {
                $c_list[$c_i-1]['is_edit'] = false;
                $c_list[$c_i-1]['is_del'] = false;
            }
        }
    }
}

//  코멘트수 제한 설정값
if ($c_is_admin)
{
    $comment_min = $comment_max = 0;
}
else
{
    $comment_min = (int)$board['bo_comment_min'];
    $comment_max = (int)$board['bo_comment_max'];
}

include($board_skin_path.'/view_comment.skin.php');

if (!$member['mb_id']) // 비회원일 경우에만
    echo '<script src="'.G5_JS_URL.'/md5.js"></script>'."\n";
?>
 

뷰코멘트 코드전문입니다... 자꾸 엉뚱한것만 지우고 수정 하는 제가 너무 답답하네요 도움 부탁드립니다 ㅜㅜ

댓글 2

NoYeah
profile image
이걸 직접 수정해야 하나요?
그누보드에도 권한 부분이 있을 텐데 관리자 설정에서 댓글을 모두 보기로 바꾸면 되지 않나요?
comment menu
2020.09.21. 12:11

신고

"NoYeah님의 댓글"

이 댓글을 신고 하시겠습니까?

손가락개 작성자 → NoYeah
profile image
댓글 권한을 전부 비회원 1로 설정해도 안보입니다 ... 작성도 그렇지만 댓글 다는 창 자체를 비회원이면 안보이게 설정된거라 그런거 같더라구요 ...
comment menu
2020.09.21. 15:46

신고

"손가락개님의 댓글"

이 댓글을 신고 하시겠습니까?

권한이 없습니다.
번호 제목 글쓴이 날짜 조회 수
공지 시스템 점검 작업 완료 안내 10 마스터 6일 전16:25 222
공지 [중요] 호스팅 만료와 관련하여 일부 수칙이 변경됩니다. 4 마스터 23.01.14.02:23 7283
공지 [필독] 질문하는 방법 17 마스터 18.02.23.03:09 4771
406 아이폰8+ 네비 사용시 발열(?) 문제에 대한 해결책을 여쭤봅니다 10 이니스프리 19.01.26.18:25 1212
405 일본어 '도키도키'의 뜻을 어떻게 해석해야 하나요? 11 이니스프리 19.01.26.19:16 2945
404 라엘 님의 이미지 캐시 서버 구축하기와 관련하여 구체적인 방법을 여쭤봅니다 4 이니스프리 19.01.27.13:59 271
403 미국 간편식 추천 부탁드립니다 14 이니스프리 19.01.29.10:42 347
402 하천 복개 공사가 서버에 영향을 미칠까요? 4 image 이니스프리 19.02.09.22:42 231
401 [Python 질문] 재귀함수의 알고리즘이 잘 이해가 되지 않습니다. 13 NoYeah 19.02.09.23:21 504
400 SQL문을 PHP에서 실행시켰는데 안되네요 7 260578 19.02.11.15:59 306
399 라이믹스 ckeditor4 2 image title: 크롬NUBE 19.02.13.22:41 302
398 TXT레코드 관련 도와주세[요! 7 image AA 19.02.14.23:21 260
397 그누보드 5 설치 오류 도와주세요 3 image 김호창 19.02.15.16:19 2238
396 앱에서의 MIT라이센스 표시 관련하여 질문합니다. 4 title: 에그joyful 19.02.19.15:18 499
395 흠.. 여기가 빠른 답변이 가능할까요? 3 워시퍼 19.02.26.15:21 228
394 Ping 유무 html로 표현 6 image 사나이 19.03.10.22:08 688
393 실시간 검색어 파싱에 ajax를 적용했는데 캐싱을 할 수 있는 방법이 어떤 것이 있을지 여쭤봅니다 4 image 이니스프리 19.03.12.12:42 356
392 공유폴더가 안됩니다 원인을 알고싶습니다.. 4 image calm 19.03.19.20:12 357
391 스포어 메일 연결해서 쓰시는분 있으신가요? 6 샹키 19.03.22.17:43 219
390 태블릿을 컴퓨터 키보드로 사용할 수 있는 앱 추천 부탁드립니다. 이니스프리 19.03.29.18:31 238
389 맥북의 팬리스 여부가 정리된 웹페이지를 추천 부탁드립니다 ^^ 4 이니스프리 19.03.31.10:49 329
388 Linux 시스템 보안에서 실무 등에서는 어떤 보안 솔류숀을 사용하는지 궁금해요 1 Seia 19.04.05.23:00 232
387 드롭다운 메뉴의 아이콘에 배경색이 칠해지지 않아요 6 image 국내산라이츄 19.04.07.03:29 299