조건부 이미지 크기

조건부 이미지 크기

QA

조건부 이미지 크기

본문

회원이 아닐경우에 뜨는 이미지와 회원일경우에 뜨는 이미지의 크기를 다르게 설정하고싶은데 이 코드에서 수정해야할 부분이 있을까요?

 

회원이 아닐경우 뜨는 이미지의 가로 길이가 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;
}
 

이 질문에 댓글 쓰기 :

답변 2

if($member['mb_level']){
$data_width = 1000;
}else{
$data_width = 300;
}

이렇게 해보는건 어떠실까요?

 

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 = "";
        }
    }
    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 ($is_viewer) {
        $data_width = $tb_width;
    }
}
 

답변을 작성하시기 전에 로그인 해주세요.
전체 123,641 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT