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

조건부 이미지 크기

aboc 2년 전 조회 1,950

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

 

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

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

 

</p>

<p> </p>

<p>// 멤버공개 데이터일 시

$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;

}</p>

<p> </p>

<p>

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

답변 2개

2년 전

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

 

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;     } }  

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

답변에 대한 댓글 1개

a
aboc
2년 전
답변 감사합니다! 그냥 각 else 마다 data_width를 따로 넣는것으로 해결했습니다 ㅠㅠ!!!!

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

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

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

답변에 대한 댓글 1개

a
aboc
2년 전
감사합니다! 다만 전체 글에 적용이 아닌 true 값에서만의 변경을 하고싶은데 이건 불가능한걸까요?
true 에서의 tb width가 적용이 되지 않는 이유를 알고싶었습니다..!!

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

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

로그인