• 목록
  • 아래로
  • 위로

그누보드 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

신고

"손가락개님의 댓글"

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

권한이 없습니다.
번호 제목 글쓴이 날짜 조회 수
공지 [1차 해결 및 추가] 서버 접속 불가 문제 안내 12 마스터 24.06.20.15:22 455
공지 [작업 완료] 설 명절 맞이 서버 업데이트 안내 3 마스터 24.02.11.17:21 2492
공지 [중요] 호스팅 만료와 관련하여 일부 수칙이 변경됩니다. 4 마스터 23.01.14.02:23 6171
공지 [필독] 질문하는 방법 17 마스터 18.02.23.03:09 4621
306 파이썬에서 requests.Session()에 대한 간단한 질문을 드립니다 ^^ 2 이니스프리 19.11.09.21:45 1971
305 [SSD] Micron 1100 vs Samsung 860 QVO 어떻게 생각하시는가요? 7 image 이니스프리 19.11.09.22:52 284
304 현재 신제품 구매가 가능한 배터리 탈착식 스마트폰에 어떤 것이 있을까요? 이니스프리 19.11.10.22:18 204
303 유튜브에 유튜버 '분류' 또는 '장르'라는 것이 존재하나요?? 2 이니스프리 19.11.12.21:57 243
302 가계부 프로그램 추천 부탁드립니다! 2 이니스프리 19.11.12.23:59 230
301 스포어 호스팅 사용 중에 실수로 반복문을 잘못 돌리면 계정이 정지되나요? ㅠㅠ 2 이니스프리 19.11.14.00:25 185
300 구글 애드센스 잘아시는분 있나유? 2 슬기 19.11.14.23:54 221
299 윈도우7 익스플로러11에서 인터넷옵션/시작옵션/마지막 세션의 탭으로 시작이 작동이 안됩니다. 3 kyhsyou 19.11.15.10:54 300
298 국내 유료 웹호스팅 사이트 추천을 부탁드립니다 14 이니스프리 19.11.16.00:09 335
297 3.5인치 외장하드 케이스에 SSD를 연결하면 전압과 관련된 문제가 발생할까요? 3 이니스프리 19.11.16.02:04 415
296 카카오 API OCR의 인식률은 어떤가요? 1 이니스프리 19.11.16.22:31 1587
295 코딩 컨벤션상 전역변수와 지역변수의 변수명을 동일하게 하는 것이 무방한가요? 4 이니스프리 19.11.17.18:09 311
294 윈도우 NTFS에서 확장자의 대소문자가 구별되나요? (파이썬 pathlib.Path(file).suffix 관련) 9 이니스프리 19.11.19.00:50 1394
293 네이버 사전을 크롤링할 때 한자의 인코딩 관련 하여 질문 드립니다. (일부 한자만 깨지는 현상) 21 image 이니스프리 19.11.22.16:22 1256
292 기계식 키보드 추천을 부탁드립니다! 20 갱생협스 19.11.24.12:56 241
291 Amazon, Jomashop 등 대형 사이트에서는 크롤러를 어떻게 감지하나요? 10 이니스프리 19.11.24.15:12 1738
290 error page 설정은 어떻해야할까요? 2 슬기 19.11.24.21:27 228
289 데스크탑이냐 랩탑이냐, 그것이 문제입니다. 29 네모 19.11.28.14:15 332
288 노트북 발열 문제를 잘 잡는 분 계실까요? 6 이니스프리 19.12.04.19:04 235
287 [파이썬] 롯데백화점 크롤링과 관련하여 질문을 드립니다 2 image 이니스프리 19.12.04.21:56 267