글쓸때 첨부한 3번째 이미지파일 최신글에 불러오는 방법좀요 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

글쓸때 첨부한 3번째 이미지파일 최신글에 불러오는 방법좀요 정보

글쓸때 첨부한 3번째 이미지파일 최신글에 불러오는 방법좀요

본문

첨부파일에 첨부된 
$file01
$file02
$file03
파일중 01,02파일은 불러와서 작동되는데

$file03파일을 불러와서
<div id="fragment-<?=$j?>"  class="ui-tabs-panel <?=$hide?>">....</div>배경으로 넣어서
같이 이미지 전환되게 하려고 하는데요
어떻게 수정해야 하나요.


=================================================================================================
<div id="featured" ><div id="featured1">
 <ul class="ui-tabs-nav">

<?
for ($i=0; $i<count($list); $i++) {
$file01 = "$data_path/".urlencode($list[$i][file][0][file]);
$file02 = "$data_path/".urlencode($list[$i][file][1][file]);
                $file03 = "$data_path/".urlencode($list[$i][file][2][file]);
$link_01 = $list[$i][wr_link1];
$j = $i + 1; 
if ($j == "1") {
$selected='ui-tabs-selected';
} else {
$selected='';}
//썸네일 생성
$thumfile = "";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    // 썸네일 이미지가 존재하지 않는다면
    if (!file_exists($thumb)) {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        // 업로드된 파일이 이미지라면
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                break;

            $rate = $img_width / $size[0];
            $height = (int)($size[1] * $rate);

            // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
            if ($height < $img_height)
                // 계산된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $height);
            else
                // 설정된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $img_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        } else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4/{$ym}/[^<>]*\.(gif|jpg|png|bmp)", $edit_img, $tmp)) { // data/geditor------
$file = './' . $tmp[0]; // 파일명
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;

$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);

// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
    }
}

    if (file_exists($thumb))
        $thumfile = "$thumb";
else
//이미지가 없으면
$thumfile="$latest_skin_path/img/noimg.gif";
//이미지가 아니네
        if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
      { $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }
?>
      <li class="ui-tabs-nav-item <?=$selected?>" id="nav-fragment-<?=$j?>"><a href="#fragment-<?=$j?>"><img src="<?=$file02?>" alt="" width="80" height="50" /></a></li>
<? }?>
 </ul></div>

<!-- First Content -->
<?
for ($i=0; $i<count($list); $i++) {
$file01 = $thumb_path.'/'.$list[$i][wr_id];
$j = $i + 1; 
if ($j == "1") {
$hide='';
} else {
$hide='ui-tabs-hide'; }
?>
▼이부분에 첨부된 03파일 불러오고싶어서요


<div id="fragment-<?=$j?>"  class="ui-tabs-panel <?=$hide?>"><div style="width: 940px; height: 300px; margin:0 auto; position: relative; background-color: #9C0;">
<a href='<?=$link_01?>'><img src="<?=$file01?>" alt="" /></a>
</div></div>
    <? }?>
</div>
</div>

=======================================================
스타일은 어떤식으로 줘야 하는지..

 #featured .ui-tabs-panel{
width:100%;
height:300px;
position:relative;
background-color: #FF6600;
background-image: url(<?=$file03?>);
background-repeat: repeat-x;
}

댓글 전체

첨부파일의 세번째 파일은 $list[$i]['file'][2]['file'] 가 세번째 파일입니다
첨부파일은 $list[$i]['file'][0] 부터 시작해서 첨부한 파일의 -1 만큼이지요
즉, 3개의 첨부파일이면 0, 1, 2 로 해서 2번이 3번째 파일이 됩니다
전체 32 |RSS
그누4 질문답변 내용 검색

회원로그인

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