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

라이트에서 업로드한 2번째 업로드를 리스트에 노출하려고 합니다.  채택완료

alexseo 4년 전 조회 1,644

리스트에서 업로드한 2번째 것 노출시키려면 어떻게 해야하나요?

라이트에서 업로드한 2번째 업로드 이미지를 리스트에 노출하려고 합니다. 

감사합니다

 

 

 

 

                    <div class="gall_img" style="position:relative;">
                        <a href="<?php echo $list[$i]['href'] ?>">
                       
                        <div class="plist" >
                        <?php
                        if ($list[$i]['is_notice']) { // 공지사항  ?>
                            <span class="is_notice">공지</span>
                        <?php } else {
                            $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);

                            if($thumb['src']) {
                                $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';
                            } else {
                                $img_content = '<span class="no_image">no image</span>';
                            }

                            preg_match_all("/<iframe[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i", $list[$i]['wr_content'], $matches);
                            $youtube_url = $matches[1][0];

                            $regExp = '/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/';
                            preg_match($regExp, $matches[1][0], $yurl);

                            $youtube_id = trim($yurl[7]);

                            if($youtube_id){

                            //    $img_content = '<img src="https://img.youtube.com/vi/'.$youtube_id.'/0.jpg" alt="'.$thumb['alt'].'" style="width:'.$board['bo_gallery_width'].'px; height:'.$board['bo_gallery_height'].'px; ">';
                                
                            }

                            echo run_replace('thumb_image_tag', $img_content, $thumb);
                        }
                         ?>
                            <?php

                            $sqlb = " select bf_file from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '".$list[$i]['wr_id']."'  ";        
                            $rsb =sql_query($sqlb);
                            while($rowb = sql_fetch_array($rsb)){
                                $tfarray[] = $rowb['bf_file'];
                            }

                             ?>

                            
                            <?php if(trim($tfarray[1])){ 
                             
                             $tfarray_file = thumbnail($tfarray[1], G5_DATA_PATH.'/file/'.$bo_table, G5_DATA_PATH.'/file/'.$bo_table, $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);
                             if($tfarray_file){
                             ?>
                            <div style="display:none; position:absolute; top:0; left:0; border:0px; border:0px solid #e5e5e5; width:100%; border-bottom:0px;" class="pi_u">
                                <img src="<?php echo G5_URL; ?>/data/file/<?php echo $bo_table.'/'.$tfarray_file?>" border=0  alt="<?php echo $trow['wr_subject']?>" >    
                            </div>
                            <?php } 
                            }
                            
                                unset($tfarray);
                            ?>

                         </div>
                        
                        </a>
                        
                
                    </div>

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

답변 3개

채택된 답변
+20 포인트
4년 전

위 소스로 안되나요?

 $tfarray[] = $rowb['bf_file']; <---이것이 첨부한 이미지를 추출해오는 코드인데 잘 될 것 같아보입니다

그런데 게시판 관리에서 목록에서 화일사용에 체크해두면 이 부분 코드는 필요없고

$list[$i]['file'][1]['file'] 이것을 사용하면 두번째 첨부가 됩니다

 $tfarray_file = thumbnail($list[$i]['file'][1]['file'], ~~~~

 

 

 

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

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

a
4년 전

애드프로님, 균이님, 답변 감사합니다.

 

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

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

업로드한 파일을 리스트에서 출력 원하시는거라면

그누스터디에 자세히 설명되어있습니다.

https://gnustudy.com/bbs/board.php?bo_table=skin_board&wr_id=115

 

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

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

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

로그인