테스트 사이트 - 개발 중인 베타 버전입니다

게시판 view.skin.html 에서 첨부파일 안보이게 하고 싶ㅇ어요. 채택완료

완전땡초보 4년 전 조회 1,532

안녕하세요?

다름이 아니오라 게시물에 달린 댓글과 댓글에 달린 첨부파일이 관리자만 보이게 하고 싶어요.

어떻게 해야 하나요? 제가 수리한 내역을 게시판에 올리고 그내용과 사진을 댓글로 남기는데

다른 사람이 첨부파일 목록도 보이지 않게 해야 합니다.

 

나요?

 

 

소스를 보니 요근처에서 뭔가 추가 해줘야 하는거 같은데 잘 모르겠습니다.

      

       
                           

    0) { ?>        

       
                       
  •                
                        - 첨부파일 : () - 다운로드                
                                   
               
  •                
   
       

    0) { ?>        

       

   

 

 

 

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트
4년 전

일단

 

0 && $is_admin { ?>

 

이런식으로 해주면 되긴하는데요

 

위의 것은 첨부파일만이고 좀 더 상위쪽에서 if ($is_admin) 을 쓰시면 될 것 같아요

 

지금 써주신 것보다 더 상위 개념에서요

로그인 후 평가할 수 있습니다

답변에 대한 댓글 7개

완전땡초보
4년 전
</div>

<?php if ($cnt > 0) { ?> ---------> <?php if ($cnt > 0 && $is_admin { ?> 이렇게요?
<?php /* 첨부파일 시작 */?>
<div class="board-view-file">

답변감사드려요.
한번 해보겠습니다.
답변 채택부터 꾹! 누릅니다.^^
블랑숑
4년 전
네 근데 그건 첨부파일만 적용되는거고 위에서 다 아우를 수 있는 부분이 있을거에요
완전땡초보
4년 전
<?php if ($cnt > 0 && $is_admin { ?>
일단 이렇게 하니까

Error 500 - Internal Server Error
A generic error message, given when no more specific message is suitable

에러가.....
혹시 틀린 글씨가 있는건가요?
블랑숑
4년 전
괄호를 안 닫으셨네요
완전땡초보
4년 전
) 닫고 했습니다. 에러는 안나는군요.
그래도 댓글에 넣은 첨부 파일은 일반 방문자도 보이네요. ㅠ ㅜ
완전땡초보
4년 전
혹시 가르쳐 주신건 본문의 사진위헤 나타나는 첨부파일이 안보이게 해주신거 같아요.
저는 본문 밑에 달리는 댓글내 첨부파일이 안보이게 하는걸 원해서요. ㅠ ㅠ
블랑숑
4년 전
<?php if($is_admin) { include_once(G5_BBS_PATH . '/view_comment.php'); } ?>

이렇게 해보세요

댓글을 작성하려면 로그인이 필요합니다.

4년 전

지금 주신 소스내에서 말씀드린거에요

 

혹시 다른 부분을 원하시면 그 부분 소스를 찾아서 적용하시면 됩니다

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

완전땡초보
4년 전
감사합니다. 제가 소스를 엉뚱한 곳을 드린거 군요.

댓글시작 이라고 있기는 합니다.

<?php /* 댓글 시작 */?>
<?php include_once(G5_BBS_PATH . '/view_comment.php'); ?>
<?php /* 댓글 끝 */?>
완전땡초보
4년 전
눈치를 보니 bbs/view_comment.php 에서 수정해야 하는 건가요? ^^
소스입니다.


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');

$captcha_html = "";
if ($is_guest && $board['bo_comment_level'] < 2) {
$captcha_html = captcha_html('_comment');
}

@include_once($board_skin_path.'/view_comment.head.skin.php');

$list = array();

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

// 코멘트 출력
//$sql = " select * from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 order by wr_comment desc, wr_comment_reply ";
$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$list[$i] = $row;

//$list[$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 ($board['bo_use_sideview'])
$list[$i]['name'] = get_sideview($row['mb_id'], $tmp_name, $row['wr_email'], $row['wr_homepage']);
else
$list[$i]['name'] = '<span class="'.($row['mb_id']?'member':'guest').'">'.$tmp_name.'</span>';



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

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

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

$list[$i]['datetime'] = substr($row['wr_datetime'],2,14);

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

$list[$i]['is_reply'] = false;
$list[$i]['is_edit'] = false;
$list[$i]['is_del'] = false;
if ($is_comment_write || $is_admin)
{
$token = '';

if ($member['mb_id'])
{
if ($row['mb_id'] === $member['mb_id'] || $is_admin)
{
set_session('ss_delete_comment_'.$row['wr_id'].'_token', $token = uniqid(time()));
$list[$i]['del_link'] = G5_BBS_URL.'/delete_comment.php?bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;token='.$token.'&amp;page='.$page.$qstr;
$list[$i]['is_edit'] = true;
$list[$i]['is_del'] = true;
}
}
else
{
if (!$row['mb_id']) {
$list[$i]['del_link'] = G5_BBS_URL.'/password.php?w=x&amp;bo_table='.$bo_table.'&amp;comment_id='.$row['wr_id'].'&amp;page='.$page.$qstr;
$list[$i]['is_del'] = true;
}
}

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

// 05.05.22
// 답변있는 코멘트는 수정, 삭제 불가
if ($i > 0 && !$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 == $list[$i-1]['wr_comment_reply'])
{
$list[$i-1]['is_edit'] = false;
$list[$i-1]['is_del'] = false;
}
}
}
}

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

$comment_action_url = https_url(G5_BBS_DIR)."/write_comment_update.php";
$comment_common_url = short_url_clean(G5_BBS_URL.'/board.php?'.clean_query_string($_SERVER['QUERY_STRING']));

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

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

@include_once($board_skin_path.'/view_comment.tail.skin.php');
?>

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인