회원이 아닐경우 뜨는 이미지의 가로 길이가 300인데 회원일경우 이미지가 1000 으로 떴으면 합니다.
본문 바로가기
그누보드 _자유로운 _개발자

회원이 아닐경우 뜨는 이미지의 가로 길이가 300인데 회원일경우 이미지가 1000 으로 떴으면 합니다.

by AICanvas 2023. 6. 7.
728x90
SMALL

[질문]
회원이 아닐경우 뜨는 이미지의 가로 길이가 300인데 회원일경우 이미지가 1000 으로 떴으면 합니다.

지금은 회원이든 아니든 계속 300으로만 뜨고 있어서 답답한 마음에 질문해봅니다...!

 

 
// 멤버공개 데이터일 시
$is_viewer = true;
$data_width = 300;
$no_member_class = '';    
if(strstr($list_item['wr_option'],"secret") ) {
    if( !$list_item['mb_id'] && get_session("ss_secret_{$bo_table}_{$list_item['wr_num']}") ||  $list_item['mb_id'] && $list_item['mb_id']==$member['mb_id'] || $is_admin )
        $is_viewer = true;
    else {
    $is_viewer = false;
    $no_member_class= 'empty secret'; 
    }
} else if ($list_item['wr_protect']!=''){
    if( get_session("ss_secret_{$bo_table}_{$list_item['wr_num']}") ||  $list_item['mb_id'] && $list_item['mb_id']==$member['mb_id'] || $is_admin )
        $is_viewer = true;
    else {
    $is_viewer = false;
    $no_member_class= 'empty protect'; 
    }
}else if($list_item['wr_secret'] == '1') {
    if($board['bo_read_level'] < $member['mb_level'] && $is_member)
        $is_viewer = true; 
    else {
    $is_viewer = false;
    $no_member_class = ' empty ';
    }
}  else {
    $is_viewer=true;
    $tb_width=1000;
    if($board['bo_table_width']>100)
        $tb_width=$board['bo_table_width'];
    if($board['bo_image_width']>0 && $image_width>$board['bo_image_width'] || $image_width>$tb_width) {
        if($list_item['wr_type']!='VIDEO' && $list_item['wr_type']!='TEXT' )
            $msg=""; 
        } //@200602
    if($board['bo_image_width']>0 && $image_width>$board['bo_image_width'] && $list_item['wr_wide']!='1'){
        $data_width=$board['bo_image_width'];
        }
    else if($image_width<300)
        $data_width=300;
    else $data_width = $image_width;
}

 

[답글]

if (비교판단 조건)

if ($list_item['wr_protect'] != '') {
    // 이전 코드
    // ...

    // 수정 코드
    if ($is_member) {
        $data_width = 1000;
    } else {
        $data_width = 300;
    }

    // 이전 코드
    // ...
} else {
    // 이전 코드
    // ...
}

이미지 출력

<img src="이미지_경로" width="<?php echo $data_width; ?>" alt="이미지 설명">
728x90
LIST

댓글