get_images 이 소스관련 예제 좀 보여주세요

get_images 이 소스관련 예제 좀 보여주세요

QA

get_images 이 소스관련 예제 좀 보여주세요

본문

회원사진등록할려고하는데 get_images 걸 사용하라고하시는데

 

이거에대한 예제가 없어서요..

 

부탁드립니다^^;; 

이 질문에 댓글 쓰기 :

답변 2

아 회원사진 등록이요? get_images라 적어두셨길래요

사진 등록은 그누에 기본적으로 되어 있을텐데요..

 

/bbs/register_form_update.php // 아이콘 업로드 부분을 참조하세요.


// 이미지를 얻는다
function get_image($img, $width=0, $height=0, $img_id='')
{
    global $g5, $default;
 
    $full_img = G5_DATA_PATH.'/item/'.$img;
 
    if (file_exists($full_img) && $img)
    {
        if (!$width)
        {
            $size = getimagesize($full_img);
            $width = $size[0];
            $height = $size[1];
        }
        $str = '<img src="'.G5_DATA_URL.'/item/'.$img.'" alt="" width="'.$width.'" height="'.$height.'"';
 
        if($img_id)
            $str .= ' id="'.$img_id.'"';
 
        $str .= '>';
    }
    else
    {
        $str = '<img src="'.G5_SHOP_URL.'/img/no_image.gif" alt="" ';
        if ($width)
            $str .= 'width="'.$width.'" height="'.$height.'"';
        else
            $str .= 'width="'.$default['de_mimg_width'].'" height="'.$default['de_mimg_height'].'"';
 
        if($img_id)
            $str .= ' id="'.$img_id.'"'.
        $str .= '>';
    }
 
    return $str;
}
 

위에걸 제가 만든거랑 연결할려면 어떻게해야하나요?

$mb_icon_path = G5_DATA_PATH.'/member/'.substr($member['mb_id'],0,2).'/'.$member['mb_id'].'.gif|png|jpg';
$mb_icon_url = G5_DATA_URL.'/member/'.substr($member['mb_id'],0,2).'/'.$member['mb_id'].'.gif|png|jpg';
?>
<form name="fregisterform" id="fregisterform" action="<?php echo $register_action_url ?>" onsubmit="return fregisterform_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off">
<div class="m01">
       
<p><tr>
        <th scope="row"><label for="reg_mb_icon">Image</label></th>
          <td>
  <span class="frm_info">
                  <?php echo $config['cf_member_icon_width'] ?> <?php echo $config['cf_member_icon_height'] ?>
                  <?php echo number_format($config['cf_member_icon_size']) ?>
        </span>
    <div id="divFake" style="position:relative; left: 5px; width: 150px;height:150px; overflow:hidden;">
              <input id="reg_mb_icon" name="mb_icon" type="file"  class="frm_input" style="font-size: 80px; position: absolute;right:0px;top:0px; opacity:0; filter: alpha(opacity=0);cursor: pointer;"/>
              <img src="/board/mobile/skin/board/mypage/img/photo.gif" style="width: 150px; height :150px;  alt=찾아보기"align="center "/>
      </div>
              <?php if ($w == 'u' && file_exists($mb_icon_path )) {  ?>
                <img src="<?php echo $mb_icon_url ?>" alt="회원 사진" style="width: 500px; height :500px; ">
                <input type="checkbox" name="del_mb_icon" value="1" id="del_mb_icon">
                <label for="del_mb_icon">삭제</label>
                <?php }  ?>
 
            </td>
  </th>
        </tr></p>
    </div>
<input type="submit" value="<?php echo $w==''?'Edit':'정보수정'; ?>" id="btn_submit" class="btn_submit" accesskey="s">

 </form>

이런식으로 만들긴했는데...

<?
function get_image($img, $width=0, $height=0, $img_id='')

{
    global $g5, $default;
    $full_img = G5_DATA_PATH.'/member/'.$img;
    if (file_exists($full_img) && $img)
    {
        if (!$width)
        {
            $size = getimagesize($full_img);

            $width = $size[0];

            $height = $size[1];
        }

        $str = '<img src="'.G5_DATA_URL.'/member/'.$img.'" alt="" width="'.$width.'" height="'.$height.'"';
        if($img_id)
          $str .= ' id="'.$img_id.'"';
        $str .= '>';
    }
    else
    {
      $str = '<img src="'.G5_SKIN_URL.'/board/basic/img/noimage.jpg" alt="" ';
        if ($width)
            $str .= 'width="'.$width.'" height="'.$height.'"';
        else
            $str .= 'width="'.$default['de_mimg_width'].'" height="'.$default['de_mimg_height'].'"';
        if($img_id)
            $str .= ' id="'.$img_id.'"'.
        $str .= '>';
    }
    return $str;
}
?>

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

회원로그인

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