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

[Amina] wr_link1,2 등록된 영상 원본이 삭제된 경우 목록 보기 오류

· 11개월 전 · 695 · 3

 

 

[주] 이후 강좌수정내용의 업데이트가 안될수 있습니다.

본 강좌의 최신업데이트는 https://www.happyjung.com/lecture/3298 에서 확인가능합니다.

가급적 동일한 내용을 유지하려고 노력하지만, 우선 작업은 위 링크입니다.

 

 

아미나 빌더를 사용하는 경우, wr_link1 에 vimeo 링크를 삽입하면 본문에 영상이 자동 보여집니다.
게시판 테이블에 as_thumb 컬럼에 썸네일 이미지가 추출 등록되는데, 이것이 공백인것을 체크하지 못하고 이미지 처리를 하려는 시도로 인한 문제가 발생합니다.

문제된 게시판의 목록의 소스를 보면 목록 상단에서 
    <div class="list-wrap">
        <form name="fboardlist" id="fboardlist" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post" role="form" class="form">
            <input type="hidden" name="bo_table" value="c5">
            <input type="hidden" name="sfl" value="">
            <input type="hidden" name="stx" value="">
            <input type="hidden" name="spt" value="">
            <input type="hidden" name="sca" value="">
            <input type="hidden" name="sst" value="wr_num, wr_reply">
            <input type="hidden" name="sod" value="">
            <input type="hidden" name="page" value="1">
            <input type="hidden" name="sw" value="">

            <div class="list-container">
이후의 오류가 발생합니다.

list.skin.php 내용을 보면
            <div class="list-container">
                <?php
                $k = 0;
                for ($i=0; $i < $list_cnt; $i++) {
                    ... 중략 ...
                    // 썸네일
                    $list[$i]['no_img'] = $board_skin_url.'/img/no-img.jpg'; // No-Image
                    $img = apms_wr_thumbnail($bo_table, $list[$i], $thumb_w, $thumb_h, false, true);


해당 게시글을 디비에서 확인하니 wr_link1 에 https://vimeo.com/111111111 의 경로가 확인되었고,
이것을 브라우저로 열어보니 아래와 같이 없는 페이지로 표시되네요




이것을 수정하기 위해 아래의 사항을 수정하였습니다.

lib/apms.video.lib.php 

        $tmp_thumb = apms_video_thumbnail($write['as_thumb'], 1);
        if($tmp_thumb) {
            $z = 1;
            $img[0]['img'] = $tmp_thumb;
            $img[0]['alt'] = '';
            $make_thumb = false;
            unset($write);
        }

를 아래와 같이 변경

        $tmp_thumb = apms_video_thumbnail($write['as_thumb'], 1);
        if($tmp_thumb && $write['as_thumb']) {
            $z = 1;
            $img[0]['img'] = $tmp_thumb;
            $img[0]['alt'] = '';
            $make_thumb = false;
            unset($write);
        }

댓글 작성

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

로그인하기

댓글 3개

11개월 전

아미나 설치만해놓고 안쓰지만 apms.video.lib.php 수정해서 사용하시는거아니신지

원본파일 보면 해당 소스가 없네요.

 

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
apms_autosize();
?>
<script src="<?php echo G5_JS_URL;?>/apms.video.js"></script>
<div class="modal fade" id="apmsVideoModal" tabindex="-1" role="dialog" aria-labelledby="apmsVideoModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body">
                <div class="apms-autowrap" style="max-width:100% !important;">
                    <div id="apmsVideoWrap" class="apms-autosize">
                        <iframe id="apmsVideoPlayer" src="" width="640" height="360" frameborder="0"></iframe>
                    </div>
                </div>
                <div style="margin-top:12px;">
                    <button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">×</button>
                    <div id="apmsVideoContent" class="pull-left"></div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</div>

 

이게 전부인데 원본 파일엔

11개월 전

@북마크스 앗 그런가요? 하하하... 커스텀이었는지도 모르겠네요.

제가 처음 제작한 사이트가 아니라, 유지보수를 이후 맡아서 해서, 순정여부는 확인하지 못했네요.

11개월 전

감사 합니다.

게시글 목록

번호 제목
24318
24317
24315
24309
24294
24293
24277
24262
24260
24253
24251
24236
24233
24228
24226
24221
24214
24203
24201
24199
24196
24195
24194
24192
24191
24187
24185
24183
24172
24168