<?
if($result_code == '0000') {
    echo '0000|||||';
    $title = $result['title'];
    $title_txt = mb_strimwidth($title, '0', '60', '..', 'utf-8');
    switch ($content_type) {
        case '1': $img_view_url = '/web/news/news_view/'.$result['idx'];	$content_name='뉴스'; $content_main_url='/web/news'; break;
        case '2': $img_view_url = '/web/news/column_view/'.$result['idx'];	$content_name='칼럼'; $content_main_url='/web/news/column'; break;
        case '3': $img_view_url = '/web/life/life_view/'.$result['idx'];	$content_name='라이프'; $content_main_url='/web/life'; break;
    }

    $main_img =$result['main_img'];
    $info = getimagesize(WWW_CROSSMAP.$main_img);
    $img_width 	= $info[0];
    $img_height = $info[1];
    $img_mime   = $info[2];

    $img_type = array('1'=>'GIF', '2'=>'JPG','3'=>'PNG','4'=>'PSD','5'=>'BMP','6'=>'TIFF','7'=>'TIFF','8'=>'JPC','9'=>'JP2','10'=>'JPX','11'=>'JB2','12'=>'SWC','13'=>'IFF','14'=>'WBMP','15'=>'XBM');
    $alt_text =     $title;
    if($result['category_name']!='')	$alt_text.= ' - '.$result['category_name'];

?>
         <span class="click_close"><a href="javascript:close_image_popup();"><img src="/img/web/photo_close.png"></a></span>
			<span class="click_left">
            <? if(isset($arr_prev['idx'])==true) { ?>
                <a href="javascript:img_view('<?=$arr_prev['content_type']?>','<?=$arr_prev['idx']?>','<?=$arr_prev['row_num']?>','<?=$search_keyword?>');"><img src="/img/web/photo_left.png"></a>
            <?  } else {?>
                <img src="/img/web/photo_left.png">
            <?  }?>
            </span>
			<span class="click_right">
            <? if(isset($arr_next['idx'])==true) { ?>
                <a href="javascript:img_view('<?=$arr_next['content_type']?>','<?=$arr_next['idx']?>','<?=$arr_next['row_num']?>','<?=$search_keyword?>');"><img src="/img/web/photo_right.png"></a>
            <?  } else {?>
                <img src="/img/web/photo_right.png">
            <?  }?>
            </span>

			<div class="viewer_box_wrap">
				<div class="viewer_photo">
                    <a href="<?=$img_view_url?>" title="<?=$alt_text?>"><p style="cursor:pointer;width:434px;height:225px;background:url('<?=$main_img?>') no-repeat center; background-size:cover;"></p></a>
				</div>
				<div class="viewer_box">
					<a href=""><h2><?=$title_txt?></h2></a>
					<div class="search_info" style="font-weight:bold; margin-bottom:20px;">
						<a href="<?=$content_main_url?>"><span class="beachblue"><?=$content_name?></span></a>
						<span><?=$img_width?>*<?=$img_height?></span>
						<span>|</span>
						<span><?=$img_type[$img_mime]?></span>
					</div>
					<div class="small_photos">
                <?  foreach ($arr_relation_img as $val2) {
                        switch ($val2['content_type']) {
                            case '1': $img_view_url1 = '/web/news/news_view/'.$val2['idx'];     break;
                            case '2': $img_view_url1 = '/web/news/column_view/'.$val2['idx'];	break;
                            case '3': $img_view_url1 = '/web/life/life_view/'.$val2['idx'];	     break;
                        }

                ?>
                        <a href="<?=$img_view_url1?>" title="<?=$alt_text?>"><p style="cursor:pointer;width:70px;height:70px;background:url('<?=$val2['main_img']?>') no-repeat center; background-size:cover;"></p></a>
                <?
                    }
                ?>
					</div>
				</div>
			</div>

<?

} else {
    echo $result_code.'|||||이미지 가져오기에 실패했습니다.';

}
?>



