[이윰] 전체검색 리스트 페이지에서 외부 이미지도 썸네일 사용하기

페이지 정보

루루아빠 2,260 2018.05.06 01:01

평점

  • 평점 : 0점 (0명 참여)

본문

전체검색 리스트 페이지에서 외부 이미지도 썸네일 사용하기
전체검색에 첨부 혹은 에디터를 통해 업로드된 이미지 외에 동영상, 외부 이미지 썸네일도 보여지도록 수정해 보자
전체검색 리스트 페이지에서 동영상 썸네일 이미지도 사용하기에 추가적인 작업을 하려 한다.

1. 그누보드5/eyoom/core/search/search.skin.php를 열어 이미지 사용일 경우를 검색한다.

수정 전

        /**
         * 이미지 사용일 경우
         */
        if($eyoom['use_search_image'] == 'y') {
            unset($data['img_content'], $data['img_src']);
            $thumb = get_list_thumbnail($loop1[$idx]['bo_table'], $list[$idx][$i]['wr_id'],$eyoom['search_image_width'], $eyoom['search_image_height']);
            if($tpl_name == 'bs') {
                if($thumb['src']) {
                    $data['img_content'] = '<img class="img-responsive" src="'.$thumb['src'].'" alt="'.$thumb['alt'].'">';
                    $data['img_src'] = $thumb['src'];
                }
            } else {
                if($thumb['src']) {
                    $data['img_content'] = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
                    $data['img_src'] = $thumb['src'];
                }
            }
        }
         
        $loop2[$i] = $data;
    }
수정 후

        /**
         * 이미지 사용일 경우
         */
        if($eyoom['use_search_image'] == 'y') {
            unset($data['img_content'], $data['img_src']);
            $thumb = get_list_thumbnail($loop1[$idx]['bo_table'], $list[$idx][$i]['wr_id'], $eyoom['search_image_width'], $eyoom['search_image_height']);
            if($tpl_name == 'bs') {
                if($thumb['src']) {
                    $data['img_content'] = '<img class="img-responsive" src="'.$thumb['src'].'">';
                    $data['img_src'] = $thumb['src'];
                }
            } else {
                if($thumb['src']) {
                    $data['img_content'] = '<img src="'.$thumb['src'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
                    $data['img_src'] = $thumb['src'];
                }
            }

            $wr_4 = unserialize($list[$idx][$i]['wr_4']);        //추가 시작 - 외부동영상도 썸네일 표시
            if(!$wr_4) $wr_4 = array();

            if($list[$idx][$i]['wr_4'] && !$thumb['src']) {
                $thumb['src'] = $wr_4['thumb_src'];
                if($thumb['src']) {
                    if($tpl_name == 'bs') {
                        if($thumb['src']) {
                            $data['img_content'] = '<img class="img-responsive" src="'.$thumb['src'].'">';
                            $data['img_src'] = $thumb['src'];
                        } else {
                            $data['img_content'] = '<span style="width:100%;">no image</span>';
                        }
                    } else {
                        if($thumb['src']) {
                            $data['img_content'] = '<img src="'.$thumb['src'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
                            $data['img_src'] = $thumb['src'];
                        } else {
                            $data['img_content'] = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
                        }
                    }
                }
            }
            // 게시물에 동영상이 있는지 결정
            $data['is_video'] = $wr_4['is_video'];        //추가 끝

            if (!$thumb['src']) {        //추가 시작 - 외부이미지 썸네일 표시
                $thumb = $eb->make_thumb_from_extra_image($loop1[$idx]['bo_table'], $list[$idx][$i]['wr_id'], $list[$idx][$i]['wr_content'], $eyoom['search_image_width'], $eyoom['search_image_height']);
                if($tpl_name == 'bs') {
                    if($thumb) {
                        $data['img_content'] = '<img class="img-responsive" src="'.$thumb.'">';
                        $data['img_src'] = $thumb;
                    }
                } else {
                    if($thumb['src']) {
                        $data['img_content'] = '<img src="'.$thumb.'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
                        $data['img_src'] = $thumb;
                    }
                }
            }        //추가 끝

        }

        $loop2[$i] = $data;
    }

2. 그누보드5/eyoom/설치된 테마/skin_bs/search/basic/search.skin.html을 열어 <!--{? ..img_content}-->를 검색하여 다음과 같이 수정한다.
수정 전

                    <!--{? ..img_content}-->
                    <div class="result-list-image">
                        <a class="search-result-image">
                            {..img_content}
                        </a>
                    </div>
                    <!--{/}-->
수정 후

                    <!--{? ..img_content}-->
                    <div class="result-list-image">
                        <!--{? ..is_video}--><span class="video-icon"><i class="far fa-play-circle"></i></span><!--{/}-->        <!-- 동영상 폰트어썸 표시 -->
                        <div class="search-result-image">
                            {..img_content}
                        </div>
                    </div>
                    <!--{/}-->
동영상 아이콘(폰트어썸)을 위해 상단 스타일 정의 .search-result-list .result-list .result-list-image 아래에 다음과 같은 스타일을 적용한다.

.search-result-list .result-list .video-icon{position:absolute;top:5px;left:5px;color:#fff;font-size:15px;line-height:15px;z-index:1}
추천인
  • 추천해 주세요
6
루루아빠 - 회원등급 : 최고관리자 - 포인트 : 1,291,370
레벨 96
경험치 1,390,648

Progress Bar 79%

- 가입일 : 2015-03-04 03:24:54
- 서명 : KNOW YOUR LIMITS BUT NEVER STOP TRYING TO EXCEED THEM !!
- 자기소개 : 루루의 자랑 루루아빠랍니다~~

댓글

첫 번째 댓글을 남겨 주세요

Total 242313 페이지
제목 글쓴이 날짜 조회 추천
이윰  🏆 PHP 7.x에서 이윰빌더 알람 푸시(push) 관련 PHP Notice: Undefined index error 해결하기 shadow2fox 2019.01.01 2,132 0
이윰  댓글+4🏆 새로고침 없이 댓글을 달거나 삭제할 수 있는 ajax 댓글 시스템으로 교체하기 shadow2fox 2018.12.11 3,445 2
이윰  댓글+2🏆 회원 프로필 사진 변경시 바로 갱신하여 보여 주기 shadow2fox 2018.12.04 2,433 0
이윰  🏆 마우스 오버시 이전글 다음글에 제목을 띄우기 shadow2fox 2018.11.27 2,063 0
이윰  🏆 Eyoom Builder 3.0.7 패치 shadow2fox 2018.10.15 2,249 0
이윰  🏆 이윰빌더 시즌1 → 시즌4 업그레이드 가이드 shadow2fox 2018.10.05 2,570 0
이윰  🏆 Eyoom Builder 3.0.6 패치 shadow2fox 2018.09.18 2,292 0
이윰  🏆 Eyoom Builder 3.0.5 패치 shadow2fox 2018.09.04 2,187 0
이윰  🏆 태그(tag) 인덱스에서 새로운 글에 new 표시하기 shadow2fox 2018.08.26 2,007 0
이윰  🏆 jQuery-1.8.3를 jQuery-1.9.x 이상으로 업그레이드시 masonry 오류 해결하기 shadow2fox 2018.08.22 1,986 0
이윰  🏆 Eyoom Builder 3.0.4 패치 shadow2fox 2018.08.20 2,691 0
이윰  🏆 Eyoom Builder 3.0.3 - 패치에 문제가 있는 버전입니다. shadow2fox 2018.08.20 2,174 0
이윰  🏆 공지글에는 댓글 기능 끄기 shadow2fox 2018.08.19 2,000 0
이윰  🏆 유튜브 재생목록(플레이리스트)이 적용되지 않는다면 shadow2fox 2018.07.29 2,073 0
이윰  🏆 최신 브라우저에서 푸시 사운드 문제 해결하기 shadow2fox 2018.07.20 1,952 0
이윰  🏆 이윰빌더 최신글 본문 추출시 엔터, 띄어쓰기 태그를 스페이스(한 칸 띄우기)로 바꾸기 shadow2fox 2018.07.12 1,928 0
이윰  댓글+2🏆 작성글 날림 방지하기 shadow2fox 2018.07.04 2,105 0
이윰  🏆 PHP 7.x에서 이윰빌더 알람 푸시(push) 관련 PHP Notice: Undefined index: alarm 해결하기 shadow2fox 2018.07.01 2,092 0
이윰  🏆 내글반응 내용 추출 쌍 따옴표가 &#034;로 표시되는 문제 해결하기 shadow2fox 2018.06.18 2,052 0
이윰  🏆 Eyoom Builder 3.0.2 패치 루루아빠 2018.05.14 2,021 0